@eyesee/ui-components 0.1.1 → 0.1.3
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 +291 -37
- package/dist/components/Avatar/Avatar.module.scss.js +16 -16
- package/dist/components/Badge/Badge.module.scss.js +4 -4
- package/dist/components/Button/Button.js +31 -30
- package/dist/components/Button/Button.module.scss.js +33 -33
- package/dist/components/Checkbox/Checkbox.js +18 -19
- package/dist/components/Checkbox/Checkbox.module.scss.js +12 -12
- package/dist/components/DropdownList/DropdownList.module.scss.js +5 -5
- package/dist/components/EllipsisTooltip/EllipsisTooltip.module.scss.js +4 -4
- package/dist/components/ExpandableItem/ExpandableItem.module.scss.js +4 -4
- package/dist/components/Fields/InputField/InputField.module.scss.js +16 -16
- package/dist/components/Fields/InputFieldContainer.module.scss.js +10 -10
- package/dist/components/Fields/SelectField/SelectField.module.scss.js +4 -4
- package/dist/components/Fields/SelectField/SelectFieldTags.module.scss.js +8 -8
- package/dist/components/Fields/TextField/TextField.module.scss.js +6 -6
- package/dist/components/FileType/FileType.module.scss.js +7 -7
- package/dist/components/ImagePlaceholder/ImagePlaceholder.module.scss.js +30 -30
- package/dist/components/ImageWithData/ImageWithData.module.scss.js +32 -32
- package/dist/components/Infobox/Infobox.module.scss.js +1 -1
- package/dist/components/ListItem/ListItem.js +21 -19
- package/dist/components/ListItem/ListItem.module.scss.js +14 -14
- package/dist/components/Modal/Modal.module.scss.js +6 -6
- package/dist/components/Notifications/Notifications.module.scss.js +10 -10
- package/dist/components/Pill/Pill.module.scss.js +10 -10
- package/dist/components/ProgressBar/ProgressBar.module.scss.js +2 -2
- package/dist/components/Radio/Radio.module.scss.js +6 -6
- package/dist/components/Tab/Tab.module.scss.js +23 -23
- package/dist/components/Tabs/Tabs.module.scss.js +10 -10
- package/dist/components/Tag/Tag.module.scss.js +12 -12
- package/dist/components/TextHoverable/TextHoverable.module.scss.js +2 -2
- package/dist/components/Toggle/Toggle.module.scss.js +17 -17
- package/dist/components/Tooltip/Tooltip.module.scss.js +19 -19
- package/dist/components/icons-v2/createIcon.module.scss.js +10 -10
- package/dist/style.css +1 -1
- package/package.json +65 -56
package/README.md
CHANGED
|
@@ -1,37 +1,291 @@
|
|
|
1
|
-
# @eyesee/ui-components
|
|
2
|
-
|
|
3
|
-
Shared EyeSee React
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
# @eyesee/ui-components
|
|
2
|
+
|
|
3
|
+
Shared EyeSee React component library and design tokens.
|
|
4
|
+
|
|
5
|
+
**Live Storybook:** https://qa-test-components.eyesee-collab.com
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @eyesee/ui-components
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Peer dependencies
|
|
16
|
+
|
|
17
|
+
Install these in your consuming application if not already present:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install react react-dom clsx react-hook-form react-toastify
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Setup
|
|
26
|
+
|
|
27
|
+
### 1. Import styles
|
|
28
|
+
|
|
29
|
+
Import the stylesheet **once** at your application entry point (e.g. `main.jsx` or `App.jsx`):
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import '@eyesee/ui-components/styles';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. Apply theme classes
|
|
36
|
+
|
|
37
|
+
Add `alias--main` and exactly one profile class to a common ancestor element — ideally `<body>`. The profile class controls the visual theme of the library:
|
|
38
|
+
|
|
39
|
+
| Class | Use for |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `alias--main` | Always required |
|
|
42
|
+
| `mapped--internal` | Internal EyeSee tools |
|
|
43
|
+
| `mapped--external` | External-facing applications |
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<body class="alias--main mapped--internal">
|
|
47
|
+
...
|
|
48
|
+
</body>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or in React:
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
document.body.classList.add('alias--main', 'mapped--internal');
|
|
56
|
+
}, []);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The Storybook toolbar switches between the two profiles so you can preview both themes side by side.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Usage
|
|
64
|
+
|
|
65
|
+
All components are exported from the package root:
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
import { Button, InputField, Modal, Toggle } from '@eyesee/ui-components';
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Icons are exported from a separate entry point to keep bundles lean:
|
|
72
|
+
|
|
73
|
+
```jsx
|
|
74
|
+
import { PlusIcon, DeleteIcon, EditIcon } from '@eyesee/ui-components/icons';
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Components
|
|
80
|
+
|
|
81
|
+
### Layout & Feedback
|
|
82
|
+
|
|
83
|
+
| Component | Description |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `Modal` | Dialog overlay with title, description, icon, and footer slots |
|
|
86
|
+
| `Infobox` | Inline status message with icon, title, and body text |
|
|
87
|
+
| `ProgressBar` | Determinate progress indicator with optional label and percentage |
|
|
88
|
+
| `ExpandableItem` | Collapsible `<details>`-based section with a summary title |
|
|
89
|
+
|
|
90
|
+
### Navigation & Selection
|
|
91
|
+
|
|
92
|
+
| Component | Description |
|
|
93
|
+
|---|---|
|
|
94
|
+
| `Tabs` | Tab group managing selection state; wraps `Tab` |
|
|
95
|
+
| `Tab` | Individual tab rendered as a button or span |
|
|
96
|
+
|
|
97
|
+
### Inputs & Form Fields
|
|
98
|
+
|
|
99
|
+
| Component | Description |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `InputField` | Single-line text input with label, icons, error, and info text |
|
|
102
|
+
| `TextField` | Multi-line textarea with label, action buttons, error, and info text |
|
|
103
|
+
| `SelectField` | Dropdown select with label and error support |
|
|
104
|
+
| `Checkbox` | Checkbox with label, indeterminate state, and size variants |
|
|
105
|
+
| `Radio` | Radio button with label and size variants |
|
|
106
|
+
| `Toggle` | Switch (checkbox) with label and size variants |
|
|
107
|
+
|
|
108
|
+
### Buttons & Actions
|
|
109
|
+
|
|
110
|
+
| Component | Description |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `Button` | Primary action button with optional dropdown menu |
|
|
113
|
+
| `DropdownList` | Scrollable menu container; used by `Button` internally |
|
|
114
|
+
|
|
115
|
+
### Display
|
|
116
|
+
|
|
117
|
+
| Component | Description |
|
|
118
|
+
|---|---|
|
|
119
|
+
| `Avatar` | User avatar as initials or photo with size and corner variants |
|
|
120
|
+
| `Badge` | Numeric or text badge in rectangle or pill shape |
|
|
121
|
+
| `Pill` | Status indicator with icon and color/status variants |
|
|
122
|
+
| `Tag` | Label chip with optional dismiss button |
|
|
123
|
+
| `ListItem` | Row with title, description, trailing action icons, and slots |
|
|
124
|
+
| `FileType` | File type icon indicator |
|
|
125
|
+
| `ImagePlaceholder` | Placeholder shown while an image loads |
|
|
126
|
+
| `ImageWithData` | Image with overlaid metadata |
|
|
127
|
+
| `TextHoverable` | Text that reveals additional content on hover |
|
|
128
|
+
| `Tooltip` | Floating label anchored to a trigger element |
|
|
129
|
+
| `EllipsisTooltip` | Tooltip that only activates when text is truncated |
|
|
130
|
+
|
|
131
|
+
### Notifications
|
|
132
|
+
|
|
133
|
+
| Component | Description |
|
|
134
|
+
|---|---|
|
|
135
|
+
| `Notifications` | Toast notification card (title, text, type, actions) |
|
|
136
|
+
| `useNotifications` | Hook for triggering toasts imperatively |
|
|
137
|
+
|
|
138
|
+
Notifications require a single `<ToastContainer>` from `react-toastify` in your app:
|
|
139
|
+
|
|
140
|
+
```jsx
|
|
141
|
+
import { ToastContainer } from 'react-toastify';
|
|
142
|
+
import { useNotifications } from '@eyesee/ui-components';
|
|
143
|
+
|
|
144
|
+
function App() {
|
|
145
|
+
return (
|
|
146
|
+
<>
|
|
147
|
+
<ToastContainer />
|
|
148
|
+
<YourApp />
|
|
149
|
+
</>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function SomeComponent() {
|
|
154
|
+
const { notify } = useNotifications();
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<button onClick={() => notify({ title: 'Saved!', text: 'Your changes were saved.', type: 'success' })}>
|
|
158
|
+
Save
|
|
159
|
+
</button>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Portals
|
|
167
|
+
|
|
168
|
+
`Modal` and `Tooltip` render into a portal. By default they target `document.body`. Use the `portalContainer` prop to override the host element:
|
|
169
|
+
|
|
170
|
+
```jsx
|
|
171
|
+
<Modal visible portalContainer={document.getElementById('modal-root')} />
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
If a `#modal` element exists in the DOM, `Modal` will prefer it automatically. Both components accept a `loadingFallback` prop to customise the Suspense fallback shown while lazy-loaded content resolves.
|
|
175
|
+
|
|
176
|
+
> **Important:** The `alias--main` and profile classes must be on an ancestor that also contains any portal containers, so that CSS custom properties are inherited correctly.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Examples
|
|
181
|
+
|
|
182
|
+
### Button with dropdown
|
|
183
|
+
|
|
184
|
+
```jsx
|
|
185
|
+
import { Button } from '@eyesee/ui-components';
|
|
186
|
+
import { DeleteIcon, EditIcon } from '@eyesee/ui-components/icons';
|
|
187
|
+
|
|
188
|
+
const options = [
|
|
189
|
+
{ value: 'edit', label: 'Edit', icon: <EditIcon /> },
|
|
190
|
+
{ value: 'delete', label: 'Delete', icon: <DeleteIcon /> },
|
|
191
|
+
];
|
|
192
|
+
|
|
193
|
+
<Button
|
|
194
|
+
text="Actions"
|
|
195
|
+
variant="primary"
|
|
196
|
+
options={options}
|
|
197
|
+
onClick={(option) => console.log(option.value)}
|
|
198
|
+
/>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Form fields
|
|
202
|
+
|
|
203
|
+
```jsx
|
|
204
|
+
import { InputField, TextField, Toggle } from '@eyesee/ui-components';
|
|
205
|
+
|
|
206
|
+
<InputField
|
|
207
|
+
label="Email"
|
|
208
|
+
type="email"
|
|
209
|
+
required
|
|
210
|
+
value={email}
|
|
211
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
212
|
+
error={errors.email}
|
|
213
|
+
infoText="We'll never share your email."
|
|
214
|
+
/>
|
|
215
|
+
|
|
216
|
+
<TextField
|
|
217
|
+
label="Notes"
|
|
218
|
+
rows={4}
|
|
219
|
+
value={notes}
|
|
220
|
+
onChange={(e) => setNotes(e.target.value)}
|
|
221
|
+
actions={[{ id: 'save', text: 'Save', onClick: handleSave }]}
|
|
222
|
+
/>
|
|
223
|
+
|
|
224
|
+
<Toggle
|
|
225
|
+
label="Enable notifications"
|
|
226
|
+
checked={enabled}
|
|
227
|
+
onChange={(e) => setEnabled(e.target.checked)}
|
|
228
|
+
/>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Modal with footer actions
|
|
232
|
+
|
|
233
|
+
```jsx
|
|
234
|
+
import { Modal, Button } from '@eyesee/ui-components';
|
|
235
|
+
|
|
236
|
+
<Modal
|
|
237
|
+
visible={isOpen}
|
|
238
|
+
title="Delete item"
|
|
239
|
+
description="This action cannot be undone."
|
|
240
|
+
onClose={() => setIsOpen(false)}
|
|
241
|
+
footer={
|
|
242
|
+
<>
|
|
243
|
+
<Button text="Cancel" variant="neutral" type="outline" onClick={() => setIsOpen(false)} />
|
|
244
|
+
<Button text="Delete" variant="destructive" onClick={handleDelete} />
|
|
245
|
+
</>
|
|
246
|
+
}
|
|
247
|
+
/>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### ListItem with trailing actions
|
|
251
|
+
|
|
252
|
+
```jsx
|
|
253
|
+
import { ListItem } from '@eyesee/ui-components';
|
|
254
|
+
import { EditIcon, DeleteIcon } from '@eyesee/ui-components/icons';
|
|
255
|
+
|
|
256
|
+
<ListItem
|
|
257
|
+
title="Project Alpha"
|
|
258
|
+
description="Last updated 2 days ago"
|
|
259
|
+
item={project}
|
|
260
|
+
trailing={[
|
|
261
|
+
{ type: 'edit', icon: <EditIcon />, onClick: (item) => handleEdit(item) },
|
|
262
|
+
{ type: 'delete', icon: <DeleteIcon />, onClick: (item) => handleDelete(item) },
|
|
263
|
+
]}
|
|
264
|
+
/>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Development
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
# Start Storybook dev server (port 6006)
|
|
273
|
+
npm run storybook
|
|
274
|
+
|
|
275
|
+
# Run unit tests
|
|
276
|
+
npm test
|
|
277
|
+
|
|
278
|
+
# Run tests in watch mode
|
|
279
|
+
npm run test:watch
|
|
280
|
+
|
|
281
|
+
# Build the library
|
|
282
|
+
npm run build
|
|
283
|
+
|
|
284
|
+
# Build Storybook
|
|
285
|
+
npm run build-storybook
|
|
286
|
+
|
|
287
|
+
# Preview what gets published to npm
|
|
288
|
+
npm run pack:check
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
See [UI_LIBRARY_RELEASE_GUIDE.md](./UI_LIBRARY_RELEASE_GUIDE.md) for versioning, release flow, and CI/CD details.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
const s = "
|
|
1
|
+
const s = "_avatar_15tvh_3", t = "_initials_15tvh_13", _ = "_round_15tvh_26", i = "_square_15tvh_29", e = "_size3XS_15tvh_32", o = "_size2XS_15tvh_45", n = "_sizeXS_15tvh_58", z = "_sizeS_15tvh_62", a = "_sizeM_15tvh_66", h = "_sizeL_15tvh_70", v = "_photo_15tvh_74", c = {
|
|
2
2
|
avatar: s,
|
|
3
|
-
initials:
|
|
4
|
-
round:
|
|
3
|
+
initials: t,
|
|
4
|
+
round: _,
|
|
5
5
|
square: i,
|
|
6
6
|
size3XS: e,
|
|
7
|
-
size2XS:
|
|
8
|
-
sizeXS:
|
|
9
|
-
sizeS:
|
|
7
|
+
size2XS: o,
|
|
8
|
+
sizeXS: n,
|
|
9
|
+
sizeS: z,
|
|
10
10
|
sizeM: a,
|
|
11
|
-
sizeL:
|
|
12
|
-
photo:
|
|
11
|
+
sizeL: h,
|
|
12
|
+
photo: v
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
15
|
s as avatar,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
c as default,
|
|
17
|
+
t as initials,
|
|
18
|
+
v as photo,
|
|
19
|
+
_ as round,
|
|
20
|
+
o as size2XS,
|
|
21
21
|
e as size3XS,
|
|
22
|
-
|
|
22
|
+
h as sizeL,
|
|
23
23
|
a as sizeM,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
z as sizeS,
|
|
25
|
+
n as sizeXS,
|
|
26
26
|
i as square
|
|
27
27
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useState as W, useRef as j } from "react";
|
|
3
|
-
import
|
|
3
|
+
import c from "clsx";
|
|
4
4
|
import { ChevronDownIcon as B } from "../icons-v2/ChevronDownIcon.js";
|
|
5
5
|
import { ChevronUpIcon as L } from "../icons-v2/ChevronUpIcon.js";
|
|
6
6
|
import R from "../../hooks/useClickOutside.js";
|
|
7
|
-
import
|
|
7
|
+
import e from "./Button.module.scss.js";
|
|
8
8
|
import { ListItem as S } from "../ListItem/ListItem.js";
|
|
9
9
|
import { DropdownList as A } from "../DropdownList/DropdownList.js";
|
|
10
10
|
import { Tooltip as E } from "../Tooltip/Tooltip.js";
|
|
@@ -29,62 +29,63 @@ const Q = ({
|
|
|
29
29
|
}) => {
|
|
30
30
|
const [s, o] = W(!1), h = j(null);
|
|
31
31
|
R(h, () => o(!1));
|
|
32
|
-
const x = (
|
|
33
|
-
i(
|
|
34
|
-
}, D = a && !l && r.length === 0, k = a && !l, T = !!u, f = /* @__PURE__ */
|
|
32
|
+
const x = (t) => {
|
|
33
|
+
i(t), o(!1);
|
|
34
|
+
}, D = a && !l && r.length === 0, k = a && !l, T = !!u, f = /* @__PURE__ */ m(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
37
|
ref: h,
|
|
38
38
|
"data-button-wrapper": !0,
|
|
39
|
-
className:
|
|
39
|
+
className: c(e.wrapper, d, C && e.fullWidth),
|
|
40
40
|
...y,
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ m(
|
|
43
43
|
"button",
|
|
44
44
|
{
|
|
45
45
|
type: "button",
|
|
46
|
-
className:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
r.length > 0 &&
|
|
52
|
-
D &&
|
|
53
|
-
k &&
|
|
46
|
+
className: c(
|
|
47
|
+
e.button,
|
|
48
|
+
e[b],
|
|
49
|
+
e[g],
|
|
50
|
+
e[w],
|
|
51
|
+
r.length > 0 && e.hasDropdown,
|
|
52
|
+
D && e.iconOnly,
|
|
53
|
+
k && e.isIcon
|
|
54
54
|
),
|
|
55
|
-
onClick: () => r.length > 0 ? o((
|
|
55
|
+
onClick: () => r.length > 0 ? o((t) => !t) : i(),
|
|
56
56
|
"aria-expanded": s,
|
|
57
57
|
"aria-haspopup": "menu",
|
|
58
58
|
disabled: v,
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ m(
|
|
61
61
|
"span",
|
|
62
62
|
{
|
|
63
|
-
className:
|
|
64
|
-
|
|
65
|
-
r.length > 0 &&
|
|
63
|
+
className: c(
|
|
64
|
+
e.buttonContent,
|
|
65
|
+
r.length > 0 && e.buttonContentDropdown
|
|
66
66
|
),
|
|
67
67
|
children: [
|
|
68
|
-
a && /* @__PURE__ */ n("span", { className:
|
|
69
|
-
l && /* @__PURE__ */ n("span", { className:
|
|
68
|
+
a && /* @__PURE__ */ n("span", { className: e.icon, children: a }),
|
|
69
|
+
l && /* @__PURE__ */ n("span", { className: e.buttonText, children: l })
|
|
70
70
|
]
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
r.length > 0 && /* @__PURE__ */ n("span", { className:
|
|
73
|
+
r.length > 0 && /* @__PURE__ */ n("span", { className: e.buttonArrow, children: s ? /* @__PURE__ */ n(L, { iconSize: p }) : /* @__PURE__ */ n(B, { iconSize: p }) })
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
s && r.length > 0 && /* @__PURE__ */ n(A, { align: N, children: r.map((
|
|
77
|
+
s && r.length > 0 && /* @__PURE__ */ n(A, { align: N, children: r.map((t) => /* @__PURE__ */ n(
|
|
78
78
|
S,
|
|
79
79
|
{
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
role: "menuitem",
|
|
81
|
+
title: t.label,
|
|
82
|
+
controlItem: t == null ? void 0 : t.icon,
|
|
82
83
|
horizontalSpacing: "xs",
|
|
83
84
|
verticalSpacing: "none",
|
|
84
|
-
...
|
|
85
|
-
onClick: () => x(
|
|
85
|
+
...t,
|
|
86
|
+
onClick: () => x(t)
|
|
86
87
|
},
|
|
87
|
-
|
|
88
|
+
t.value
|
|
88
89
|
)) })
|
|
89
90
|
]
|
|
90
91
|
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_fullWidth_167fk_3", n = "_button_167fk_6", o = "_wrapper_167fk_10", _ = "_buttonContent_167fk_27", s = "_icon_167fk_27", c = "_buttonArrow_167fk_28", r = "_buttonText_167fk_36", f = "_iconOnly_167fk_53", e = "_buttonContentDropdown_167fk_56", l = "_hasDropdown_167fk_62", u = "_lg_167fk_78", k = "_isIcon_167fk_81", i = "_md_167fk_85", x = "_sm_167fk_92", a = "_xs_167fk_99", d = "_xxs_167fk_106", b = "_xxxs_167fk_113", p = "_primary_167fk_123", w = "_fill_167fk_123", y = "_outline_167fk_154", m = "_blank_167fk_167", h = "_secondary_167fk_214", C = "_destructive_167fk_305", D = "_neutral_167fk_396", g = {
|
|
2
2
|
fullWidth: t,
|
|
3
3
|
button: n,
|
|
4
4
|
wrapper: o,
|
|
5
5
|
buttonContent: _,
|
|
6
6
|
icon: s,
|
|
7
|
-
buttonArrow:
|
|
8
|
-
buttonText:
|
|
9
|
-
iconOnly:
|
|
10
|
-
buttonContentDropdown:
|
|
11
|
-
hasDropdown:
|
|
12
|
-
lg:
|
|
13
|
-
isIcon:
|
|
14
|
-
md:
|
|
15
|
-
sm:
|
|
16
|
-
xs:
|
|
17
|
-
xxs:
|
|
18
|
-
xxxs:
|
|
19
|
-
primary:
|
|
20
|
-
fill:
|
|
21
|
-
outline:
|
|
22
|
-
blank:
|
|
7
|
+
buttonArrow: c,
|
|
8
|
+
buttonText: r,
|
|
9
|
+
iconOnly: f,
|
|
10
|
+
buttonContentDropdown: e,
|
|
11
|
+
hasDropdown: l,
|
|
12
|
+
lg: u,
|
|
13
|
+
isIcon: k,
|
|
14
|
+
md: i,
|
|
15
|
+
sm: x,
|
|
16
|
+
xs: a,
|
|
17
|
+
xxs: d,
|
|
18
|
+
xxxs: b,
|
|
19
|
+
primary: p,
|
|
20
|
+
fill: w,
|
|
21
|
+
outline: y,
|
|
22
|
+
blank: m,
|
|
23
23
|
secondary: h,
|
|
24
24
|
destructive: C,
|
|
25
25
|
neutral: D
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
m as blank,
|
|
29
29
|
n as button,
|
|
30
|
-
|
|
30
|
+
c as buttonArrow,
|
|
31
31
|
_ as buttonContent,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
e as buttonContentDropdown,
|
|
33
|
+
r as buttonText,
|
|
34
34
|
g as default,
|
|
35
35
|
C as destructive,
|
|
36
|
-
|
|
36
|
+
w as fill,
|
|
37
37
|
t as fullWidth,
|
|
38
|
-
|
|
38
|
+
l as hasDropdown,
|
|
39
39
|
s as icon,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
f as iconOnly,
|
|
41
|
+
k as isIcon,
|
|
42
|
+
u as lg,
|
|
43
|
+
i as md,
|
|
44
44
|
D as neutral,
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
y as outline,
|
|
46
|
+
p as primary,
|
|
47
47
|
h as secondary,
|
|
48
|
-
|
|
48
|
+
x as sm,
|
|
49
49
|
o as wrapper,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
a as xs,
|
|
51
|
+
d as xxs,
|
|
52
|
+
b as xxxs
|
|
53
53
|
};
|
|
@@ -1,51 +1,50 @@
|
|
|
1
1
|
import { jsxs as z, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useId as C } from "react";
|
|
3
|
-
import
|
|
3
|
+
import n from "clsx";
|
|
4
4
|
import o from "./Checkbox.module.scss.js";
|
|
5
5
|
import { CheckmarkLargeIcon as I } from "../icons-v2/CheckmarkLargeIcon.js";
|
|
6
6
|
import { MinusIcon as y } from "../icons-v2/MinusIcon.js";
|
|
7
7
|
import { iconSizes as a } from "../icons-v2/constants.js";
|
|
8
|
-
const N = (e) => e === "lg" ? "m" : "s",
|
|
8
|
+
const N = (e) => e === "lg" ? "m" : "s", W = ({
|
|
9
9
|
label: e,
|
|
10
10
|
checked: c = !1,
|
|
11
|
-
indeterminate:
|
|
12
|
-
onChange:
|
|
11
|
+
indeterminate: t = !1,
|
|
12
|
+
onChange: m = () => {
|
|
13
13
|
},
|
|
14
14
|
disabled: i = !1,
|
|
15
|
-
size:
|
|
16
|
-
id:
|
|
17
|
-
name:
|
|
18
|
-
value:
|
|
19
|
-
"aria-label":
|
|
15
|
+
size: p = "md",
|
|
16
|
+
id: x,
|
|
17
|
+
name: d,
|
|
18
|
+
value: f,
|
|
19
|
+
"aria-label": h
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
21
|
+
const k = C(), b = x ?? k, s = N(p), u = a[s] ?? a.m, l = "var(--color--icon--on-color--on-color)";
|
|
22
22
|
return /* @__PURE__ */ z(
|
|
23
23
|
"label",
|
|
24
24
|
{
|
|
25
|
-
className:
|
|
25
|
+
className: n(o.checkboxWrapper, i && o.disabled),
|
|
26
26
|
style: { "--checkbox-size": u },
|
|
27
|
-
htmlFor: l,
|
|
28
27
|
children: [
|
|
29
28
|
/* @__PURE__ */ r(
|
|
30
29
|
"input",
|
|
31
30
|
{
|
|
32
|
-
id:
|
|
31
|
+
id: b,
|
|
33
32
|
type: "checkbox",
|
|
34
|
-
name:
|
|
35
|
-
value:
|
|
33
|
+
name: d,
|
|
34
|
+
value: f,
|
|
36
35
|
className: o.input,
|
|
37
36
|
checked: c,
|
|
38
37
|
disabled: i,
|
|
39
|
-
"aria-label":
|
|
40
|
-
onChange:
|
|
38
|
+
"aria-label": h ?? (e ? void 0 : "checkbox"),
|
|
39
|
+
onChange: m
|
|
41
40
|
}
|
|
42
41
|
),
|
|
43
|
-
/* @__PURE__ */ r("span", { className:
|
|
42
|
+
/* @__PURE__ */ r("span", { className: n(o.checkbox, c && o.filled), "aria-hidden": !0, children: c && (t ? /* @__PURE__ */ r(y, { iconSize: s, strokeColor: l }) : /* @__PURE__ */ r(I, { iconSize: s, strokeColor: l })) }),
|
|
44
43
|
e ? /* @__PURE__ */ r("span", { className: o.labelText, children: e }) : null
|
|
45
44
|
]
|
|
46
45
|
}
|
|
47
46
|
);
|
|
48
47
|
};
|
|
49
48
|
export {
|
|
50
|
-
|
|
49
|
+
W as Checkbox
|
|
51
50
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const
|
|
2
|
-
checkboxWrapper:
|
|
3
|
-
disabled:
|
|
1
|
+
const c = "_checkboxWrapper_apc3k_3", e = "_disabled_apc3k_13", _ = "_input_apc3k_18", a = "_checkbox_apc3k_3", l = "_filled_apc3k_42", p = "_labelText_apc3k_46", t = {
|
|
2
|
+
checkboxWrapper: c,
|
|
3
|
+
disabled: e,
|
|
4
4
|
input: _,
|
|
5
|
-
checkbox:
|
|
6
|
-
filled:
|
|
7
|
-
labelText:
|
|
5
|
+
checkbox: a,
|
|
6
|
+
filled: l,
|
|
7
|
+
labelText: p
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
a as checkbox,
|
|
11
|
+
c as checkboxWrapper,
|
|
12
|
+
t as default,
|
|
13
|
+
e as disabled,
|
|
14
|
+
l as filled,
|
|
15
15
|
_ as input,
|
|
16
|
-
|
|
16
|
+
p as labelText
|
|
17
17
|
};
|