diff --git a/README.md b/README.md index cc331c3606..752f92210e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ This repository contains the Government of Alberta Design System component libra | `@abgov/react-components` | You are building a React application. | [npm](https://www.npmjs.com/package/@abgov/react-components) | | `@abgov/angular-components` | You are building an Angular application. | [npm](https://www.npmjs.com/package/@abgov/angular-components) | | `@abgov/ui-components-common` | You need shared types, event detail interfaces, or common utilities used by the component packages. | [npm](https://www.npmjs.com/package/@abgov/ui-components-common) | -| `@abgov/design-tokens` | You need the design tokens used by the components. | [npm](https://www.npmjs.com/package/@abgov/design-tokens) | `@abgov/styles` is deprecated. Import `@abgov/web-components/index.css` instead. @@ -28,7 +27,7 @@ This repository contains the Government of Alberta Design System component libra Install the packages: ```bash -npm i @abgov/web-components @abgov/design-tokens +npm i @abgov/web-components ``` Register the custom elements in your app entry point, for example `src/main.js`: @@ -37,11 +36,10 @@ Register the custom elements in your app entry point, for example `src/main.js`: import "@abgov/web-components"; ``` -Import the component styles and tokens in your main stylesheet: +Import the component styles in your main stylesheet. This stylesheet includes the design tokens and dark theme overrides: ```css @import "@abgov/web-components/index.css"; -@import "@abgov/design-tokens/dist/tokens.css"; ``` Add Ionicons to your `index.html` `
`: @@ -64,7 +62,7 @@ Supported React versions: `17`, `18`, `19`. Install the packages: ```bash -npm i @abgov/react-components @abgov/web-components @abgov/ui-components-common @abgov/design-tokens +npm i @abgov/react-components @abgov/web-components @abgov/ui-components-common ``` Register the underlying web components in your app entry point, for example `src/main.tsx`: @@ -73,11 +71,10 @@ Register the underlying web components in your app entry point, for example `src import "@abgov/web-components"; ``` -Import the styles in your main stylesheet: +Import the component styles in your main stylesheet. This stylesheet includes the design tokens and dark theme overrides: ```css @import "@abgov/web-components/index.css"; -@import "@abgov/design-tokens/dist/tokens.css"; ``` Add Ionicons to your `index.html` ``: @@ -104,7 +101,7 @@ Supported Angular versions in the current docs: `18`, `19`, `20`, `21`. Install the packages: ```bash -npm i @abgov/web-components @abgov/angular-components @abgov/ui-components-common @abgov/design-tokens +npm i @abgov/web-components @abgov/angular-components @abgov/ui-components-common ``` Add Ionicons to `src/index.html`: @@ -135,11 +132,10 @@ export class AppModule {} If your Angular app uses standalone bootstrapping instead of `AppModule`, use the same package installs, web component import, styles, and Ionicons setup, then adapt the module example to your bootstrap configuration. -Import the styles in `src/styles.css`: +Import the component styles in `src/styles.css`. This stylesheet includes the design tokens and dark theme overrides: ```css @import "@abgov/web-components/index.css"; -@import "@abgov/design-tokens/dist/tokens.css"; ``` ## Local development diff --git a/apps/prs/angular/project.json b/apps/prs/angular/project.json index 0616e2eac4..a2d65563a1 100644 --- a/apps/prs/angular/project.json +++ b/apps/prs/angular/project.json @@ -25,17 +25,9 @@ "tsConfig": "apps/prs/angular/tsconfig.app.json", "assets": [ "apps/prs/angular/src/favicon.ico", - "apps/prs/angular/src/assets", - { - "glob": "**/*", - "input": "node_modules/@abgov/design-tokens-v2/dist", - "output": "/v2-tokens" - } - ], - "styles": [ - "apps/prs/angular/src/styles.css", - "node_modules/@abgov/design-tokens-v2/dist/tokens.css" + "apps/prs/angular/src/assets" ], + "styles": ["apps/prs/angular/src/styles.css"], "scripts": [] }, "configurations": { diff --git a/apps/prs/angular/src/app/app.component.html b/apps/prs/angular/src/app/app.component.html index 258080a3b2..e2a115caed 100644 --- a/apps/prs/angular/src/app/app.component.html +++ b/apps/prs/angular/src/app/app.component.html @@ -8,16 +8,11 @@ userSecondaryText="edna.mode@gov.ab.ca" (onNavigate)="handleNavigate($event)" [primaryContent]="primaryTemplate" - [secondaryContent]="tokenToggleTemplate" + [secondaryContent]="secondaryTemplate" [accountContent]="accountTemplate" /> -Value: {{ selectAllValues | json }}
diff --git a/apps/prs/angular/src/routes/docs/checkbox-list/checkbox-list.component.ts b/apps/prs/angular/src/routes/docs/checkbox-list/checkbox-list.component.ts index 8e421a43c9..cbfa5e8c7a 100644 --- a/apps/prs/angular/src/routes/docs/checkbox-list/checkbox-list.component.ts +++ b/apps/prs/angular/src/routes/docs/checkbox-list/checkbox-list.component.ts @@ -4,7 +4,10 @@ import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from "@angul import { GoabCheckbox, GoabCheckboxList, GoabFormItem, GoabTextArea, } from "@abgov/angular-components"; -import type { GoabCheckboxListOnChangeDetail } from "@abgov/ui-components-common"; +import type { + GoabCheckboxListOnChangeDetail, + GoabCheckboxOnChangeDetail, +} from "@abgov/ui-components-common"; @Component({ standalone: true, @@ -21,8 +24,26 @@ export class DocsCheckboxListComponent { }); ngModelInterests: string[] = []; + readonly selectAllOptions = ["email", "text", "push"]; + selectAllValues: string[] = []; + + get allOptionsSelected(): boolean { + return this.selectAllValues.length === this.selectAllOptions.length; + } + + get someOptionsSelected(): boolean { + return this.selectAllValues.length > 0 && !this.allOptionsSelected; + } checkboxListOnChange(event: GoabCheckboxListOnChangeDetail): void { console.log(event); } + + selectAllOnChange(event: GoabCheckboxOnChangeDetail): void { + this.selectAllValues = event.checked ? [...this.selectAllOptions] : []; + } + + selectAllListOnChange(event: GoabCheckboxListOnChangeDetail): void { + this.selectAllValues = event.value; + } } diff --git a/apps/prs/angular/src/styles.css b/apps/prs/angular/src/styles.css index 8078d0e064..963ef40b19 100644 --- a/apps/prs/angular/src/styles.css +++ b/apps/prs/angular/src/styles.css @@ -1,7 +1,5 @@ /* You can add global styles to this file, and also import other style files */ @import "../../../../dist/libs/web-components/index.css"; -@import "@abgov/design-tokens-v2/dist/tokens.css"; -@import "@abgov/design-tokens-v2/dist/dark-theme.css"; :root { --goa-space-fill: 32ch; diff --git a/apps/prs/react/src/app/app.tsx b/apps/prs/react/src/app/app.tsx index 9467aac0d1..34ec735db5 100644 --- a/apps/prs/react/src/app/app.tsx +++ b/apps/prs/react/src/app/app.tsx @@ -22,15 +22,6 @@ import { featureRouteDefinitions, } from "./route-manifest"; import "@abgov/style"; -// Runtime V1/V2 token switching. Importing this module applies the currently -// selected token set (default V2) to before the app renders. The -// playground's work-side-menu exposes a secondary item that flips between -// V1 and V2 at runtime without editing source or restarting the dev server. -import { - applyTokenVersion, - resolveTokenVersion, - type TokenVersion, -} from "./tokenVersion"; const PUSH_DRAWER_ROUTE_PATH = "/features/3347-push"; const pushDrawerTestParagraphs = Array.from({ length: 30 }, (_, i) => i + 1); @@ -93,9 +84,6 @@ export interface AppOutletContext { openPushDrawer: () => void; } -// Sentinel URL handled by onNavigate below to toggle tokens instead of routing. -const TOKEN_TOGGLE_URL = "#tokens"; - // Demo: a slotted page-header that shrinks its heading once content scrolls // under the pinned header. It reads the layout's scroll state via the context // hook (no prop drilling), using the same middle / at-bottom states that drive @@ -139,7 +127,6 @@ export function App() { const isDark = mode === "dark"; const location = useLocation(); const baseUrl = import.meta.env.BASE_URL; - const [tokenMode, setTokenMode] = useStateValue: {JSON.stringify(selectAllValues)}
Opens from the left side of the screen.
`, }, - webComponents: `Opens from the left side of the screen.
Make changes to your settings here.
`, }, - webComponents: `Make changes to your settings here.
Narrow width for simple content.
`, }, - webComponents: `Narrow width for simple content.
Wide width for more complex content.
`, }, - webComponents: `Wide width for more complex content.
Apply for government services quickly and easily online.
Are you sure you want to proceed with this action?
You can close this modal with the X button or by clicking the backdrop.
`, }, - webComponents: `You can close this modal with the X button or by clicking the backdrop.
This action cannot be undone. The item will be permanently removed.
You will be logged out in 5 minutes due to inactivity.
We have updated the application with new features. Review the changes to get started.
`, }, - webComponents: `We have updated the application with new features. Review the changes to get started.
Your application has been successfully submitted. You will receive a confirmation email shortly.
`, }, - webComponents: `Your application has been successfully submitted. You will receive a confirmation email shortly.
This modal has a wider maximum width for more content.
`, }, - webComponents: `This modal has a wider maximum width for more content.