@a11ypros/a11y-ui-components 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -157
- package/dist/components/Button/Button.d.ts +37 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +52 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/components/DataTable/DataTable.d.ts +71 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +122 -0
- package/dist/components/DataTable/index.d.ts +3 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/DataTable/index.js +1 -0
- package/dist/components/Form/Checkbox.d.ts +36 -0
- package/dist/components/Form/Checkbox.d.ts.map +1 -0
- package/dist/components/Form/Checkbox.js +39 -0
- package/dist/components/Form/Fieldset.d.ts +33 -0
- package/dist/components/Form/Fieldset.d.ts.map +1 -0
- package/dist/components/Form/Fieldset.js +34 -0
- package/dist/components/Form/Input.d.ts +37 -0
- package/dist/components/Form/Input.d.ts.map +1 -0
- package/dist/components/Form/Input.js +41 -0
- package/dist/components/Form/Label.d.ts +30 -0
- package/dist/components/Form/Label.d.ts.map +1 -0
- package/dist/components/Form/Label.js +30 -0
- package/dist/components/Form/Radio.d.ts +53 -0
- package/dist/components/Form/Radio.d.ts.map +1 -0
- package/dist/components/Form/Radio.js +39 -0
- package/dist/components/Form/Select.d.ts +51 -0
- package/dist/components/Form/Select.d.ts.map +1 -0
- package/dist/components/Form/Select.js +49 -0
- package/dist/components/Form/Textarea.d.ts +44 -0
- package/dist/components/Form/Textarea.d.ts.map +1 -0
- package/dist/components/Form/Textarea.js +43 -0
- package/dist/components/Form/index.d.ts +8 -0
- package/dist/components/Form/index.d.ts.map +1 -0
- package/dist/components/Form/index.js +7 -0
- package/dist/components/Link/Link.d.ts +34 -0
- package/dist/components/Link/Link.d.ts.map +1 -0
- package/dist/components/Link/Link.js +48 -0
- package/dist/components/Link/index.d.ts +3 -0
- package/dist/components/Link/index.d.ts.map +1 -0
- package/dist/components/Link/index.js +1 -0
- package/dist/components/Modal/Modal.d.ts +64 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/Modal.js +108 -0
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/components/Modal/index.d.ts.map +1 -0
- package/dist/components/Modal/index.js +1 -0
- package/dist/components/Tabs/Tabs.d.ts +63 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +134 -0
- package/dist/components/Tabs/index.d.ts +3 -0
- package/dist/components/Tabs/index.d.ts.map +1 -0
- package/dist/components/Tabs/index.js +1 -0
- package/dist/components/Toast/Toast.d.ts +59 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +91 -0
- package/dist/components/Toast/ToastProvider.d.ts +22 -0
- package/dist/components/Toast/ToastProvider.d.ts.map +1 -0
- package/dist/components/Toast/ToastProvider.js +33 -0
- package/dist/components/Toast/index.d.ts +5 -0
- package/dist/components/Toast/index.d.ts.map +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/hooks/useAriaLive.d.ts +9 -0
- package/dist/hooks/useAriaLive.d.ts.map +1 -0
- package/dist/hooks/useAriaLive.js +39 -0
- package/dist/hooks/useFocusReturn.d.ts +9 -0
- package/dist/hooks/useFocusReturn.d.ts.map +1 -0
- package/dist/hooks/useFocusReturn.js +33 -0
- package/dist/hooks/useFocusTrap.d.ts +9 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/hooks/useFocusTrap.js +68 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/{packages/design-system/src/index.ts → dist/index.js} +0 -4
- package/dist/styles/index.d.ts +3 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +1 -0
- package/dist/tokens/breakpoints.d.ts +25 -0
- package/dist/tokens/breakpoints.d.ts.map +1 -0
- package/dist/tokens/breakpoints.js +23 -0
- package/dist/tokens/colors.d.ts +81 -0
- package/dist/tokens/colors.d.ts.map +1 -0
- package/dist/tokens/colors.js +86 -0
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +5 -0
- package/dist/tokens/motion.d.ts +30 -0
- package/dist/tokens/motion.d.ts.map +1 -0
- package/dist/tokens/motion.js +34 -0
- package/dist/tokens/spacing.d.ts +22 -0
- package/dist/tokens/spacing.d.ts.map +1 -0
- package/dist/tokens/spacing.js +20 -0
- package/dist/tokens/theme.d.ts +159 -0
- package/dist/tokens/theme.d.ts.map +1 -0
- package/dist/tokens/theme.js +15 -0
- package/dist/tokens/typography.d.ts +45 -0
- package/dist/tokens/typography.d.ts.map +1 -0
- package/dist/tokens/typography.js +56 -0
- package/dist/utils/aria.d.ts +60 -0
- package/dist/utils/aria.d.ts.map +1 -0
- package/dist/utils/aria.js +86 -0
- package/dist/utils/focus.d.ts +30 -0
- package/dist/utils/focus.d.ts.map +1 -0
- package/dist/utils/focus.js +80 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/keyboard.d.ts +38 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/keyboard.js +59 -0
- package/package.json +58 -31
- package/.storybook/custom.css +0 -69
- package/.storybook/main.ts +0 -46
- package/.storybook/manager.ts +0 -26
- package/.storybook/package.json +0 -6
- package/.storybook/preview.tsx +0 -31
- package/.storybook/public/logo.png +0 -0
- package/.storybook/vite.config.ts +0 -24
- package/.storybook/welcome.mdx +0 -97
- package/DEPLOYMENT.md +0 -154
- package/apps/web/app/(docs)/audit/audit.css +0 -269
- package/apps/web/app/(docs)/audit/page.tsx +0 -271
- package/apps/web/app/(docs)/components/button/page.tsx +0 -49
- package/apps/web/app/(docs)/components/form/page.tsx +0 -92
- package/apps/web/app/(docs)/components/link/page.tsx +0 -31
- package/apps/web/app/(docs)/components/modal/page.tsx +0 -41
- package/apps/web/app/(docs)/components/page.tsx +0 -37
- package/apps/web/app/(docs)/components/table/page.tsx +0 -54
- package/apps/web/app/(docs)/components/tabs/page.tsx +0 -61
- package/apps/web/app/(docs)/components/toast/page.tsx +0 -51
- package/apps/web/app/api/audit/route.ts +0 -128
- package/apps/web/app/favicon.ico +0 -0
- package/apps/web/app/layout.tsx +0 -20
- package/apps/web/app/page.tsx +0 -17
- package/apps/web/app/styles/globals.css +0 -5
- package/apps/web/next-env.d.ts +0 -5
- package/apps/web/next.config.js +0 -21
- package/apps/web/package.json +0 -28
- package/apps/web/public/_headers +0 -17
- package/apps/web/public/_redirects +0 -31
- package/apps/web/public/logo.png +0 -0
- package/apps/web/tsconfig.json +0 -29
- package/netlify/functions/audit.ts +0 -163
- package/netlify.toml +0 -37
- package/packages/design-system/README.md +0 -252
- package/packages/design-system/package.json +0 -68
- package/packages/design-system/scripts/copy-css.js +0 -63
- package/packages/design-system/src/components/Button/Button.stories.tsx +0 -228
- package/packages/design-system/src/components/Button/Button.tsx +0 -137
- package/packages/design-system/src/components/Button/index.ts +0 -3
- package/packages/design-system/src/components/DataTable/DataTable.stories.tsx +0 -211
- package/packages/design-system/src/components/DataTable/DataTable.tsx +0 -293
- package/packages/design-system/src/components/DataTable/index.ts +0 -3
- package/packages/design-system/src/components/Form/Checkbox.stories.tsx +0 -252
- package/packages/design-system/src/components/Form/Checkbox.tsx +0 -114
- package/packages/design-system/src/components/Form/Fieldset.stories.tsx +0 -210
- package/packages/design-system/src/components/Form/Fieldset.tsx +0 -71
- package/packages/design-system/src/components/Form/Input.stories.tsx +0 -164
- package/packages/design-system/src/components/Form/Input.tsx +0 -113
- package/packages/design-system/src/components/Form/Label.tsx +0 -56
- package/packages/design-system/src/components/Form/Radio.stories.tsx +0 -265
- package/packages/design-system/src/components/Form/Radio.tsx +0 -147
- package/packages/design-system/src/components/Form/Select.stories.tsx +0 -295
- package/packages/design-system/src/components/Form/Select.tsx +0 -160
- package/packages/design-system/src/components/Form/Textarea.stories.tsx +0 -253
- package/packages/design-system/src/components/Form/Textarea.tsx +0 -145
- package/packages/design-system/src/components/Form/index.ts +0 -8
- package/packages/design-system/src/components/Link/Link.stories.tsx +0 -128
- package/packages/design-system/src/components/Link/Link.tsx +0 -117
- package/packages/design-system/src/components/Link/index.ts +0 -3
- package/packages/design-system/src/components/Modal/Modal.stories.tsx +0 -165
- package/packages/design-system/src/components/Modal/Modal.tsx +0 -202
- package/packages/design-system/src/components/Modal/index.ts +0 -3
- package/packages/design-system/src/components/Tabs/Tabs.stories.tsx +0 -213
- package/packages/design-system/src/components/Tabs/Tabs.tsx +0 -248
- package/packages/design-system/src/components/Tabs/index.ts +0 -3
- package/packages/design-system/src/components/Toast/Toast.stories.tsx +0 -153
- package/packages/design-system/src/components/Toast/Toast.tsx +0 -175
- package/packages/design-system/src/components/Toast/ToastProvider.tsx +0 -73
- package/packages/design-system/src/components/Toast/index.ts +0 -5
- package/packages/design-system/src/hooks/useAriaLive.ts +0 -51
- package/packages/design-system/src/hooks/useFocusReturn.ts +0 -40
- package/packages/design-system/src/hooks/useFocusTrap.ts +0 -82
- package/packages/design-system/src/styles/index.ts +0 -3
- package/packages/design-system/src/tokens/breakpoints.ts +0 -28
- package/packages/design-system/src/tokens/colors.ts +0 -98
- package/packages/design-system/src/tokens/index.ts +0 -6
- package/packages/design-system/src/tokens/motion.ts +0 -41
- package/packages/design-system/src/tokens/spacing.ts +0 -24
- package/packages/design-system/src/tokens/theme.ts +0 -19
- package/packages/design-system/src/tokens/typography.ts +0 -64
- package/packages/design-system/src/utils/aria.ts +0 -108
- package/packages/design-system/src/utils/focus.ts +0 -87
- package/packages/design-system/src/utils/index.ts +0 -4
- package/packages/design-system/src/utils/keyboard.ts +0 -77
- package/packages/design-system/tsconfig.json +0 -17
- package/public/logo.png +0 -0
- package/scripts/fix-storybook-paths.js +0 -53
- package/tsconfig.json +0 -20
- /package/{packages/design-system/src → dist}/components/Button/Button.css +0 -0
- /package/{packages/design-system/src → dist}/components/DataTable/DataTable.css +0 -0
- /package/{packages/design-system/src → dist}/components/Form/Checkbox.css +0 -0
- /package/{packages/design-system/src → dist}/components/Form/Fieldset.css +0 -0
- /package/{packages/design-system/src → dist}/components/Form/Input.css +0 -0
- /package/{packages/design-system/src → dist}/components/Form/Label.css +0 -0
- /package/{packages/design-system/src → dist}/components/Form/Radio.css +0 -0
- /package/{packages/design-system/src → dist}/components/Form/Select.css +0 -0
- /package/{packages/design-system/src → dist}/components/Form/Textarea.css +0 -0
- /package/{packages/design-system/src → dist}/components/Link/Link.css +0 -0
- /package/{packages/design-system/src → dist}/components/Modal/Modal.css +0 -0
- /package/{packages/design-system/src → dist}/components/Tabs/Tabs.css +0 -0
- /package/{packages/design-system/src → dist}/components/Toast/Toast.css +0 -0
- /package/{packages/design-system/src → dist}/components/Toast/ToastProvider.css +0 -0
- /package/{packages/design-system/src → dist}/styles/components.css +0 -0
- /package/{packages/design-system/src → dist}/styles/global.css +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color tokens with WCAG AA contrast ratios (4.5:1 for normal text, 3:1 for large text)
|
|
3
|
+
* All colors meet WCAG 2.1 Level AA standards
|
|
4
|
+
*/
|
|
5
|
+
export const colors = {
|
|
6
|
+
// Primary palette
|
|
7
|
+
primary: {
|
|
8
|
+
50: '#f0f9ff',
|
|
9
|
+
100: '#e0f2fe',
|
|
10
|
+
200: '#bae6fd',
|
|
11
|
+
300: '#7dd3fc',
|
|
12
|
+
400: '#38bdf8',
|
|
13
|
+
500: '#0ea5e9', // Main primary - meets 4.5:1 on white
|
|
14
|
+
600: '#0284c7',
|
|
15
|
+
700: '#0369a1',
|
|
16
|
+
800: '#075985',
|
|
17
|
+
900: '#0c4a6e',
|
|
18
|
+
},
|
|
19
|
+
// Neutral grays
|
|
20
|
+
neutral: {
|
|
21
|
+
50: '#fafafa',
|
|
22
|
+
100: '#f5f5f5',
|
|
23
|
+
200: '#bbbbbb',
|
|
24
|
+
300: '#d4d4d4',
|
|
25
|
+
400: '#a3a3a3',
|
|
26
|
+
500: '#737373',
|
|
27
|
+
600: '#525252', // Meets 4.5:1 on white
|
|
28
|
+
700: '#404040', // Meets 4.5:1 on white
|
|
29
|
+
800: '#262626', // Meets 4.5:1 on white
|
|
30
|
+
900: '#171717', // Meets 4.5:1 on white
|
|
31
|
+
},
|
|
32
|
+
// Semantic colors
|
|
33
|
+
success: {
|
|
34
|
+
50: '#f0fdf4',
|
|
35
|
+
100: '#dcfce7',
|
|
36
|
+
200: '#bbf7d0',
|
|
37
|
+
300: '#86efac',
|
|
38
|
+
400: '#4ade80',
|
|
39
|
+
500: '#22c55e', // Meets 4.5:1 on white
|
|
40
|
+
600: '#16a34a',
|
|
41
|
+
700: '#15803d',
|
|
42
|
+
},
|
|
43
|
+
warning: {
|
|
44
|
+
50: '#fffbeb',
|
|
45
|
+
100: '#fef3c7',
|
|
46
|
+
200: '#fde68a',
|
|
47
|
+
300: '#fcd34d',
|
|
48
|
+
400: '#fbbf24',
|
|
49
|
+
500: '#f59e0b', // Meets 4.5:1 on white
|
|
50
|
+
600: '#d97706',
|
|
51
|
+
700: '#b45309',
|
|
52
|
+
},
|
|
53
|
+
error: {
|
|
54
|
+
50: '#fef2f2',
|
|
55
|
+
100: '#fee2e2',
|
|
56
|
+
200: '#fecaca',
|
|
57
|
+
300: '#fca5a5',
|
|
58
|
+
400: '#f87171',
|
|
59
|
+
500: '#ef4444', // Meets 4.5:1 on white
|
|
60
|
+
600: '#dc2626', // Meets 4.5:1 on white
|
|
61
|
+
700: '#b91c1c',
|
|
62
|
+
},
|
|
63
|
+
// Base colors
|
|
64
|
+
white: '#ffffff',
|
|
65
|
+
black: '#000000',
|
|
66
|
+
// Background colors
|
|
67
|
+
background: {
|
|
68
|
+
default: '#ffffff',
|
|
69
|
+
secondary: '#fafafa',
|
|
70
|
+
tertiary: '#f5f5f5',
|
|
71
|
+
},
|
|
72
|
+
// Text colors (meet contrast requirements)
|
|
73
|
+
text: {
|
|
74
|
+
primary: '#171717', // neutral.900 - 4.5:1 on white
|
|
75
|
+
secondary: '#525252', // neutral.600 - 4.5:1 on white
|
|
76
|
+
tertiary: '#737373', // neutral.500 - 4.5:1 on white (large text)
|
|
77
|
+
inverse: '#ffffff', // white - 4.5:1 on dark backgrounds
|
|
78
|
+
disabled: '#a3a3a3', // neutral.400
|
|
79
|
+
},
|
|
80
|
+
// Border colors
|
|
81
|
+
border: {
|
|
82
|
+
default: '#bbbbbb', // neutral.200
|
|
83
|
+
focus: '#0ea5e9', // primary.500
|
|
84
|
+
error: '#ef4444', // error.500
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tokens/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion tokens that respect prefers-reduced-motion
|
|
3
|
+
* All animations should check for reduced motion preference
|
|
4
|
+
*/
|
|
5
|
+
export declare const motion: {
|
|
6
|
+
readonly duration: {
|
|
7
|
+
readonly fast: "150ms";
|
|
8
|
+
readonly normal: "200ms";
|
|
9
|
+
readonly slow: "300ms";
|
|
10
|
+
readonly slower: "400ms";
|
|
11
|
+
};
|
|
12
|
+
readonly easing: {
|
|
13
|
+
readonly easeIn: "cubic-bezier(0.4, 0, 1, 1)";
|
|
14
|
+
readonly easeOut: "cubic-bezier(0, 0, 0.2, 1)";
|
|
15
|
+
readonly easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
16
|
+
readonly linear: "linear";
|
|
17
|
+
};
|
|
18
|
+
readonly reduced: {
|
|
19
|
+
readonly duration: "0ms";
|
|
20
|
+
readonly easing: "linear";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type MotionToken = typeof motion;
|
|
24
|
+
/**
|
|
25
|
+
* Helper to get motion duration respecting prefers-reduced-motion
|
|
26
|
+
* Usage: const duration = getMotionDuration('normal')
|
|
27
|
+
* In CSS: use @media (prefers-reduced-motion: reduce) { animation-duration: 0ms; }
|
|
28
|
+
*/
|
|
29
|
+
export declare function getMotionDuration(key: keyof typeof motion.duration): string;
|
|
30
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/tokens/motion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;CAoBT,CAAA;AAEV,MAAM,MAAM,WAAW,GAAG,OAAO,MAAM,CAAA;AAEvC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,OAAO,MAAM,CAAC,QAAQ,GAAG,MAAM,CAK3E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Motion tokens that respect prefers-reduced-motion
|
|
3
|
+
* All animations should check for reduced motion preference
|
|
4
|
+
*/
|
|
5
|
+
export const motion = {
|
|
6
|
+
duration: {
|
|
7
|
+
fast: '150ms',
|
|
8
|
+
normal: '200ms',
|
|
9
|
+
slow: '300ms',
|
|
10
|
+
slower: '400ms',
|
|
11
|
+
},
|
|
12
|
+
easing: {
|
|
13
|
+
easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
|
|
14
|
+
easeOut: 'cubic-bezier(0, 0, 0.2, 1)',
|
|
15
|
+
easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
|
16
|
+
linear: 'linear',
|
|
17
|
+
},
|
|
18
|
+
// Reduced motion overrides (set to 0 or instant)
|
|
19
|
+
reduced: {
|
|
20
|
+
duration: '0ms',
|
|
21
|
+
easing: 'linear',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Helper to get motion duration respecting prefers-reduced-motion
|
|
26
|
+
* Usage: const duration = getMotionDuration('normal')
|
|
27
|
+
* In CSS: use @media (prefers-reduced-motion: reduce) { animation-duration: 0ms; }
|
|
28
|
+
*/
|
|
29
|
+
export function getMotionDuration(key) {
|
|
30
|
+
if (typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
|
31
|
+
return motion.reduced.duration;
|
|
32
|
+
}
|
|
33
|
+
return motion.duration[key];
|
|
34
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spacing scale using 4px base unit
|
|
3
|
+
* Follows consistent 8px grid system
|
|
4
|
+
*/
|
|
5
|
+
export declare const spacing: {
|
|
6
|
+
readonly 0: "0";
|
|
7
|
+
readonly 1: "0.25rem";
|
|
8
|
+
readonly 2: "0.5rem";
|
|
9
|
+
readonly 3: "0.75rem";
|
|
10
|
+
readonly 4: "1rem";
|
|
11
|
+
readonly 5: "1.25rem";
|
|
12
|
+
readonly 6: "1.5rem";
|
|
13
|
+
readonly 8: "2rem";
|
|
14
|
+
readonly 10: "2.5rem";
|
|
15
|
+
readonly 12: "3rem";
|
|
16
|
+
readonly 16: "4rem";
|
|
17
|
+
readonly 20: "5rem";
|
|
18
|
+
readonly 24: "6rem";
|
|
19
|
+
readonly 32: "8rem";
|
|
20
|
+
};
|
|
21
|
+
export type SpacingToken = typeof spacing;
|
|
22
|
+
//# sourceMappingURL=spacing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spacing.d.ts","sourceRoot":"","sources":["../../src/tokens/spacing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;CAeV,CAAA;AAEV,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spacing scale using 4px base unit
|
|
3
|
+
* Follows consistent 8px grid system
|
|
4
|
+
*/
|
|
5
|
+
export const spacing = {
|
|
6
|
+
0: '0',
|
|
7
|
+
1: '0.25rem', // 4px
|
|
8
|
+
2: '0.5rem', // 8px
|
|
9
|
+
3: '0.75rem', // 12px
|
|
10
|
+
4: '1rem', // 16px
|
|
11
|
+
5: '1.25rem', // 20px
|
|
12
|
+
6: '1.5rem', // 24px
|
|
13
|
+
8: '2rem', // 32px
|
|
14
|
+
10: '2.5rem', // 40px
|
|
15
|
+
12: '3rem', // 48px
|
|
16
|
+
16: '4rem', // 64px
|
|
17
|
+
20: '5rem', // 80px
|
|
18
|
+
24: '6rem', // 96px
|
|
19
|
+
32: '8rem', // 128px
|
|
20
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export declare const theme: {
|
|
2
|
+
readonly colors: {
|
|
3
|
+
readonly primary: {
|
|
4
|
+
readonly 50: "#f0f9ff";
|
|
5
|
+
readonly 100: "#e0f2fe";
|
|
6
|
+
readonly 200: "#bae6fd";
|
|
7
|
+
readonly 300: "#7dd3fc";
|
|
8
|
+
readonly 400: "#38bdf8";
|
|
9
|
+
readonly 500: "#0ea5e9";
|
|
10
|
+
readonly 600: "#0284c7";
|
|
11
|
+
readonly 700: "#0369a1";
|
|
12
|
+
readonly 800: "#075985";
|
|
13
|
+
readonly 900: "#0c4a6e";
|
|
14
|
+
};
|
|
15
|
+
readonly neutral: {
|
|
16
|
+
readonly 50: "#fafafa";
|
|
17
|
+
readonly 100: "#f5f5f5";
|
|
18
|
+
readonly 200: "#bbbbbb";
|
|
19
|
+
readonly 300: "#d4d4d4";
|
|
20
|
+
readonly 400: "#a3a3a3";
|
|
21
|
+
readonly 500: "#737373";
|
|
22
|
+
readonly 600: "#525252";
|
|
23
|
+
readonly 700: "#404040";
|
|
24
|
+
readonly 800: "#262626";
|
|
25
|
+
readonly 900: "#171717";
|
|
26
|
+
};
|
|
27
|
+
readonly success: {
|
|
28
|
+
readonly 50: "#f0fdf4";
|
|
29
|
+
readonly 100: "#dcfce7";
|
|
30
|
+
readonly 200: "#bbf7d0";
|
|
31
|
+
readonly 300: "#86efac";
|
|
32
|
+
readonly 400: "#4ade80";
|
|
33
|
+
readonly 500: "#22c55e";
|
|
34
|
+
readonly 600: "#16a34a";
|
|
35
|
+
readonly 700: "#15803d";
|
|
36
|
+
};
|
|
37
|
+
readonly warning: {
|
|
38
|
+
readonly 50: "#fffbeb";
|
|
39
|
+
readonly 100: "#fef3c7";
|
|
40
|
+
readonly 200: "#fde68a";
|
|
41
|
+
readonly 300: "#fcd34d";
|
|
42
|
+
readonly 400: "#fbbf24";
|
|
43
|
+
readonly 500: "#f59e0b";
|
|
44
|
+
readonly 600: "#d97706";
|
|
45
|
+
readonly 700: "#b45309";
|
|
46
|
+
};
|
|
47
|
+
readonly error: {
|
|
48
|
+
readonly 50: "#fef2f2";
|
|
49
|
+
readonly 100: "#fee2e2";
|
|
50
|
+
readonly 200: "#fecaca";
|
|
51
|
+
readonly 300: "#fca5a5";
|
|
52
|
+
readonly 400: "#f87171";
|
|
53
|
+
readonly 500: "#ef4444";
|
|
54
|
+
readonly 600: "#dc2626";
|
|
55
|
+
readonly 700: "#b91c1c";
|
|
56
|
+
};
|
|
57
|
+
readonly white: "#ffffff";
|
|
58
|
+
readonly black: "#000000";
|
|
59
|
+
readonly background: {
|
|
60
|
+
readonly default: "#ffffff";
|
|
61
|
+
readonly secondary: "#fafafa";
|
|
62
|
+
readonly tertiary: "#f5f5f5";
|
|
63
|
+
};
|
|
64
|
+
readonly text: {
|
|
65
|
+
readonly primary: "#171717";
|
|
66
|
+
readonly secondary: "#525252";
|
|
67
|
+
readonly tertiary: "#737373";
|
|
68
|
+
readonly inverse: "#ffffff";
|
|
69
|
+
readonly disabled: "#a3a3a3";
|
|
70
|
+
};
|
|
71
|
+
readonly border: {
|
|
72
|
+
readonly default: "#bbbbbb";
|
|
73
|
+
readonly focus: "#0ea5e9";
|
|
74
|
+
readonly error: "#ef4444";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
readonly spacing: {
|
|
78
|
+
readonly 0: "0";
|
|
79
|
+
readonly 1: "0.25rem";
|
|
80
|
+
readonly 2: "0.5rem";
|
|
81
|
+
readonly 3: "0.75rem";
|
|
82
|
+
readonly 4: "1rem";
|
|
83
|
+
readonly 5: "1.25rem";
|
|
84
|
+
readonly 6: "1.5rem";
|
|
85
|
+
readonly 8: "2rem";
|
|
86
|
+
readonly 10: "2.5rem";
|
|
87
|
+
readonly 12: "3rem";
|
|
88
|
+
readonly 16: "4rem";
|
|
89
|
+
readonly 20: "5rem";
|
|
90
|
+
readonly 24: "6rem";
|
|
91
|
+
readonly 32: "8rem";
|
|
92
|
+
};
|
|
93
|
+
readonly typography: {
|
|
94
|
+
readonly fontFamily: {
|
|
95
|
+
readonly sans: string;
|
|
96
|
+
readonly mono: string;
|
|
97
|
+
};
|
|
98
|
+
readonly fontSize: {
|
|
99
|
+
readonly xs: "0.75rem";
|
|
100
|
+
readonly sm: "0.875rem";
|
|
101
|
+
readonly base: "1rem";
|
|
102
|
+
readonly lg: "1.125rem";
|
|
103
|
+
readonly xl: "1.25rem";
|
|
104
|
+
readonly '2xl': "1.5rem";
|
|
105
|
+
readonly '3xl': "1.875rem";
|
|
106
|
+
readonly '4xl': "2.25rem";
|
|
107
|
+
readonly '5xl': "3rem";
|
|
108
|
+
};
|
|
109
|
+
readonly lineHeight: {
|
|
110
|
+
readonly none: "1";
|
|
111
|
+
readonly tight: "1.25";
|
|
112
|
+
readonly snug: "1.375";
|
|
113
|
+
readonly normal: "1.5";
|
|
114
|
+
readonly relaxed: "1.625";
|
|
115
|
+
readonly loose: "2";
|
|
116
|
+
};
|
|
117
|
+
readonly fontWeight: {
|
|
118
|
+
readonly normal: "400";
|
|
119
|
+
readonly medium: "500";
|
|
120
|
+
readonly semibold: "600";
|
|
121
|
+
readonly bold: "700";
|
|
122
|
+
};
|
|
123
|
+
readonly letterSpacing: {
|
|
124
|
+
readonly tighter: "-0.05em";
|
|
125
|
+
readonly tight: "-0.025em";
|
|
126
|
+
readonly normal: "0";
|
|
127
|
+
readonly wide: "0.025em";
|
|
128
|
+
readonly wider: "0.05em";
|
|
129
|
+
readonly widest: "0.1em";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
readonly motion: {
|
|
133
|
+
readonly duration: {
|
|
134
|
+
readonly fast: "150ms";
|
|
135
|
+
readonly normal: "200ms";
|
|
136
|
+
readonly slow: "300ms";
|
|
137
|
+
readonly slower: "400ms";
|
|
138
|
+
};
|
|
139
|
+
readonly easing: {
|
|
140
|
+
readonly easeIn: "cubic-bezier(0.4, 0, 1, 1)";
|
|
141
|
+
readonly easeOut: "cubic-bezier(0, 0, 0.2, 1)";
|
|
142
|
+
readonly easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
143
|
+
readonly linear: "linear";
|
|
144
|
+
};
|
|
145
|
+
readonly reduced: {
|
|
146
|
+
readonly duration: "0ms";
|
|
147
|
+
readonly easing: "linear";
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
readonly breakpoints: {
|
|
151
|
+
readonly sm: "640px";
|
|
152
|
+
readonly md: "768px";
|
|
153
|
+
readonly lg: "1024px";
|
|
154
|
+
readonly xl: "1280px";
|
|
155
|
+
readonly '2xl': "1536px";
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
export type Theme = typeof theme;
|
|
159
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/tokens/theme.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMR,CAAA;AAEV,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central theme export combining all design tokens
|
|
3
|
+
*/
|
|
4
|
+
import { colors } from './colors';
|
|
5
|
+
import { spacing } from './spacing';
|
|
6
|
+
import { typography } from './typography';
|
|
7
|
+
import { motion } from './motion';
|
|
8
|
+
import { breakpoints } from './breakpoints';
|
|
9
|
+
export const theme = {
|
|
10
|
+
colors,
|
|
11
|
+
spacing,
|
|
12
|
+
typography,
|
|
13
|
+
motion,
|
|
14
|
+
breakpoints,
|
|
15
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography scale with accessible line heights and font sizes
|
|
3
|
+
* Line heights ensure readability (minimum 1.5 for body text)
|
|
4
|
+
*/
|
|
5
|
+
export declare const typography: {
|
|
6
|
+
readonly fontFamily: {
|
|
7
|
+
readonly sans: string;
|
|
8
|
+
readonly mono: string;
|
|
9
|
+
};
|
|
10
|
+
readonly fontSize: {
|
|
11
|
+
readonly xs: "0.75rem";
|
|
12
|
+
readonly sm: "0.875rem";
|
|
13
|
+
readonly base: "1rem";
|
|
14
|
+
readonly lg: "1.125rem";
|
|
15
|
+
readonly xl: "1.25rem";
|
|
16
|
+
readonly '2xl': "1.5rem";
|
|
17
|
+
readonly '3xl': "1.875rem";
|
|
18
|
+
readonly '4xl': "2.25rem";
|
|
19
|
+
readonly '5xl': "3rem";
|
|
20
|
+
};
|
|
21
|
+
readonly lineHeight: {
|
|
22
|
+
readonly none: "1";
|
|
23
|
+
readonly tight: "1.25";
|
|
24
|
+
readonly snug: "1.375";
|
|
25
|
+
readonly normal: "1.5";
|
|
26
|
+
readonly relaxed: "1.625";
|
|
27
|
+
readonly loose: "2";
|
|
28
|
+
};
|
|
29
|
+
readonly fontWeight: {
|
|
30
|
+
readonly normal: "400";
|
|
31
|
+
readonly medium: "500";
|
|
32
|
+
readonly semibold: "600";
|
|
33
|
+
readonly bold: "700";
|
|
34
|
+
};
|
|
35
|
+
readonly letterSpacing: {
|
|
36
|
+
readonly tighter: "-0.05em";
|
|
37
|
+
readonly tight: "-0.025em";
|
|
38
|
+
readonly normal: "0";
|
|
39
|
+
readonly wide: "0.025em";
|
|
40
|
+
readonly wider: "0.05em";
|
|
41
|
+
readonly widest: "0.1em";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type TypographyToken = typeof typography;
|
|
45
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/tokens/typography.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDb,CAAA;AAEV,MAAM,MAAM,eAAe,GAAG,OAAO,UAAU,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography scale with accessible line heights and font sizes
|
|
3
|
+
* Line heights ensure readability (minimum 1.5 for body text)
|
|
4
|
+
*/
|
|
5
|
+
export const typography = {
|
|
6
|
+
fontFamily: {
|
|
7
|
+
sans: [
|
|
8
|
+
'-apple-system',
|
|
9
|
+
'BlinkMacSystemFont',
|
|
10
|
+
'"Segoe UI"',
|
|
11
|
+
'Roboto',
|
|
12
|
+
'"Helvetica Neue"',
|
|
13
|
+
'Arial',
|
|
14
|
+
'sans-serif',
|
|
15
|
+
].join(', '),
|
|
16
|
+
mono: [
|
|
17
|
+
'Menlo',
|
|
18
|
+
'Monaco',
|
|
19
|
+
'"Courier New"',
|
|
20
|
+
'monospace',
|
|
21
|
+
].join(', '),
|
|
22
|
+
},
|
|
23
|
+
fontSize: {
|
|
24
|
+
xs: '0.75rem', // 12px
|
|
25
|
+
sm: '0.875rem', // 14px
|
|
26
|
+
base: '1rem', // 16px
|
|
27
|
+
lg: '1.125rem', // 18px
|
|
28
|
+
xl: '1.25rem', // 20px
|
|
29
|
+
'2xl': '1.5rem', // 24px
|
|
30
|
+
'3xl': '1.875rem', // 30px
|
|
31
|
+
'4xl': '2.25rem', // 36px
|
|
32
|
+
'5xl': '3rem', // 48px
|
|
33
|
+
},
|
|
34
|
+
lineHeight: {
|
|
35
|
+
none: '1',
|
|
36
|
+
tight: '1.25',
|
|
37
|
+
snug: '1.375',
|
|
38
|
+
normal: '1.5', // Minimum for accessibility
|
|
39
|
+
relaxed: '1.625',
|
|
40
|
+
loose: '2',
|
|
41
|
+
},
|
|
42
|
+
fontWeight: {
|
|
43
|
+
normal: '400',
|
|
44
|
+
medium: '500',
|
|
45
|
+
semibold: '600',
|
|
46
|
+
bold: '700',
|
|
47
|
+
},
|
|
48
|
+
letterSpacing: {
|
|
49
|
+
tighter: '-0.05em',
|
|
50
|
+
tight: '-0.025em',
|
|
51
|
+
normal: '0',
|
|
52
|
+
wide: '0.025em',
|
|
53
|
+
wider: '0.05em',
|
|
54
|
+
widest: '0.1em',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ARIA utility functions
|
|
3
|
+
* Helpers for managing ARIA attributes and roles
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateId(prefix?: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Get ARIA label from props, preferring aria-label over aria-labelledby
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAriaLabel(ariaLabel?: string, ariaLabelledBy?: string): {
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
'aria-labelledby'?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Get ARIA describedby attributes
|
|
15
|
+
*/
|
|
16
|
+
export declare function getAriaDescribedBy(describedBy?: string): {
|
|
17
|
+
'aria-describedby'?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Combine multiple ARIA describedby IDs
|
|
21
|
+
*/
|
|
22
|
+
export declare function combineAriaDescribedBy(...ids: (string | undefined)[]): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Get live region attributes
|
|
25
|
+
*/
|
|
26
|
+
export declare function getLiveRegionAttributes(live?: 'polite' | 'assertive' | 'off'): {
|
|
27
|
+
'aria-live': 'polite' | 'assertive' | 'off';
|
|
28
|
+
'aria-atomic'?: boolean;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Get busy state attributes
|
|
32
|
+
*/
|
|
33
|
+
export declare function getBusyAttributes(busy: boolean): {
|
|
34
|
+
'aria-busy': boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Get expanded state attributes
|
|
38
|
+
*/
|
|
39
|
+
export declare function getExpandedAttributes(expanded: boolean | undefined): {
|
|
40
|
+
'aria-expanded'?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Get pressed state attributes (for toggle buttons)
|
|
44
|
+
*/
|
|
45
|
+
export declare function getPressedAttributes(pressed: boolean | undefined): {
|
|
46
|
+
'aria-pressed'?: boolean;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Get selected state attributes
|
|
50
|
+
*/
|
|
51
|
+
export declare function getSelectedAttributes(selected: boolean | undefined): {
|
|
52
|
+
'aria-selected'?: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Get current state attributes (for navigation)
|
|
56
|
+
*/
|
|
57
|
+
export declare function getCurrentAttributes(current: boolean | 'page' | 'step' | 'location' | 'date' | 'time' | undefined): {
|
|
58
|
+
'aria-current'?: boolean | 'page' | 'step' | 'location' | 'date' | 'time';
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=aria.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aria.d.ts","sourceRoot":"","sources":["../../src/utils/aria.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,wBAAgB,UAAU,CAAC,MAAM,SAAO,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,SAAS,CAAC,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,GACtB;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,CAQvD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,CAAC,EAAE,MAAM,GACnB;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,CAKjC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,GAAG,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,GAAG,SAAS,CAGzF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,GAAE,QAAQ,GAAG,WAAW,GAAG,KAAgB,GAC9C;IAAE,WAAW,EAAE,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAK1E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE,CAEzE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,GAAG,SAAS,GAC5B;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAG/B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAG9B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,GAAG,SAAS,GAC5B;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,CAG/B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAC5E;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;CAAE,CAG/E"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ARIA utility functions
|
|
3
|
+
* Helpers for managing ARIA attributes and roles
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Generate a unique ID for ARIA attributes
|
|
7
|
+
*/
|
|
8
|
+
let idCounter = 0;
|
|
9
|
+
export function generateId(prefix = 'id') {
|
|
10
|
+
return `${prefix}-${++idCounter}`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get ARIA label from props, preferring aria-label over aria-labelledby
|
|
14
|
+
*/
|
|
15
|
+
export function getAriaLabel(ariaLabel, ariaLabelledBy) {
|
|
16
|
+
if (ariaLabel) {
|
|
17
|
+
return { 'aria-label': ariaLabel };
|
|
18
|
+
}
|
|
19
|
+
if (ariaLabelledBy) {
|
|
20
|
+
return { 'aria-labelledby': ariaLabelledBy };
|
|
21
|
+
}
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get ARIA describedby attributes
|
|
26
|
+
*/
|
|
27
|
+
export function getAriaDescribedBy(describedBy) {
|
|
28
|
+
if (describedBy) {
|
|
29
|
+
return { 'aria-describedby': describedBy };
|
|
30
|
+
}
|
|
31
|
+
return {};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Combine multiple ARIA describedby IDs
|
|
35
|
+
*/
|
|
36
|
+
export function combineAriaDescribedBy(...ids) {
|
|
37
|
+
const validIds = ids.filter((id) => Boolean(id));
|
|
38
|
+
return validIds.length > 0 ? validIds.join(' ') : undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get live region attributes
|
|
42
|
+
*/
|
|
43
|
+
export function getLiveRegionAttributes(live = 'polite') {
|
|
44
|
+
return {
|
|
45
|
+
'aria-live': live,
|
|
46
|
+
'aria-atomic': live !== 'off',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get busy state attributes
|
|
51
|
+
*/
|
|
52
|
+
export function getBusyAttributes(busy) {
|
|
53
|
+
return { 'aria-busy': busy };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get expanded state attributes
|
|
57
|
+
*/
|
|
58
|
+
export function getExpandedAttributes(expanded) {
|
|
59
|
+
if (expanded === undefined)
|
|
60
|
+
return {};
|
|
61
|
+
return { 'aria-expanded': expanded };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get pressed state attributes (for toggle buttons)
|
|
65
|
+
*/
|
|
66
|
+
export function getPressedAttributes(pressed) {
|
|
67
|
+
if (pressed === undefined)
|
|
68
|
+
return {};
|
|
69
|
+
return { 'aria-pressed': pressed };
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get selected state attributes
|
|
73
|
+
*/
|
|
74
|
+
export function getSelectedAttributes(selected) {
|
|
75
|
+
if (selected === undefined)
|
|
76
|
+
return {};
|
|
77
|
+
return { 'aria-selected': selected };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get current state attributes (for navigation)
|
|
81
|
+
*/
|
|
82
|
+
export function getCurrentAttributes(current) {
|
|
83
|
+
if (current === undefined)
|
|
84
|
+
return {};
|
|
85
|
+
return { 'aria-current': current };
|
|
86
|
+
}
|