Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check
on:
workflow_dispatch:
push:

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm check-all
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: ".nvmrc"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm build:all-widgets
# TODO: replace this step with a CDN upload once the target is decided.
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ ORG_ID=atb pnpm start

Then open http://localhost:3001/widget/preview


## How it works

The widget is a vanilla JS library with no framework dependencies. Host websites
Expand Down Expand Up @@ -71,7 +70,10 @@ Each build produces four files per organization, output to
Include the following in your HTML,

```html
<link rel="stylesheet"href="https://reise.example.no/widget/<version>/<org-id>/planner-web.css" />
<link
rel="stylesheet"
href="https://reise.example.no/widget/<version>/<org-id>/planner-web.css"
/>
```

```html
Expand All @@ -82,10 +84,10 @@ Include the following in your HTML,
<script src="https://reise.example.no/widget/<version>/<org-id>/planner-web.umd.js"></script>
<script>
const widget = window.PlannerWeb.createWidget({
urlBase: 'https://reise.example.no/',
language: 'nb',
urlBase: "https://reise.example.no/",
language: "nb",
});
document.querySelector('#planner-widget').innerHTML = widget.output;
document.querySelector("#planner-widget").innerHTML = widget.output;
widget.init();
</script>
```
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"build:widget": "sh ./scripts/build-widget.sh",
"build:all-widgets": "sh ./scripts/build-all-widgets.sh",
"start": "node server.mts",
"typecheck": "tsc --noEmit",
"format": "prettier --write .",
"format:check": "prettier --check ."
"format:check": "prettier --check .",
"check-all": "pnpm typecheck && pnpm format:check && pnpm build:all-widgets"
},
"engines": {
"node": ">=24.0.0"
Expand Down
86 changes: 43 additions & 43 deletions src/styles/assistant.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
align-items: center;
}
.container {
background-color: token('color.background.neutral.1.background');
background-color: token("color.background.neutral.1.background");
height: 100%;
position: relative;
display: grid;
grid-template-areas:
'main'
'alternatives';
"main"
"alternatives";
width: 100%;
max-width: var(--maxPageWidth);
}
Expand All @@ -19,14 +19,14 @@
grid-area: main;
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: token('spacing.xLarge');
grid-gap: token("spacing.xLarge");
width: 100%;
max-width: var(--maxPageWidth);
padding: token('spacing.xLarge');
padding: token("spacing.xLarge");
margin: 0 auto;
margin-top: token('spacing.large');
background-color: token('color.background.neutral.0.background');
border-radius: token('border.radius.regular');
margin-top: token("spacing.large");
background-color: token("color.background.neutral.0.background");
border-radius: token("border.radius.regular");
}

.input {
Expand All @@ -45,71 +45,71 @@
}

.heading {
color: token('color.background.accent.0.foreground.primary');
margin-bottom: token('spacing.medium');
color: token("color.background.accent.0.foreground.primary");
margin-bottom: token("spacing.medium");
}

.alternativesWrapper {
grid-area: alternatives;
width: 100%;
background-color: token('color.background.neutral.0.background');
padding: token('spacing.xLarge');
background-color: token("color.background.neutral.0.background");
padding: token("spacing.xLarge");
max-width: var(--maxPageWidth);
margin: 0 auto;
border-radius: 0 0 token('border.radius.regular')
token('border.radius.regular');
border-radius: 0 0 token("border.radius.regular")
token("border.radius.regular");
}

.alternatives {
display: flex;
flex-direction: column;
gap: token('spacing.medium');
padding: token('spacing.large');
gap: token("spacing.medium");
padding: token("spacing.large");
width: 100%;
max-width: var(--maxPageWidth);
margin: 0 auto;
margin-bottom: 5.75rem;
display: flex;
flex-direction: column;
gap: token('spacing.large');
background-color: token('color.background.neutral.2.background');
border-radius: token('border.radius.regular');
gap: token("spacing.large");
background-color: token("color.background.neutral.2.background");
border-radius: token("border.radius.regular");
}

.buttons {
grid-area: alternatives;
align-self: end;
display: flex;
justify-content: flex-end;
gap: token('spacing.medium');
gap: token("spacing.medium");
width: 100%;
max-width: var(--maxPageWidth);
margin: 0 auto;
padding: token('spacing.medium') token('spacing.large') token('spacing.large')
token('spacing.large');
padding: token("spacing.medium") token("spacing.large") token("spacing.large")
token("spacing.large");
z-index: 10;
position: absolute;
left: 0;
right: 0;
background-color: token('color.background.neutral.0.background');
border-radius: 0 0 token('border.radius.regular')
token('border.radius.regular');
background-color: token("color.background.neutral.0.background");
border-radius: 0 0 token("border.radius.regular")
token("border.radius.regular");
}

.searchInputButton {
height: var(--height);
border: none;
background-color: token('color.background.neutral.0.background');
border: token('border.width.slim') solid
token('color.foreground.dynamic.disabled');
padding: token('spacing.small');
background-color: token("color.background.neutral.0.background");
border: token("border.width.slim") solid
token("color.foreground.dynamic.disabled");
padding: token("spacing.small");
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
position: absolute;
top: 50%;
right: token('spacing.medium');
right: token("spacing.medium");
transform: translate(0, -50%);
z-index: 100;
}
Expand All @@ -121,16 +121,16 @@
@media (max-width: 650px) {
.container {
grid-template-areas:
'main'
'buttons'
'alternatives';
"main"
"buttons"
"alternatives";
}

.main {
display: flex;
flex-direction: column;
padding-bottom: token('spacing.xLarge') !important;
border-radius: token('border.radius.regular') token('border.radius.regular')
padding-bottom: token("spacing.xLarge") !important;
border-radius: token("border.radius.regular") token("border.radius.regular")
0 0;
}

Expand All @@ -142,19 +142,19 @@
}

.alternativesWrapper {
padding: token('spacing.small');
padding: token("spacing.small");
}

.alternatives {
padding: token('spacing.medium');
padding: token("spacing.medium");
}

.removeAllBorderRadius {
border-radius: 0;
}

.container {
padding: token('spacing.medium');
padding: token("spacing.medium");
}

.walkSpeedSegments {
Expand All @@ -166,29 +166,29 @@
margin: 0 auto;
width: 100%;
max-width: var(--maxPageWidth);
padding: token('spacing.xLarge');
padding: token("spacing.xLarge");
display: flex;
flex-direction: column;
gap: token('spacing.medium');
gap: token("spacing.medium");
}

.tripResults {
display: flex;
flex-direction: column;
gap: token('spacing.large');
gap: token("spacing.large");
}

.nonTransitResult {
display: flex;
flex-wrap: wrap;
gap: token('spacing.medium');
gap: token("spacing.medium");
}

.spanColumns {
grid-column: 1 / -1;
}

.removeBorderRadiusBottom {
border-radius: token('border.radius.regular') token('border.radius.regular') 0
border-radius: token("border.radius.regular") token("border.radius.regular") 0
0;
}
Loading