@dnanpm/ui-components 0.9.0 → 0.10.0
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 +13 -0
- package/dist/components/Accordion/Accordion.css +5 -1
- package/dist/components/AccordionItem/AccordionItem.cjs +4 -4
- package/dist/components/AccordionItem/AccordionItem.cjs.map +1 -1
- package/dist/components/AccordionItem/AccordionItem.css +4 -1
- package/dist/components/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/dist/components/AccordionItem/AccordionItem.js +2 -2
- package/dist/components/AccordionItem/AccordionItem.js.map +1 -1
- package/dist/components/Avatar/Avatar.cjs +83 -0
- package/dist/components/Avatar/Avatar.cjs.map +1 -0
- package/dist/components/Avatar/Avatar.css +188 -0
- package/dist/components/Avatar/Avatar.d.ts +3 -0
- package/dist/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.js +83 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/Avatar.module.css.cjs +40 -0
- package/dist/components/Avatar/Avatar.module.css.cjs.map +1 -0
- package/dist/components/Avatar/Avatar.module.css.js +40 -0
- package/dist/components/Avatar/Avatar.module.css.js.map +1 -0
- package/dist/components/Avatar/Avatar.types.d.ts +66 -0
- package/dist/components/Avatar/Avatar.types.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.utils.cjs +17 -0
- package/dist/components/Avatar/Avatar.utils.cjs.map +1 -0
- package/dist/components/Avatar/Avatar.utils.d.ts +6 -0
- package/dist/components/Avatar/Avatar.utils.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.utils.js +17 -0
- package/dist/components/Avatar/Avatar.utils.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/Avatar/index.d.ts.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.cjs +9 -12
- package/dist/components/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.css +16 -16
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +2 -5
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +5 -8
- package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.module.css.js +5 -8
- package/dist/components/Breadcrumb/Breadcrumb.module.css.js.map +1 -1
- package/dist/components/Button/Button.cjs +29 -3
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.css +78 -31
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +28 -2
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.module.css.cjs +19 -11
- package/dist/components/Button/Button.module.css.cjs.map +1 -1
- package/dist/components/Button/Button.module.css.js +19 -11
- package/dist/components/Button/Button.module.css.js.map +1 -1
- package/dist/components/Button/Button.types.d.ts +20 -3
- package/dist/components/Button/Button.types.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/ButtonCard/ButtonCard.cjs +19 -14
- package/dist/components/ButtonCard/ButtonCard.cjs.map +1 -1
- package/dist/components/ButtonCard/ButtonCard.css +63 -20
- package/dist/components/ButtonCard/ButtonCard.d.ts +2 -1
- package/dist/components/ButtonCard/ButtonCard.d.ts.map +1 -1
- package/dist/components/ButtonCard/ButtonCard.js +17 -12
- package/dist/components/ButtonCard/ButtonCard.js.map +1 -1
- package/dist/components/ButtonCard/ButtonCard.module.css.cjs +14 -12
- package/dist/components/ButtonCard/ButtonCard.module.css.cjs.map +1 -1
- package/dist/components/ButtonCard/ButtonCard.module.css.js +14 -12
- package/dist/components/ButtonCard/ButtonCard.module.css.js.map +1 -1
- package/dist/components/ButtonCard/ButtonCard.types.d.ts +3 -2
- package/dist/components/ButtonCard/ButtonCard.types.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.cjs +105 -0
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -0
- package/dist/components/Checkbox/Checkbox.css +323 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +105 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.module.css.cjs +35 -0
- package/dist/components/Checkbox/Checkbox.module.css.cjs.map +1 -0
- package/dist/components/Checkbox/Checkbox.module.css.js +35 -0
- package/dist/components/Checkbox/Checkbox.module.css.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +47 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts.map +1 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/ContentCard/ContentCard.cjs +8 -7
- package/dist/components/ContentCard/ContentCard.cjs.map +1 -1
- package/dist/components/ContentCard/ContentCard.css +39 -34
- package/dist/components/ContentCard/ContentCard.d.ts.map +1 -1
- package/dist/components/ContentCard/ContentCard.js +3 -2
- package/dist/components/ContentCard/ContentCard.js.map +1 -1
- package/dist/components/ContentCard/ContentCard.module.css.cjs +18 -18
- package/dist/components/ContentCard/ContentCard.module.css.js +18 -18
- package/dist/components/ContentCard/ContentCard.types.d.ts +2 -1
- package/dist/components/ContentCard/ContentCard.types.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.cjs +15 -7
- package/dist/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.css +48 -45
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +12 -4
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/Drawer.module.css.cjs +16 -16
- package/dist/components/Drawer/Drawer.module.css.js +16 -16
- package/dist/components/Footer/Footer.cjs +8 -9
- package/dist/components/Footer/Footer.cjs.map +1 -1
- package/dist/components/Footer/Footer.css +87 -83
- package/dist/components/Footer/Footer.d.ts.map +1 -1
- package/dist/components/Footer/Footer.js +1 -2
- package/dist/components/Footer/Footer.js.map +1 -1
- package/dist/components/Footer/Footer.module.css.cjs +39 -39
- package/dist/components/Footer/Footer.module.css.js +39 -39
- package/dist/components/FunctionButton/FunctionButton.cjs +2 -2
- package/dist/components/FunctionButton/FunctionButton.cjs.map +1 -1
- package/dist/components/FunctionButton/FunctionButton.css +5 -1
- package/dist/components/FunctionButton/FunctionButton.js +1 -1
- package/dist/components/FunctionButton/FunctionButton.js.map +1 -1
- package/dist/components/Hero/Hero.cjs +30 -27
- package/dist/components/Hero/Hero.cjs.map +1 -1
- package/dist/components/Hero/Hero.css +49 -44
- package/dist/components/Hero/Hero.d.ts +1 -1
- package/dist/components/Hero/Hero.d.ts.map +1 -1
- package/dist/components/Hero/Hero.js +30 -27
- package/dist/components/Hero/Hero.js.map +1 -1
- package/dist/components/Hero/Hero.module.css.cjs +18 -18
- package/dist/components/Hero/Hero.module.css.js +18 -18
- package/dist/components/Hero/Hero.types.d.ts +2 -6
- package/dist/components/Hero/Hero.types.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.cjs +3 -4
- package/dist/components/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/IconButton/IconButton.css +5 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +1 -2
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/Label/Label.css +5 -1
- package/dist/components/MainNavigation/MainNavigation.cjs +216 -162
- package/dist/components/MainNavigation/MainNavigation.cjs.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.css +206 -183
- package/dist/components/MainNavigation/MainNavigation.d.ts +1 -1
- package/dist/components/MainNavigation/MainNavigation.d.ts.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.js +177 -123
- package/dist/components/MainNavigation/MainNavigation.js.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.module.css.cjs +80 -78
- package/dist/components/MainNavigation/MainNavigation.module.css.cjs.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.module.css.js +80 -78
- package/dist/components/MainNavigation/MainNavigation.module.css.js.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.types.d.ts +0 -13
- package/dist/components/MainNavigation/MainNavigation.types.d.ts.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.utils.cjs +8 -4
- package/dist/components/MainNavigation/MainNavigation.utils.cjs.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.utils.d.ts +1 -0
- package/dist/components/MainNavigation/MainNavigation.utils.d.ts.map +1 -1
- package/dist/components/MainNavigation/MainNavigation.utils.js +8 -4
- package/dist/components/MainNavigation/MainNavigation.utils.js.map +1 -1
- package/dist/components/Modal/Modal.cjs +14 -6
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.css +44 -40
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +12 -4
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/Modal.module.css.cjs +18 -18
- package/dist/components/Modal/Modal.module.css.js +18 -18
- package/dist/components/Notification/Notification.cjs +3 -2
- package/dist/components/Notification/Notification.cjs.map +1 -1
- package/dist/components/Notification/Notification.css +16 -11
- package/dist/components/Notification/Notification.d.ts.map +1 -1
- package/dist/components/Notification/Notification.js +2 -1
- package/dist/components/Notification/Notification.js.map +1 -1
- package/dist/components/Notification/Notification.module.css.cjs +9 -9
- package/dist/components/Notification/Notification.module.css.js +9 -9
- package/dist/components/Pagination/Pagination.cjs +142 -0
- package/dist/components/Pagination/Pagination.cjs.map +1 -0
- package/dist/components/Pagination/Pagination.css +256 -0
- package/dist/components/Pagination/Pagination.d.ts +3 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.js +142 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/Pagination.module.css.cjs +34 -0
- package/dist/components/Pagination/Pagination.module.css.cjs.map +1 -0
- package/dist/components/Pagination/Pagination.module.css.js +34 -0
- package/dist/components/Pagination/Pagination.module.css.js.map +1 -0
- package/dist/components/Pagination/Pagination.types.d.ts +20 -0
- package/dist/components/Pagination/Pagination.types.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.utils.cjs +76 -0
- package/dist/components/Pagination/Pagination.utils.cjs.map +1 -0
- package/dist/components/Pagination/Pagination.utils.d.ts +21 -0
- package/dist/components/Pagination/Pagination.utils.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.utils.js +76 -0
- package/dist/components/Pagination/Pagination.utils.js.map +1 -0
- package/dist/components/Pagination/index.d.ts +3 -0
- package/dist/components/Pagination/index.d.ts.map +1 -0
- package/dist/components/Pictograph/Pictograph.css +5 -1
- package/dist/components/Pictograph/PictographItem.css +5 -1
- package/dist/components/Quote/Quote.css +5 -1
- package/dist/components/Spinner/Spinner.css +5 -1
- package/dist/design-tokens/dist/tokens.cjs +5 -0
- package/dist/design-tokens/dist/tokens.cjs.map +1 -0
- package/dist/design-tokens/dist/tokens.js +5 -0
- package/dist/design-tokens/dist/tokens.js.map +1 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/utilities.css +6 -0
- package/dist/styles/utils/elevation.css +35 -26
- package/dist/styles/utils/focus.css +63 -68
- package/dist/styles/utils/index.cjs +33 -0
- package/dist/styles/utils/index.cjs.map +1 -0
- package/dist/styles/utils/index.d.ts +20 -0
- package/dist/styles/utils/index.d.ts.map +1 -0
- package/dist/styles/utils/index.js +33 -0
- package/dist/styles/utils/index.js.map +1 -0
- package/dist/styles/utils/overlay.css +35 -27
- package/dist/styles/utils/text-decoration.css +20 -12
- package/dist/styles.css +27 -3
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/isRenderable/index.d.ts +2 -0
- package/dist/utils/isRenderable/index.d.ts.map +1 -0
- package/dist/utils/isRenderable/isRenderable.cjs +5 -0
- package/dist/utils/isRenderable/isRenderable.cjs.map +1 -0
- package/dist/utils/isRenderable/isRenderable.d.ts +4 -0
- package/dist/utils/isRenderable/isRenderable.d.ts.map +1 -0
- package/dist/utils/isRenderable/isRenderable.js +5 -0
- package/dist/utils/isRenderable/isRenderable.js.map +1 -0
- package/package.json +12 -4
- package/dist/styles/utils/elevation.module.css.cjs +0 -16
- package/dist/styles/utils/elevation.module.css.cjs.map +0 -1
- package/dist/styles/utils/elevation.module.css.js +0 -16
- package/dist/styles/utils/elevation.module.css.js.map +0 -1
- package/dist/styles/utils/focus.module.css.cjs +0 -16
- package/dist/styles/utils/focus.module.css.cjs.map +0 -1
- package/dist/styles/utils/focus.module.css.js +0 -16
- package/dist/styles/utils/focus.module.css.js.map +0 -1
- package/dist/styles/utils/overlay.module.css.cjs +0 -13
- package/dist/styles/utils/overlay.module.css.cjs.map +0 -1
- package/dist/styles/utils/overlay.module.css.js +0 -13
- package/dist/styles/utils/overlay.module.css.js.map +0 -1
- package/dist/styles/utils/text-decoration.module.css.cjs +0 -13
- package/dist/styles/utils/text-decoration.module.css.cjs.map +0 -1
- package/dist/styles/utils/text-decoration.module.css.js +0 -13
- package/dist/styles/utils/text-decoration.module.css.js.map +0 -1
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
@layer dds-base, dds-components;@layer dds-components { @layer fallback, components; }@layer dds-components.components{._checkbox_ndpjl_1 {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
4
|
+
column-gap: var(--spacing-space-8);
|
|
5
|
+
align-items: start;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
color: var(--color-semantic-foreground-default);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* === Control (box and icons stacked in one grid cell) === */
|
|
11
|
+
|
|
12
|
+
._checkbox__control_ndpjl_12 {
|
|
13
|
+
--_checkbox-box-size: 20px;
|
|
14
|
+
--_checkbox-icon-size: 16px;
|
|
15
|
+
--_checkbox-accent: var(--color-semantic-interactive-primary-default);
|
|
16
|
+
--_checkbox-border: var(--color-semantic-border-neutral-strong);
|
|
17
|
+
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-row: 1;
|
|
20
|
+
grid-column: 1;
|
|
21
|
+
place-items: center;
|
|
22
|
+
width: var(--_checkbox-box-size);
|
|
23
|
+
|
|
24
|
+
/* One label line is 24 px tall, so the box centres on the first line. */
|
|
25
|
+
height: var(--spacing-space-24);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
._checkbox__control_ndpjl_12 > * {
|
|
29
|
+
grid-area: 1 / 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Hover and focus look the same as default. Focus only adds the shared focus ring. */
|
|
33
|
+
/* Error also replaces the accent, so checked fills and indeterminate outlines turn red too. */
|
|
34
|
+
._checkbox--error_ndpjl_34 ._checkbox__control_ndpjl_12 {
|
|
35
|
+
--_checkbox-accent: var(--color-semantic-border-error);
|
|
36
|
+
--_checkbox-border: var(--color-semantic-border-error);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
._checkbox__input_ndpjl_39 {
|
|
40
|
+
width: var(--_checkbox-box-size);
|
|
41
|
+
height: var(--_checkbox-box-size);
|
|
42
|
+
margin: 0;
|
|
43
|
+
appearance: none;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
background-color: var(--color-semantic-surface-base);
|
|
46
|
+
|
|
47
|
+
/* Keeps semi-transparent disabled colours from stacking under the border. */
|
|
48
|
+
background-clip: padding-box;
|
|
49
|
+
border: var(--borderwidth-semantic-sm) solid var(--_checkbox-border);
|
|
50
|
+
border-radius: var(--radius-semantic-sm);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
._checkbox__input_ndpjl_39:checked {
|
|
54
|
+
background-color: var(--_checkbox-accent);
|
|
55
|
+
border-color: var(--_checkbox-accent);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
._checkbox__input_ndpjl_39:indeterminate {
|
|
59
|
+
background-color: var(--color-semantic-surface-base);
|
|
60
|
+
border-color: var(--_checkbox-accent);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
._checkbox__input_ndpjl_39:disabled {
|
|
64
|
+
cursor: default;
|
|
65
|
+
background-color: var(--color-semantic-border-neutral-base);
|
|
66
|
+
border-color: var(--color-semantic-border-neutral-mid);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
._checkbox__input_ndpjl_39:disabled:checked {
|
|
70
|
+
background-color: var(--color-semantic-interactive-primary-disabled);
|
|
71
|
+
border-color: var(--color-semantic-interactive-primary-disabled);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
._checkbox__input_ndpjl_39:disabled:indeterminate {
|
|
75
|
+
background-color: var(--color-semantic-surface-base);
|
|
76
|
+
border-color: var(--color-semantic-interactive-primary-disabled);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* === Icons === */
|
|
80
|
+
|
|
81
|
+
._checkbox__icon_ndpjl_81 {
|
|
82
|
+
display: none;
|
|
83
|
+
width: var(--_checkbox-icon-size);
|
|
84
|
+
height: var(--_checkbox-icon-size);
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
._checkbox__icon--check_ndpjl_88 {
|
|
89
|
+
color: var(--color-semantic-foreground-inverse);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
._checkbox__icon--minus_ndpjl_92 {
|
|
93
|
+
color: var(--_checkbox-accent);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
._checkbox__input_ndpjl_39:checked ~ ._checkbox__icon--check_ndpjl_88,
|
|
97
|
+
._checkbox__input_ndpjl_39:indeterminate ~ ._checkbox__icon--minus_ndpjl_92 {
|
|
98
|
+
display: block;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
._checkbox__input_ndpjl_39:indeterminate ~ ._checkbox__icon--check_ndpjl_88 {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
._checkbox__input_ndpjl_39:disabled ~ ._checkbox__icon--minus_ndpjl_92 {
|
|
106
|
+
color: var(--color-semantic-interactive-primary-disabled);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* === Text === */
|
|
110
|
+
|
|
111
|
+
._checkbox__label_ndpjl_111 {
|
|
112
|
+
grid-row: 1;
|
|
113
|
+
grid-column: 2;
|
|
114
|
+
|
|
115
|
+
/* Centres the first line in the 24 px row, also when the label wraps. */
|
|
116
|
+
padding-block: calc((var(--spacing-space-24) - 1lh) / 2);
|
|
117
|
+
font: var(--typography-label-lg);
|
|
118
|
+
overflow-wrap: anywhere;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
._checkbox__required_ndpjl_122 {
|
|
123
|
+
margin-inline-start: var(--spacing-space-4);
|
|
124
|
+
color: var(--color-semantic-foreground-primary-strong);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
._checkbox_ndpjl_1:has(._checkbox__input_ndpjl_39:disabled) ._checkbox__label_ndpjl_111 {
|
|
128
|
+
color: var(--color-semantic-foreground-muted);
|
|
129
|
+
cursor: default;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
._checkbox_ndpjl_1:has(._checkbox__input_ndpjl_39:disabled) ._checkbox__required_ndpjl_122 {
|
|
133
|
+
color: inherit;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
._checkbox__description_ndpjl_136,
|
|
137
|
+
._checkbox__error_ndpjl_137 {
|
|
138
|
+
grid-column: 2;
|
|
139
|
+
font: var(--typography-body-sm);
|
|
140
|
+
overflow-wrap: anywhere;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
._checkbox__description_ndpjl_136 {
|
|
144
|
+
color: var(--color-semantic-foreground-muted);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
._checkbox__error_ndpjl_137 {
|
|
148
|
+
margin-block-start: var(--spacing-space-4);
|
|
149
|
+
color: var(--color-semantic-foreground-status-error);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* === Visually hidden (same as ButtonCard) === */
|
|
153
|
+
|
|
154
|
+
._checkbox__sr-only_ndpjl_154 {
|
|
155
|
+
position: absolute;
|
|
156
|
+
width: 1px;
|
|
157
|
+
height: 1px;
|
|
158
|
+
padding: 0;
|
|
159
|
+
margin: -1px;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
border: 0;
|
|
163
|
+
clip: rect(0, 0, 0, 0);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Styles apply from [data-color-scheme="dark"] down to (but not into) [data-color-scheme="light"]. */
|
|
167
|
+
@scope ([data-color-scheme='dark']) to ([data-color-scheme='light']) {
|
|
168
|
+
._checkbox_ndpjl_1 {
|
|
169
|
+
color: var(--color-semantic-foreground-inverse);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
._checkbox__required_ndpjl_122 {
|
|
173
|
+
color: var(--color-semantic-foreground-inverse);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
._checkbox_ndpjl_1:has(._checkbox__input_ndpjl_39:disabled) ._checkbox__label_ndpjl_111,
|
|
177
|
+
._checkbox__description_ndpjl_136 {
|
|
178
|
+
color: var(--color-semantic-foreground-inverse-muted);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* Inverse interactive tokens, like Button and Pill on dark surfaces. */
|
|
182
|
+
._checkbox__control_ndpjl_12 {
|
|
183
|
+
--_checkbox-accent: var(--color-semantic-interactive-inverse-default);
|
|
184
|
+
--_checkbox-border: var(--color-semantic-interactive-inverse-default);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
._checkbox__input_ndpjl_39:not(:checked, :disabled),
|
|
188
|
+
._checkbox__input_ndpjl_39:indeterminate:not(:disabled) {
|
|
189
|
+
background-color: transparent;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
._checkbox__input_ndpjl_39:disabled:not(:checked) {
|
|
193
|
+
background-color: transparent;
|
|
194
|
+
border-color: var(--color-semantic-interactive-inverse-disabled);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
._checkbox__input_ndpjl_39:disabled:checked {
|
|
198
|
+
background-color: var(--color-semantic-interactive-inverse-disabled);
|
|
199
|
+
border-color: var(--color-semantic-interactive-inverse-disabled);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* After the disabled checked rule, so a mixed state stays hollow. */
|
|
203
|
+
._checkbox__input_ndpjl_39:disabled:indeterminate {
|
|
204
|
+
background-color: transparent;
|
|
205
|
+
border-color: var(--color-semantic-interactive-inverse-disabled);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
._checkbox__icon--check_ndpjl_88 {
|
|
209
|
+
color: var(--color-semantic-foreground-secondary-strong);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* The check sits on the red error fill, not on the white accent fill. */
|
|
213
|
+
._checkbox--error_ndpjl_34 ._checkbox__icon--check_ndpjl_88 {
|
|
214
|
+
color: var(--color-semantic-foreground-inverse);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
._checkbox__input_ndpjl_39:disabled ~ ._checkbox__icon--check_ndpjl_88 {
|
|
218
|
+
color: var(--color-semantic-foreground-inverse-muted);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
._checkbox__input_ndpjl_39:disabled ~ ._checkbox__icon--minus_ndpjl_92 {
|
|
222
|
+
color: var(--color-semantic-interactive-inverse-disabled);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/*
|
|
226
|
+
* TODO: red error text and border are only about 2.5:1 on dark surfaces.
|
|
227
|
+
* Needs a unified token solution across components (for example an error-inverse colour).
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
/* Scoped dark rules beat the unscoped block below, so forced colors are repeated here. */
|
|
231
|
+
@media (forced-colors: active) {
|
|
232
|
+
._checkbox__input_ndpjl_39 {
|
|
233
|
+
background-color: Canvas;
|
|
234
|
+
border-color: CanvasText;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
._checkbox__input_ndpjl_39:checked {
|
|
238
|
+
background-color: Highlight;
|
|
239
|
+
border-color: Highlight;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
._checkbox__input_ndpjl_39:indeterminate {
|
|
243
|
+
background-color: Canvas;
|
|
244
|
+
border-color: Highlight;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
._checkbox__icon--check_ndpjl_88,
|
|
248
|
+
._checkbox--error_ndpjl_34 ._checkbox__icon--check_ndpjl_88 {
|
|
249
|
+
color: HighlightText;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
._checkbox__icon--minus_ndpjl_92 {
|
|
253
|
+
color: Highlight;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
._checkbox__input_ndpjl_39:disabled,
|
|
257
|
+
._checkbox__input_ndpjl_39:disabled:checked,
|
|
258
|
+
._checkbox__input_ndpjl_39:disabled:indeterminate {
|
|
259
|
+
background-color: Canvas;
|
|
260
|
+
border-color: GrayText;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
._checkbox__input_ndpjl_39:disabled ~ ._checkbox__icon_ndpjl_81 {
|
|
264
|
+
color: GrayText;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
._checkbox_ndpjl_1:has(._checkbox__input_ndpjl_39:disabled) ._checkbox__label_ndpjl_111 {
|
|
268
|
+
color: GrayText;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
._checkbox__error_ndpjl_137 {
|
|
272
|
+
color: CanvasText;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@media (forced-colors: active) {
|
|
278
|
+
._checkbox__input_ndpjl_39 {
|
|
279
|
+
background-color: Canvas;
|
|
280
|
+
border-color: CanvasText;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
._checkbox__input_ndpjl_39:checked {
|
|
284
|
+
background-color: Highlight;
|
|
285
|
+
border-color: Highlight;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
._checkbox__input_ndpjl_39:indeterminate {
|
|
289
|
+
background-color: Canvas;
|
|
290
|
+
border-color: Highlight;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
._checkbox__icon--check_ndpjl_88 {
|
|
294
|
+
color: HighlightText;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
._checkbox__icon--minus_ndpjl_92 {
|
|
298
|
+
color: Highlight;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
._checkbox__input_ndpjl_39:disabled,
|
|
302
|
+
._checkbox__input_ndpjl_39:disabled:checked,
|
|
303
|
+
._checkbox__input_ndpjl_39:disabled:indeterminate {
|
|
304
|
+
background-color: Canvas;
|
|
305
|
+
border-color: GrayText;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
._checkbox__input_ndpjl_39:disabled ~ ._checkbox__icon_ndpjl_81 {
|
|
309
|
+
color: GrayText;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
._checkbox_ndpjl_1:has(._checkbox__input_ndpjl_39:disabled) ._checkbox__label_ndpjl_111 {
|
|
313
|
+
color: GrayText;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
._checkbox__error_ndpjl_137 {
|
|
317
|
+
color: CanvasText;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Do not edit directly, this file was auto-generated.
|
|
323
|
+
*/ }
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CheckboxProps } from './Checkbox.types';
|
|
2
|
+
export declare const Checkbox: ({ label, showLabel, description, indeterminate, error, errorMessage, onCheckedChange, onChange, id, className, style, disabled, required, ref, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,eAAO,MAAM,QAAQ,GAAI,6NAkBtB,aAAa,4CAoFf,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CheckFilled, MinusFilled } from "@dnanpm/icons";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { focusStyles } from "../../styles/utils/index.js";
|
|
5
|
+
import styles from "./Checkbox.module.css.js";
|
|
6
|
+
import { isRenderable } from "../../utils/isRenderable/isRenderable.js";
|
|
7
|
+
import { cn } from "../../utils/cn/cn.js";
|
|
8
|
+
const Checkbox = ({
|
|
9
|
+
label,
|
|
10
|
+
showLabel = true,
|
|
11
|
+
description,
|
|
12
|
+
indeterminate = false,
|
|
13
|
+
error = false,
|
|
14
|
+
errorMessage,
|
|
15
|
+
onCheckedChange,
|
|
16
|
+
onChange,
|
|
17
|
+
id,
|
|
18
|
+
className,
|
|
19
|
+
style,
|
|
20
|
+
disabled,
|
|
21
|
+
required,
|
|
22
|
+
ref,
|
|
23
|
+
"aria-describedby": ariaDescribedBy,
|
|
24
|
+
"aria-invalid": ariaInvalid,
|
|
25
|
+
...props
|
|
26
|
+
}) => {
|
|
27
|
+
const generatedId = useId();
|
|
28
|
+
const descriptionId = useId();
|
|
29
|
+
const errorId = useId();
|
|
30
|
+
const inputId = id ?? generatedId;
|
|
31
|
+
const hasDescription = isRenderable(description);
|
|
32
|
+
const hasErrorMessage = error && isRenderable(errorMessage);
|
|
33
|
+
const describedBy = [
|
|
34
|
+
hasDescription ? descriptionId : void 0,
|
|
35
|
+
hasErrorMessage ? errorId : void 0,
|
|
36
|
+
ariaDescribedBy
|
|
37
|
+
].filter(Boolean).join(" ") || void 0;
|
|
38
|
+
const handleChange = (event) => {
|
|
39
|
+
onChange?.(event);
|
|
40
|
+
onCheckedChange?.(event.target.checked);
|
|
41
|
+
event.target.indeterminate = indeterminate;
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: cn(styles["checkbox"], error && styles["checkbox--error"], className),
|
|
47
|
+
style,
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsxs("span", { className: styles["checkbox__control"], children: [
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"input",
|
|
52
|
+
{
|
|
53
|
+
...props,
|
|
54
|
+
ref: (node) => {
|
|
55
|
+
if (node) node.indeterminate = indeterminate;
|
|
56
|
+
if (typeof ref === "function") return ref(node);
|
|
57
|
+
if (ref) ref.current = node;
|
|
58
|
+
return void 0;
|
|
59
|
+
},
|
|
60
|
+
type: "checkbox",
|
|
61
|
+
id: inputId,
|
|
62
|
+
className: cn(styles["checkbox__input"], focusStyles.focusable),
|
|
63
|
+
disabled,
|
|
64
|
+
required,
|
|
65
|
+
"aria-describedby": describedBy,
|
|
66
|
+
"aria-invalid": ariaInvalid ?? (error || void 0),
|
|
67
|
+
onChange: handleChange
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
CheckFilled,
|
|
72
|
+
{
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
className: cn(styles["checkbox__icon"], styles["checkbox__icon--check"])
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
MinusFilled,
|
|
79
|
+
{
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
className: cn(styles["checkbox__icon"], styles["checkbox__icon--minus"])
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ jsxs(
|
|
86
|
+
"label",
|
|
87
|
+
{
|
|
88
|
+
htmlFor: inputId,
|
|
89
|
+
className: cn(styles["checkbox__label"], !showLabel && styles["checkbox__sr-only"]),
|
|
90
|
+
children: [
|
|
91
|
+
label,
|
|
92
|
+
required && /* @__PURE__ */ jsx("span", { className: styles["checkbox__required"], "aria-hidden": "true", children: "*" })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
hasDescription && /* @__PURE__ */ jsx("div", { id: descriptionId, className: styles["checkbox__description"], children: description }),
|
|
97
|
+
hasErrorMessage && /* @__PURE__ */ jsx("div", { id: errorId, className: styles["checkbox__error"], children: errorMessage })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
Checkbox
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { CheckFilled, MinusFilled } from '@dnanpm/icons';\nimport { useId } from 'react';\nimport type { ChangeEvent } from 'react';\nimport { focusStyles } from '../../styles/utils';\nimport { cn } from '../../utils/cn';\nimport { isRenderable } from '../../utils/isRenderable';\nimport type { CheckboxProps } from './Checkbox.types';\nimport styles from './Checkbox.module.css';\n\nexport const Checkbox = ({\n label,\n showLabel = true,\n description,\n indeterminate = false,\n error = false,\n errorMessage,\n onCheckedChange,\n onChange,\n id,\n className,\n style,\n disabled,\n required,\n ref,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n ...props\n}: CheckboxProps) => {\n const generatedId = useId();\n const descriptionId = useId();\n const errorId = useId();\n const inputId = id ?? generatedId;\n\n const hasDescription = isRenderable(description);\n const hasErrorMessage = error && isRenderable(errorMessage);\n\n const describedBy =\n [\n hasDescription ? descriptionId : undefined,\n hasErrorMessage ? errorId : undefined,\n ariaDescribedBy,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n onCheckedChange?.(event.target.checked);\n // The browser clears `indeterminate` on click. Restore it from the prop, so it stays\n // until the consumer sets the prop to false, even when nothing re-renders.\n event.target.indeterminate = indeterminate;\n };\n\n return (\n <div\n className={cn(styles['checkbox'], error && styles['checkbox--error'], className)}\n style={style}\n >\n <span className={styles['checkbox__control']}>\n <input\n {...props}\n ref={(node) => {\n // `indeterminate` has no HTML attribute, so it is set on the DOM node.\n // The inline callback runs on every render, so a changed prop is applied.\n // A cleanup function returned by a callback ref is passed on to React.\n if (node) node.indeterminate = indeterminate;\n if (typeof ref === 'function') return ref(node);\n if (ref) ref.current = node;\n return undefined;\n }}\n type=\"checkbox\"\n id={inputId}\n className={cn(styles['checkbox__input'], focusStyles.focusable)}\n disabled={disabled}\n required={required}\n aria-describedby={describedBy}\n aria-invalid={ariaInvalid ?? (error || undefined)}\n onChange={handleChange}\n />\n <CheckFilled\n aria-hidden=\"true\"\n className={cn(styles['checkbox__icon'], styles['checkbox__icon--check'])}\n />\n <MinusFilled\n aria-hidden=\"true\"\n className={cn(styles['checkbox__icon'], styles['checkbox__icon--minus'])}\n />\n </span>\n <label\n htmlFor={inputId}\n className={cn(styles['checkbox__label'], !showLabel && styles['checkbox__sr-only'])}\n >\n {label}\n {required && (\n <span className={styles['checkbox__required']} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n {hasDescription && (\n <div id={descriptionId} className={styles['checkbox__description']}>\n {description}\n </div>\n )}\n {hasErrorMessage && (\n <div id={errorId} className={styles['checkbox__error']}>\n {errorMessage}\n </div>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AASO,MAAM,WAAW,CAAC;AAAA,EACrB;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,GAAG;AACP,MAAqB;AACjB,QAAM,cAAc,MAAA;AACpB,QAAM,gBAAgB,MAAA;AACtB,QAAM,UAAU,MAAA;AAChB,QAAM,UAAU,MAAM;AAEtB,QAAM,iBAAiB,aAAa,WAAW;AAC/C,QAAM,kBAAkB,SAAS,aAAa,YAAY;AAE1D,QAAM,cACF;AAAA,IACI,iBAAiB,gBAAgB;AAAA,IACjC,kBAAkB,UAAU;AAAA,IAC5B;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,KAAK;AAEtB,QAAM,eAAe,CAAC,UAAyC;AAC3D,eAAW,KAAK;AAChB,sBAAkB,MAAM,OAAO,OAAO;AAGtC,UAAM,OAAO,gBAAgB;AAAA,EACjC;AAEA,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,GAAG,OAAO,UAAU,GAAG,SAAS,OAAO,iBAAiB,GAAG,SAAS;AAAA,MAC/E;AAAA,MAEA,UAAA;AAAA,QAAA,qBAAC,QAAA,EAAK,WAAW,OAAO,mBAAmB,GACvC,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACI,GAAG;AAAA,cACJ,KAAK,CAAC,SAAS;AAIX,oBAAI,WAAW,gBAAgB;AAC/B,oBAAI,OAAO,QAAQ,WAAY,QAAO,IAAI,IAAI;AAC9C,oBAAI,SAAS,UAAU;AACvB,uBAAO;AAAA,cACX;AAAA,cACA,MAAK;AAAA,cACL,IAAI;AAAA,cACJ,WAAW,GAAG,OAAO,iBAAiB,GAAG,YAAY,SAAS;AAAA,cAC9D;AAAA,cACA;AAAA,cACA,oBAAkB;AAAA,cAClB,gBAAc,gBAAgB,SAAS;AAAA,cACvC,UAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEd;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,eAAY;AAAA,cACZ,WAAW,GAAG,OAAO,gBAAgB,GAAG,OAAO,uBAAuB,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,UAE3E;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,eAAY;AAAA,cACZ,WAAW,GAAG,OAAO,gBAAgB,GAAG,OAAO,uBAAuB,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QAC3E,GACJ;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,SAAS;AAAA,YACT,WAAW,GAAG,OAAO,iBAAiB,GAAG,CAAC,aAAa,OAAO,mBAAmB,CAAC;AAAA,YAEjF,UAAA;AAAA,cAAA;AAAA,cACA,gCACI,QAAA,EAAK,WAAW,OAAO,oBAAoB,GAAG,eAAY,QAAO,UAAA,IAAA,CAElE;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGP,sCACI,OAAA,EAAI,IAAI,eAAe,WAAW,OAAO,uBAAuB,GAC5D,UAAA,YAAA,CACL;AAAA,QAEH,uCACI,OAAA,EAAI,IAAI,SAAS,WAAW,OAAO,iBAAiB,GAChD,UAAA,aAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require('./Checkbox.css');
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4
|
+
const checkbox = "_checkbox_ndpjl_1";
|
|
5
|
+
const checkbox__control = "_checkbox__control_ndpjl_12";
|
|
6
|
+
const checkbox__input = "_checkbox__input_ndpjl_39";
|
|
7
|
+
const checkbox__icon = "_checkbox__icon_ndpjl_81";
|
|
8
|
+
const checkbox__label = "_checkbox__label_ndpjl_111";
|
|
9
|
+
const checkbox__required = "_checkbox__required_ndpjl_122";
|
|
10
|
+
const checkbox__description = "_checkbox__description_ndpjl_136";
|
|
11
|
+
const checkbox__error = "_checkbox__error_ndpjl_137";
|
|
12
|
+
const styles = {
|
|
13
|
+
checkbox,
|
|
14
|
+
checkbox__control,
|
|
15
|
+
"checkbox--error": "_checkbox--error_ndpjl_34",
|
|
16
|
+
checkbox__input,
|
|
17
|
+
checkbox__icon,
|
|
18
|
+
"checkbox__icon--check": "_checkbox__icon--check_ndpjl_88",
|
|
19
|
+
"checkbox__icon--minus": "_checkbox__icon--minus_ndpjl_92",
|
|
20
|
+
checkbox__label,
|
|
21
|
+
checkbox__required,
|
|
22
|
+
checkbox__description,
|
|
23
|
+
checkbox__error,
|
|
24
|
+
"checkbox__sr-only": "_checkbox__sr-only_ndpjl_154"
|
|
25
|
+
};
|
|
26
|
+
exports.checkbox = checkbox;
|
|
27
|
+
exports.checkbox__control = checkbox__control;
|
|
28
|
+
exports.checkbox__description = checkbox__description;
|
|
29
|
+
exports.checkbox__error = checkbox__error;
|
|
30
|
+
exports.checkbox__icon = checkbox__icon;
|
|
31
|
+
exports.checkbox__input = checkbox__input;
|
|
32
|
+
exports.checkbox__label = checkbox__label;
|
|
33
|
+
exports.checkbox__required = checkbox__required;
|
|
34
|
+
exports.default = styles;
|
|
35
|
+
//# sourceMappingURL=Checkbox.module.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import './Checkbox.css';
|
|
2
|
+
const checkbox = "_checkbox_ndpjl_1";
|
|
3
|
+
const checkbox__control = "_checkbox__control_ndpjl_12";
|
|
4
|
+
const checkbox__input = "_checkbox__input_ndpjl_39";
|
|
5
|
+
const checkbox__icon = "_checkbox__icon_ndpjl_81";
|
|
6
|
+
const checkbox__label = "_checkbox__label_ndpjl_111";
|
|
7
|
+
const checkbox__required = "_checkbox__required_ndpjl_122";
|
|
8
|
+
const checkbox__description = "_checkbox__description_ndpjl_136";
|
|
9
|
+
const checkbox__error = "_checkbox__error_ndpjl_137";
|
|
10
|
+
const styles = {
|
|
11
|
+
checkbox,
|
|
12
|
+
checkbox__control,
|
|
13
|
+
"checkbox--error": "_checkbox--error_ndpjl_34",
|
|
14
|
+
checkbox__input,
|
|
15
|
+
checkbox__icon,
|
|
16
|
+
"checkbox__icon--check": "_checkbox__icon--check_ndpjl_88",
|
|
17
|
+
"checkbox__icon--minus": "_checkbox__icon--minus_ndpjl_92",
|
|
18
|
+
checkbox__label,
|
|
19
|
+
checkbox__required,
|
|
20
|
+
checkbox__description,
|
|
21
|
+
checkbox__error,
|
|
22
|
+
"checkbox__sr-only": "_checkbox__sr-only_ndpjl_154"
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
checkbox,
|
|
26
|
+
checkbox__control,
|
|
27
|
+
checkbox__description,
|
|
28
|
+
checkbox__error,
|
|
29
|
+
checkbox__icon,
|
|
30
|
+
checkbox__input,
|
|
31
|
+
checkbox__label,
|
|
32
|
+
checkbox__required,
|
|
33
|
+
styles as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=Checkbox.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Native checkbox input props go to the `<input>`, including `ref`, `id`, `name`,
|
|
4
|
+
* `value`, `checked`, `defaultChecked`, `disabled` and `required`.
|
|
5
|
+
* `className` and `style` go to the root element.
|
|
6
|
+
*/
|
|
7
|
+
export interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'type' | 'children'> {
|
|
8
|
+
/**
|
|
9
|
+
* Visible label and accessible name. Plain text only: links and other interactive
|
|
10
|
+
* content inside a label cause accessibility problems. Put a link in `description` instead.
|
|
11
|
+
* Always provide text: an empty or blank label leaves the checkbox without a name.
|
|
12
|
+
*/
|
|
13
|
+
readonly label: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the label is visible. When `false`, the label is hidden visually but
|
|
16
|
+
* still names the checkbox for assistive technology. Use only in special cases:
|
|
17
|
+
* without a visible label, only the checkbox itself can be clicked, which is a small target.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
readonly showLabel?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Supporting text below the label. Linked to the checkbox with `aria-describedby`.
|
|
23
|
+
* Can contain a link, for example to the terms. Links are not allowed in `label`.
|
|
24
|
+
*/
|
|
25
|
+
readonly description?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Shows the mixed state, for a checkbox that stands for a group where only some items
|
|
28
|
+
* are selected. Controlled: update it in `onCheckedChange`.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
readonly indeterminate?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Marks the checkbox as invalid and shows `errorMessage`. Always provide an
|
|
34
|
+
* `errorMessage` too, so the error is not shown by colour alone.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
readonly error?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Error text shown below the label when `error` is `true`. Explain how to fix the problem.
|
|
40
|
+
*/
|
|
41
|
+
readonly errorMessage?: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Called with the new checked value when the user changes the checkbox. Runs after `onChange`.
|
|
44
|
+
*/
|
|
45
|
+
readonly onCheckedChange?: (checked: boolean) => void;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=Checkbox.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5F;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const
|
|
5
|
+
const index = require("../../styles/utils/index.cjs");
|
|
6
6
|
const ContentCard_module = require("./ContentCard.module.css.cjs");
|
|
7
|
+
const isRenderable = require("../../utils/isRenderable/isRenderable.cjs");
|
|
7
8
|
const cn = require("../../utils/cn/cn.cjs");
|
|
8
9
|
const logoBackgroundToken = {
|
|
9
10
|
white: "var(--color-semantic-surface-base)",
|
|
@@ -17,7 +18,6 @@ const logoBackgroundToken = {
|
|
|
17
18
|
"plum-mid": "var(--color-semantic-surface-secondary-mid)",
|
|
18
19
|
"plum-strong": "var(--color-semantic-surface-secondary-strong)"
|
|
19
20
|
};
|
|
20
|
-
const isRenderable = (node) => node != null && typeof node !== "boolean";
|
|
21
21
|
const ContentCard = ({
|
|
22
22
|
media,
|
|
23
23
|
mediaKind = "image",
|
|
@@ -38,7 +38,7 @@ const ContentCard = ({
|
|
|
38
38
|
const titleId = react.useId();
|
|
39
39
|
const HeadingLevel = headingLevel;
|
|
40
40
|
const Root = as;
|
|
41
|
-
const hasMedia = isRenderable(media);
|
|
41
|
+
const hasMedia = isRenderable.isRenderable(media);
|
|
42
42
|
const ariaLabel = props["aria-label"];
|
|
43
43
|
const ariaLabelledBy = props["aria-labelledby"] ?? (ariaLabel || as === "div" ? void 0 : titleId);
|
|
44
44
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -46,13 +46,14 @@ const ContentCard = ({
|
|
|
46
46
|
{
|
|
47
47
|
ref,
|
|
48
48
|
...props,
|
|
49
|
+
"data-color-scheme": "light",
|
|
49
50
|
className: cn.cn(
|
|
50
51
|
ContentCard_module["content-card"],
|
|
51
52
|
hasMedia && mediaWidth === "1/2" && ContentCard_module["content-card--media-half"],
|
|
52
53
|
hasMedia && mediaPosition === "end" && ContentCard_module["content-card--media-end"],
|
|
53
54
|
appearance === "border" && ContentCard_module["content-card--border"],
|
|
54
55
|
appearance === "elevated" && ContentCard_module["content-card--elevated"],
|
|
55
|
-
appearance === "elevated" &&
|
|
56
|
+
appearance === "elevated" && index.elevationStyles.elevationLow,
|
|
56
57
|
className
|
|
57
58
|
),
|
|
58
59
|
"aria-label": ariaLabel,
|
|
@@ -74,7 +75,7 @@ const ContentCard = ({
|
|
|
74
75
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: ContentCard_module["content-card__content"], children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ContentCard_module["content-card__content-inner"], children: [
|
|
75
76
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ContentCard_module["content-card__body-region"], children: [
|
|
76
77
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ContentCard_module["content-card__header"], children: [
|
|
77
|
-
isRenderable(titlePrefix) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ContentCard_module["content-card__prefix"], children: titlePrefix }),
|
|
78
|
+
isRenderable.isRenderable(titlePrefix) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ContentCard_module["content-card__prefix"], children: titlePrefix }),
|
|
78
79
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
79
80
|
HeadingLevel,
|
|
80
81
|
{
|
|
@@ -84,9 +85,9 @@ const ContentCard = ({
|
|
|
84
85
|
}
|
|
85
86
|
)
|
|
86
87
|
] }),
|
|
87
|
-
isRenderable(body) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn.cn(ContentCard_module["content-card__body"], "dds-prose"), children: body })
|
|
88
|
+
isRenderable.isRenderable(body) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn.cn(ContentCard_module["content-card__body"], "dds-prose"), children: body })
|
|
88
89
|
] }),
|
|
89
|
-
isRenderable(actions) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ContentCard_module["content-card__actions"], children: actions })
|
|
90
|
+
isRenderable.isRenderable(actions) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ContentCard_module["content-card__actions"], children: actions })
|
|
90
91
|
] }) })
|
|
91
92
|
] })
|
|
92
93
|
}
|