@chayns-ui/core 0.3.2 → 0.4.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 +5 -1
- package/dist/checkbox.css +83 -0
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +3 -0
- package/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/checkbox/Checkbox.d.ts +4 -0
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.js +27 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox/Checkbox.types.d.ts +9 -0
- package/dist/components/checkbox/Checkbox.types.d.ts.map +1 -0
- package/dist/components/list/List.d.ts +14 -2
- package/dist/components/list/List.d.ts.map +1 -1
- package/dist/components/list/List.js +79 -6
- package/dist/components/list/List.js.map +1 -1
- package/dist/components/list/List.types.d.ts +17 -77
- package/dist/components/list/List.types.d.ts.map +1 -1
- package/dist/components/list/ListContext.d.ts +6 -0
- package/dist/components/list/ListContext.d.ts.map +1 -0
- package/dist/components/list/ListContext.js +14 -0
- package/dist/components/list/ListContext.js.map +1 -0
- package/dist/components/message-box/MessageBox.d.ts +4 -0
- package/dist/components/message-box/MessageBox.d.ts.map +1 -0
- package/dist/components/message-box/MessageBox.js +19 -0
- package/dist/components/message-box/MessageBox.js.map +1 -0
- package/dist/components/message-box/MessageBox.types.d.ts +13 -0
- package/dist/components/message-box/MessageBox.types.d.ts.map +1 -0
- package/dist/components/popup/Popup.d.ts +6 -3
- package/dist/components/popup/Popup.d.ts.map +1 -1
- package/dist/components/popup/Popup.js +102 -90
- package/dist/components/popup/Popup.js.map +1 -1
- package/dist/components/popup/Popup.types.d.ts +17 -7
- package/dist/components/popup/Popup.types.d.ts.map +1 -1
- package/dist/components/popup/PopupList.d.ts.map +1 -1
- package/dist/components/popup/PopupList.js +7 -5
- package/dist/components/popup/PopupList.js.map +1 -1
- package/dist/components/radio-group/RadioGroup.d.ts +6 -0
- package/dist/components/radio-group/RadioGroup.d.ts.map +1 -0
- package/dist/components/radio-group/RadioGroup.js +69 -0
- package/dist/components/radio-group/RadioGroup.js.map +1 -0
- package/dist/components/radio-group/RadioGroup.types.d.ts +30 -0
- package/dist/components/radio-group/RadioGroup.types.d.ts.map +1 -0
- package/dist/components/radio-group/RadioGroupContext.d.ts +11 -0
- package/dist/components/radio-group/RadioGroupContext.d.ts.map +1 -0
- package/dist/components/radio-group/RadioGroupContext.js +12 -0
- package/dist/components/radio-group/RadioGroupContext.js.map +1 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +16 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts.map +1 -0
- package/dist/components/segmented-control/SegmentedControl.js +114 -0
- package/dist/components/segmented-control/SegmentedControl.js.map +1 -0
- package/dist/components/segmented-control/SegmentedControl.types.d.ts +41 -0
- package/dist/components/segmented-control/SegmentedControl.types.d.ts.map +1 -0
- package/dist/components/segmented-control/SegmentedControlContext.d.ts +11 -0
- package/dist/components/segmented-control/SegmentedControlContext.d.ts.map +1 -0
- package/dist/components/segmented-control/SegmentedControlContext.js +12 -0
- package/dist/components/segmented-control/SegmentedControlContext.js.map +1 -0
- package/dist/components/switch/Switch.d.ts +4 -0
- package/dist/components/switch/Switch.d.ts.map +1 -0
- package/dist/components/switch/Switch.js +28 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/switch/Switch.types.d.ts +9 -0
- package/dist/components/switch/Switch.types.d.ts.map +1 -0
- package/dist/components/text-area/TextArea.d.ts +4 -0
- package/dist/components/text-area/TextArea.d.ts.map +1 -0
- package/dist/components/text-area/TextArea.js +45 -0
- package/dist/components/text-area/TextArea.js.map +1 -0
- package/dist/components/text-area/TextArea.types.d.ts +17 -0
- package/dist/components/text-area/TextArea.types.d.ts.map +1 -0
- package/dist/components/text-field/TextField.d.ts +4 -0
- package/dist/components/text-field/TextField.d.ts.map +1 -0
- package/dist/components/text-field/TextField.js +45 -0
- package/dist/components/text-field/TextField.js.map +1 -0
- package/dist/components/text-field/TextField.types.d.ts +17 -0
- package/dist/components/text-field/TextField.types.d.ts.map +1 -0
- package/dist/index.d.ts +15 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -3
- package/dist/list.css +33 -44
- package/dist/message-box.css +26 -0
- package/dist/radio-group.css +102 -0
- package/dist/segmented-control.css +61 -0
- package/dist/styles.css +7 -0
- package/dist/switch.css +76 -0
- package/dist/text-area.css +105 -0
- package/dist/text-field.css +107 -0
- package/package.json +8 -1
- package/dist/components/list-item/ListItem.d.ts +0 -4
- package/dist/components/list-item/ListItem.d.ts.map +0 -1
- package/dist/components/list-item/ListItem.js +0 -42
- package/dist/components/list-item/ListItem.js.map +0 -1
- package/dist/components/list-item/list-item-body/ListItemBody.d.ts +0 -10
- package/dist/components/list-item/list-item-body/ListItemBody.d.ts.map +0 -1
- package/dist/components/list-item/list-item-body/ListItemBody.js +0 -30
- package/dist/components/list-item/list-item-body/ListItemBody.js.map +0 -1
package/README.md
CHANGED
|
@@ -39,13 +39,17 @@ import '@chayns-ui/core/button.css';
|
|
|
39
39
|
| `Button`, `IconButton` | `@chayns-ui/core/button.css` |
|
|
40
40
|
| `Card` | `@chayns-ui/core/card.css` |
|
|
41
41
|
| `Avatar`, `AvatarGroup` | `@chayns-ui/core/avatar.css` |
|
|
42
|
-
| `List
|
|
42
|
+
| `List` | `@chayns-ui/core/list.css` |
|
|
43
|
+
| `TextField`, `TextArea`, `Checkbox`, `Switch`, `RadioGroup`, `SegmentedControl`, `MessageBox` | their matching CSS export |
|
|
43
44
|
| `Accordion`, `AccordionGroup` | `@chayns-ui/core/accordion.css` |
|
|
44
45
|
| `Popup`, `PopupList` | `@chayns-ui/core/popup.css` |
|
|
45
46
|
| `SplitButton` | `@chayns-ui/core/split-button.css` |
|
|
46
47
|
|
|
47
48
|
Alternativ lädt `@chayns-ui/core/styles.css` das gebündelte CSS aller Komponenten.
|
|
48
49
|
|
|
50
|
+
`ListItem` wurde vor 1.0 durch `List.Item` ersetzt. Komponiere Zeilen mit
|
|
51
|
+
`List.Item.Action`, `List.Item.Body`, `List.Item.Title` und optionalen Slots.
|
|
52
|
+
|
|
49
53
|
## Hinweise
|
|
50
54
|
|
|
51
55
|
Die Bibliothek lädt keine Fonts, injiziert kein CSS und kalibriert keine
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@layer chayns.components {
|
|
2
|
+
.chayns-checkbox {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
gap: var(--k12);
|
|
6
|
+
margin: 0;
|
|
7
|
+
color: var(--text);
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.chayns-checkbox__input {
|
|
12
|
+
position: absolute;
|
|
13
|
+
inline-size: 1px;
|
|
14
|
+
block-size: 1px;
|
|
15
|
+
margin: -1px;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
clip-path: inset(50%);
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.chayns-checkbox__control {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
display: inline-grid;
|
|
24
|
+
inline-size: var(--k20);
|
|
25
|
+
block-size: var(--k20);
|
|
26
|
+
flex: none;
|
|
27
|
+
place-items: center;
|
|
28
|
+
margin-block-start: 1px;
|
|
29
|
+
border: 2px solid var(--input-border);
|
|
30
|
+
border-radius: 6px;
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.chayns-checkbox__control::after {
|
|
35
|
+
inline-size: calc(var(--k8) - 2px);
|
|
36
|
+
block-size: var(--k12);
|
|
37
|
+
border-inline-end: 2px solid var(--on-accent);
|
|
38
|
+
border-block-end: 2px solid var(--on-accent);
|
|
39
|
+
content: '';
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: rotate(45deg) scale(0.6);
|
|
42
|
+
transition:
|
|
43
|
+
opacity 0.12s ease,
|
|
44
|
+
transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.chayns-checkbox__input:checked + .chayns-checkbox__control {
|
|
48
|
+
border-color: var(--accent);
|
|
49
|
+
background: var(--accent);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.chayns-checkbox__input:checked + .chayns-checkbox__control::after {
|
|
53
|
+
opacity: 1;
|
|
54
|
+
transform: rotate(45deg) scale(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.chayns-checkbox__input:focus-visible + .chayns-checkbox__control {
|
|
58
|
+
outline: var(--focus-ring-size) solid rgb(var(--focus-ring-rgb), var(--focus-ring-alpha-strong));
|
|
59
|
+
outline-offset: 2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.chayns-checkbox:has(.chayns-checkbox__input:disabled) {
|
|
63
|
+
color: var(--disabled-fg);
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.chayns-checkbox__input:disabled + .chayns-checkbox__control {
|
|
68
|
+
border-color: var(--disabled-border);
|
|
69
|
+
background: var(--disabled-bg);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.chayns-checkbox__label {
|
|
73
|
+
font-size: var(--fs-body);
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
line-height: 1.4;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media (prefers-reduced-motion: reduce) {
|
|
79
|
+
.chayns-checkbox__control::after {
|
|
80
|
+
transition: none;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/Accordion.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,SAAS,GAAI,gFAShB,cAAc,
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/Accordion.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,SAAS,GAAI,gFAShB,cAAc,gCAiFhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -49,10 +49,13 @@ var Accordion = ({ children, className, defaultOpen = false, disabled = false, i
|
|
|
49
49
|
children: title
|
|
50
50
|
})]
|
|
51
51
|
}), /* @__PURE__ */ jsx("div", {
|
|
52
|
+
"aria-hidden": !isOpen,
|
|
52
53
|
"aria-labelledby": headerId,
|
|
53
54
|
className: "chayns-accordion__panel",
|
|
54
55
|
id: panelId,
|
|
56
|
+
inert: !isOpen,
|
|
55
57
|
role: "region",
|
|
58
|
+
style: { gridTemplateRows: isOpen ? "1fr" : "0fr" },
|
|
56
59
|
children: /* @__PURE__ */ jsx("div", {
|
|
57
60
|
className: "chayns-accordion__inner",
|
|
58
61
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","names":[],"sources":["../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { useContext, useId, useState } from 'react';\n\nimport { AccordionDepthContext, AccordionGroupContext } from './AccordionContext.js';\nimport type { AccordionProps } from './Accordion.types.js';\n\nconst Accordion = ({\n children,\n className,\n defaultOpen = false,\n disabled = false,\n id,\n onOpenChange,\n open,\n title,\n}: AccordionProps) => {\n const depth = useContext(AccordionDepthContext);\n const group = useContext(AccordionGroupContext);\n const generatedId = useId();\n const baseId = id ?? generatedId;\n const headerId = `${baseId}-header`;\n const panelId = `${baseId}-panel`;\n\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n\n let isOpen: boolean;\n if (group) {\n isOpen = group.isOpen(baseId);\n } else if (open !== undefined) {\n isOpen = open;\n } else {\n isOpen = uncontrolledOpen;\n }\n\n const handleToggle = () => {\n if (group) {\n group.toggle(baseId);\n return;\n }\n\n const nextOpen = !isOpen;\n if (open === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n };\n\n const grouped = group !== null;\n const wrapped = !grouped && depth > 0;\n const variantClassName = grouped\n ? 'chayns-accordion--grouped'\n : wrapped\n ? 'chayns-accordion--wrapped'\n : 'chayns-accordion--standalone';\n\n const rootClassName = [\n 'chayns-accordion',\n variantClassName,\n isOpen ? 'chayns-accordion--open' : null,\n disabled ? 'chayns-accordion--disabled' : null,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={rootClassName}>\n <button\n aria-controls={panelId}\n aria-expanded={isOpen}\n className=\"chayns-accordion__header\"\n disabled={disabled}\n id={headerId}\n onClick={handleToggle}\n type=\"button\"\n >\n <i aria-hidden=\"true\" className=\"chayns-accordion__chevron far fa-chevron-right\" />\n <span className=\"chayns-accordion__title\">{title}</span>\n </button>\n <div\n aria-labelledby={headerId}\n className=\"chayns-accordion__panel\"\n id={panelId}\n role=\"region\"\n >\n <div className=\"chayns-accordion__inner\">\n <div className=\"chayns-accordion__content\">\n <AccordionDepthContext.Provider value={depth + 1}>\n {children}\n </AccordionDepthContext.Provider>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Accordion;\n"],"mappings":";;;;AAKA,IAAM,aAAa,EACjB,UACA,WACA,cAAc,OACd,WAAW,OACX,IACA,cACA,MACA,YACoB;CACpB,MAAM,QAAQ,WAAW,qBAAqB;CAC9C,MAAM,QAAQ,WAAW,qBAAqB;CAC9C,MAAM,cAAc,MAAM;CAC1B,MAAM,SAAS,MAAM;CACrB,MAAM,WAAW,GAAG,OAAO;CAC3B,MAAM,UAAU,GAAG,OAAO;CAE1B,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,WAAW;CAEpE,IAAI;CACJ,IAAI,OACF,SAAS,MAAM,OAAO,MAAM;MACvB,IAAI,SAAS,KAAA,GAClB,SAAS;MAET,SAAS;CAGX,MAAM,qBAAqB;EACzB,IAAI,OAAO;GACT,MAAM,OAAO,MAAM;GACnB;EACF;EAEA,MAAM,WAAW,CAAC;EAClB,IAAI,SAAS,KAAA,GAAW,oBAAoB,QAAQ;EACpD,eAAe,QAAQ;CACzB;CAEA,MAAM,UAAU,UAAU;CAQ1B,MAAM,gBAAgB;EACpB;EAPuB,UACrB,8BAFY,CAAC,WAAW,QAAQ,IAI9B,8BACA;EAKJ,SAAS,2BAA2B;EACpC,WAAW,+BAA+B;EAC1C;CACF,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,qBAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACE,qBAAC,UAAD;GACE,iBAAe;GACf,iBAAe;GACf,WAAU;GACA;GACV,IAAI;GACJ,SAAS;GACT,MAAK;GAPP,UAAA,CASE,oBAAC,KAAD;IAAG,eAAY;IAAO,WAAU;GAAkD,CAAA,GAClF,oBAAC,QAAD;IAAM,WAAU;IAA2B,UAAA;GAAY,CAAA,CACjD;EACR,CAAA,GAAA,oBAAC,OAAD;GACE,mBAAiB;GACjB,WAAU;GACV,IAAI;GACJ,MAAK;
|
|
1
|
+
{"version":3,"file":"Accordion.js","names":[],"sources":["../../../src/components/accordion/Accordion.tsx"],"sourcesContent":["import { useContext, useId, useState } from 'react';\n\nimport { AccordionDepthContext, AccordionGroupContext } from './AccordionContext.js';\nimport type { AccordionProps } from './Accordion.types.js';\n\nconst Accordion = ({\n children,\n className,\n defaultOpen = false,\n disabled = false,\n id,\n onOpenChange,\n open,\n title,\n}: AccordionProps) => {\n const depth = useContext(AccordionDepthContext);\n const group = useContext(AccordionGroupContext);\n const generatedId = useId();\n const baseId = id ?? generatedId;\n const headerId = `${baseId}-header`;\n const panelId = `${baseId}-panel`;\n\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n\n let isOpen: boolean;\n if (group) {\n isOpen = group.isOpen(baseId);\n } else if (open !== undefined) {\n isOpen = open;\n } else {\n isOpen = uncontrolledOpen;\n }\n\n const handleToggle = () => {\n if (group) {\n group.toggle(baseId);\n return;\n }\n\n const nextOpen = !isOpen;\n if (open === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n };\n\n const grouped = group !== null;\n const wrapped = !grouped && depth > 0;\n const variantClassName = grouped\n ? 'chayns-accordion--grouped'\n : wrapped\n ? 'chayns-accordion--wrapped'\n : 'chayns-accordion--standalone';\n\n const rootClassName = [\n 'chayns-accordion',\n variantClassName,\n isOpen ? 'chayns-accordion--open' : null,\n disabled ? 'chayns-accordion--disabled' : null,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={rootClassName}>\n <button\n aria-controls={panelId}\n aria-expanded={isOpen}\n className=\"chayns-accordion__header\"\n disabled={disabled}\n id={headerId}\n onClick={handleToggle}\n type=\"button\"\n >\n <i aria-hidden=\"true\" className=\"chayns-accordion__chevron far fa-chevron-right\" />\n <span className=\"chayns-accordion__title\">{title}</span>\n </button>\n <div\n aria-hidden={!isOpen}\n aria-labelledby={headerId}\n className=\"chayns-accordion__panel\"\n id={panelId}\n inert={!isOpen}\n role=\"region\"\n style={{ gridTemplateRows: isOpen ? '1fr' : '0fr' }}\n >\n <div className=\"chayns-accordion__inner\">\n <div className=\"chayns-accordion__content\">\n <AccordionDepthContext.Provider value={depth + 1}>\n {children}\n </AccordionDepthContext.Provider>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default Accordion;\n"],"mappings":";;;;AAKA,IAAM,aAAa,EACjB,UACA,WACA,cAAc,OACd,WAAW,OACX,IACA,cACA,MACA,YACoB;CACpB,MAAM,QAAQ,WAAW,qBAAqB;CAC9C,MAAM,QAAQ,WAAW,qBAAqB;CAC9C,MAAM,cAAc,MAAM;CAC1B,MAAM,SAAS,MAAM;CACrB,MAAM,WAAW,GAAG,OAAO;CAC3B,MAAM,UAAU,GAAG,OAAO;CAE1B,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,WAAW;CAEpE,IAAI;CACJ,IAAI,OACF,SAAS,MAAM,OAAO,MAAM;MACvB,IAAI,SAAS,KAAA,GAClB,SAAS;MAET,SAAS;CAGX,MAAM,qBAAqB;EACzB,IAAI,OAAO;GACT,MAAM,OAAO,MAAM;GACnB;EACF;EAEA,MAAM,WAAW,CAAC;EAClB,IAAI,SAAS,KAAA,GAAW,oBAAoB,QAAQ;EACpD,eAAe,QAAQ;CACzB;CAEA,MAAM,UAAU,UAAU;CAQ1B,MAAM,gBAAgB;EACpB;EAPuB,UACrB,8BAFY,CAAC,WAAW,QAAQ,IAI9B,8BACA;EAKJ,SAAS,2BAA2B;EACpC,WAAW,+BAA+B;EAC1C;CACF,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,qBAAC,OAAD;EAAK,WAAW;EAAhB,UAAA,CACE,qBAAC,UAAD;GACE,iBAAe;GACf,iBAAe;GACf,WAAU;GACA;GACV,IAAI;GACJ,SAAS;GACT,MAAK;GAPP,UAAA,CASE,oBAAC,KAAD;IAAG,eAAY;IAAO,WAAU;GAAkD,CAAA,GAClF,oBAAC,QAAD;IAAM,WAAU;IAA2B,UAAA;GAAY,CAAA,CACjD;EACR,CAAA,GAAA,oBAAC,OAAD;GACE,eAAa,CAAC;GACd,mBAAiB;GACjB,WAAU;GACV,IAAI;GACJ,OAAO,CAAC;GACR,MAAK;GACL,OAAO,EAAE,kBAAkB,SAAS,QAAQ,MAAM;GAElD,UAAA,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,oBAAC,OAAD;KAAK,WAAU;KACb,UAAA,oBAAC,sBAAsB,UAAvB;MAAgC,OAAO,QAAQ;MAC5C;KAC6B,CAAA;IAC7B,CAAA;GACF,CAAA;EACF,CAAA,CACF;;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,iBAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,EAAE,aAAa,+BAUtE;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/checkbox/Checkbox.tsx
|
|
3
|
+
function Checkbox({ children, className, ...inputProps }) {
|
|
4
|
+
const inputClassName = ["chayns-checkbox__input", className].filter(Boolean).join(" ");
|
|
5
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
6
|
+
className: "chayns-checkbox",
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ jsx("input", {
|
|
9
|
+
...inputProps,
|
|
10
|
+
className: inputClassName,
|
|
11
|
+
type: "checkbox"
|
|
12
|
+
}),
|
|
13
|
+
/* @__PURE__ */ jsx("span", {
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
className: "chayns-checkbox__control"
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "chayns-checkbox__label",
|
|
19
|
+
children
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Checkbox as default };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.js","names":[],"sources":["../../../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["import type { CheckboxProps } from './Checkbox.types.js';\n\nfunction Checkbox({ children, className, ...inputProps }: CheckboxProps) {\n const inputClassName = ['chayns-checkbox__input', className].filter(Boolean).join(' ');\n\n return (\n <label className=\"chayns-checkbox\">\n <input {...inputProps} className={inputClassName} type=\"checkbox\" />\n <span aria-hidden=\"true\" className=\"chayns-checkbox__control\" />\n <span className=\"chayns-checkbox__label\">{children}</span>\n </label>\n );\n}\n\nexport default Checkbox;\n"],"mappings":";;AAEA,SAAS,SAAS,EAAE,UAAU,WAAW,GAAG,cAA6B;CACvE,MAAM,iBAAiB,CAAC,0BAA0B,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAErF,OACE,qBAAC,SAAD;EAAO,WAAU;EAAjB,UAAA;GACE,oBAAC,SAAD;IAAO,GAAI;IAAY,WAAW;IAAgB,MAAK;GAAY,CAAA;GACnE,oBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;GAA4B,CAAA;GAC/D,oBAAC,QAAD;IAAM,WAAU;IAA0B;GAAe,CAAA;EACpD;;AAEX"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
/** Props for a visible-label native checkbox. */
|
|
3
|
+
export interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'children' | 'type'> {
|
|
4
|
+
/** Visible, localized label associated with the native checkbox. */
|
|
5
|
+
children: Exclude<ReactNode, boolean | null | undefined>;
|
|
6
|
+
/** Checkbox owns its native input type. */
|
|
7
|
+
type?: never;
|
|
8
|
+
}
|
|
9
|
+
//# 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,iDAAiD;AACjD,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC9F,oEAAoE;IACpE,QAAQ,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAEzD,2CAA2C;IAC3C,IAAI,CAAC,EAAE,KAAK,CAAC;CACd"}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare
|
|
1
|
+
import type { ListItemActionProps, ListItemPartProps, ListItemStatusProps } from './List.types.js';
|
|
2
|
+
declare function Action(props: ListItemActionProps): import("react").JSX.Element;
|
|
3
|
+
declare function Status({ label }: ListItemStatusProps): import("react").JSX.Element;
|
|
4
|
+
declare const List: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>> & {
|
|
5
|
+
Item: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>> & {
|
|
6
|
+
Action: typeof Action;
|
|
7
|
+
Body: ({ children, className: consumerClassName }: ListItemPartProps) => import("react").JSX.Element;
|
|
8
|
+
Description: ({ children, className: consumerClassName }: ListItemPartProps) => import("react").JSX.Element;
|
|
9
|
+
Leading: ({ children, className: consumerClassName }: ListItemPartProps) => import("react").JSX.Element;
|
|
10
|
+
Status: typeof Status;
|
|
11
|
+
Title: ({ children, className: consumerClassName }: ListItemPartProps) => import("react").JSX.Element;
|
|
12
|
+
Trailing: ({ children, className: consumerClassName }: ListItemPartProps) => import("react").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
3
15
|
export default List;
|
|
4
16
|
//# sourceMappingURL=List.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/components/list/List.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/components/list/List.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAEjB,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AAkBzB,iBAAS,MAAM,CAAC,KAAK,EAAE,mBAAmB,+BAsBzC;AAaD,iBAAS,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,+BAS7C;AAiBD,QAAA,MAAM,IAAI;;;2DAlCiE,iBAAiB;kEAAjB,iBAAiB;8DAAjB,iBAAiB;;4DAAjB,iBAAiB;+DAAjB,iBAAiB;;CA4C1F,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -1,13 +1,86 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListContext, ListItemContext, useListContext, useListItemContext } from "./ListContext.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
2
4
|
//#region src/components/list/List.tsx
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
var Item = forwardRef(function Item({ children, className, ...itemProps }, ref) {
|
|
6
|
+
useListContext();
|
|
7
|
+
const resolvedClassName = ["chayns-list-item", className].filter(Boolean).join(" ");
|
|
8
|
+
return /* @__PURE__ */ jsx(ListItemContext.Provider, {
|
|
9
|
+
value: true,
|
|
10
|
+
children: /* @__PURE__ */ jsx("li", {
|
|
11
|
+
...itemProps,
|
|
12
|
+
className: resolvedClassName,
|
|
13
|
+
ref,
|
|
14
|
+
children
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
function Action(props) {
|
|
19
|
+
useListItemContext("Action");
|
|
20
|
+
if (props.href !== void 0) {
|
|
21
|
+
const { children, className, href, ...anchorProps } = props;
|
|
22
|
+
const resolvedClassName = ["chayns-list-item__action", className].filter(Boolean).join(" ");
|
|
23
|
+
return /* @__PURE__ */ jsx("a", {
|
|
24
|
+
...anchorProps,
|
|
25
|
+
className: resolvedClassName,
|
|
26
|
+
href,
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const { children, className, ...buttonProps } = props;
|
|
31
|
+
const resolvedClassName = ["chayns-list-item__action", className].filter(Boolean).join(" ");
|
|
32
|
+
return /* @__PURE__ */ jsx("button", {
|
|
33
|
+
...buttonProps,
|
|
7
34
|
className: resolvedClassName,
|
|
35
|
+
type: "button",
|
|
8
36
|
children
|
|
9
37
|
});
|
|
10
|
-
}
|
|
38
|
+
}
|
|
39
|
+
function createPart(name) {
|
|
40
|
+
const className = `chayns-list-item__${name.toLowerCase()}`;
|
|
41
|
+
return function ListItemPart({ children, className: consumerClassName }) {
|
|
42
|
+
useListItemContext(name);
|
|
43
|
+
const resolvedClassName = [className, consumerClassName].filter(Boolean).join(" ");
|
|
44
|
+
return /* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: resolvedClassName,
|
|
46
|
+
children
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function Status({ label }) {
|
|
51
|
+
useListItemContext("Status");
|
|
52
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
53
|
+
className: "chayns-list-item__status",
|
|
54
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
className: "chayns-list-item__status-dot"
|
|
57
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: "chayns-visually-hidden",
|
|
59
|
+
children: label
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
var ListRoot = forwardRef(function List({ children, className, ...listProps }, ref) {
|
|
64
|
+
const resolvedClassName = ["chayns-list", className].filter(Boolean).join(" ");
|
|
65
|
+
return /* @__PURE__ */ jsx(ListContext.Provider, {
|
|
66
|
+
value: true,
|
|
67
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
68
|
+
...listProps,
|
|
69
|
+
className: resolvedClassName,
|
|
70
|
+
ref,
|
|
71
|
+
children
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
var List = Object.assign(ListRoot, { Item: Object.assign(Item, {
|
|
76
|
+
Action,
|
|
77
|
+
Body: createPart("Body"),
|
|
78
|
+
Description: createPart("Description"),
|
|
79
|
+
Leading: createPart("Leading"),
|
|
80
|
+
Status,
|
|
81
|
+
Title: createPart("Title"),
|
|
82
|
+
Trailing: createPart("Trailing")
|
|
83
|
+
}) });
|
|
11
84
|
//#endregion
|
|
12
85
|
export { List as default };
|
|
13
86
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","names":[],"sources":["../../../src/components/list/List.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"List.js","names":[],"sources":["../../../src/components/list/List.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { ListContext, ListItemContext, useListContext, useListItemContext } from './ListContext.js';\nimport type {\n ListItemActionProps,\n ListItemPartProps,\n ListItemProps,\n ListItemStatusProps,\n ListProps,\n} from './List.types.js';\n\nconst Item = forwardRef<HTMLLIElement, ListItemProps>(function Item(\n { children, className, ...itemProps },\n ref,\n) {\n useListContext();\n const resolvedClassName = ['chayns-list-item', className].filter(Boolean).join(' ');\n\n return (\n <ListItemContext.Provider value>\n <li {...itemProps} className={resolvedClassName} ref={ref}>\n {children}\n </li>\n </ListItemContext.Provider>\n );\n});\n\nfunction Action(props: ListItemActionProps) {\n useListItemContext('Action');\n\n if (props.href !== undefined) {\n const { children, className, href, ...anchorProps } = props;\n const resolvedClassName = ['chayns-list-item__action', className].filter(Boolean).join(' ');\n\n return (\n <a {...anchorProps} className={resolvedClassName} href={href}>\n {children}\n </a>\n );\n }\n\n const { children, className, ...buttonProps } = props;\n const resolvedClassName = ['chayns-list-item__action', className].filter(Boolean).join(' ');\n\n return (\n <button {...buttonProps} className={resolvedClassName} type=\"button\">\n {children}\n </button>\n );\n}\n\nfunction createPart(name: 'Leading' | 'Body' | 'Title' | 'Description' | 'Trailing') {\n const className = `chayns-list-item__${name.toLowerCase()}`;\n\n return function ListItemPart({ children, className: consumerClassName }: ListItemPartProps) {\n useListItemContext(name);\n const resolvedClassName = [className, consumerClassName].filter(Boolean).join(' ');\n\n return <span className={resolvedClassName}>{children}</span>;\n };\n}\n\nfunction Status({ label }: ListItemStatusProps) {\n useListItemContext('Status');\n\n return (\n <span className=\"chayns-list-item__status\">\n <span aria-hidden=\"true\" className=\"chayns-list-item__status-dot\" />\n <span className=\"chayns-visually-hidden\">{label}</span>\n </span>\n );\n}\n\nconst ListRoot = forwardRef<HTMLUListElement, ListProps>(function List(\n { children, className, ...listProps },\n ref,\n) {\n const resolvedClassName = ['chayns-list', className].filter(Boolean).join(' ');\n\n return (\n <ListContext.Provider value>\n <ul {...listProps} className={resolvedClassName} ref={ref}>\n {children}\n </ul>\n </ListContext.Provider>\n );\n});\n\nconst List = Object.assign(ListRoot, {\n Item: Object.assign(Item, {\n Action,\n Body: createPart('Body'),\n Description: createPart('Description'),\n Leading: createPart('Leading'),\n Status,\n Title: createPart('Title'),\n Trailing: createPart('Trailing'),\n }),\n});\n\nexport default List;\n"],"mappings":";;;;AAWA,IAAM,OAAO,WAAyC,SAAS,KAC7D,EAAE,UAAU,WAAW,GAAG,aAC1B,KACA;CACA,eAAe;CACf,MAAM,oBAAoB,CAAC,oBAAoB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAElF,OACE,oBAAC,gBAAgB,UAAjB;EAA0B,OAAA;EACxB,UAAA,oBAAC,MAAD;GAAI,GAAI;GAAW,WAAW;GAAwB;GACnD;EACC,CAAA;CACoB,CAAA;AAE9B,CAAC;AAED,SAAS,OAAO,OAA4B;CAC1C,mBAAmB,QAAQ;CAE3B,IAAI,MAAM,SAAS,KAAA,GAAW;EAC5B,MAAM,EAAE,UAAU,WAAW,MAAM,GAAG,gBAAgB;EACtD,MAAM,oBAAoB,CAAC,4BAA4B,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAE1F,OACE,oBAAC,KAAD;GAAG,GAAI;GAAa,WAAW;GAAyB;GACrD;EACA,CAAA;CAEP;CAEA,MAAM,EAAE,UAAU,WAAW,GAAG,gBAAgB;CAChD,MAAM,oBAAoB,CAAC,4BAA4B,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAE1F,OACE,oBAAC,UAAD;EAAQ,GAAI;EAAa,WAAW;EAAmB,MAAK;EACzD;CACK,CAAA;AAEZ;AAEA,SAAS,WAAW,MAAiE;CACnF,MAAM,YAAY,qBAAqB,KAAK,YAAY;CAExD,OAAO,SAAS,aAAa,EAAE,UAAU,WAAW,qBAAwC;EAC1F,mBAAmB,IAAI;EACvB,MAAM,oBAAoB,CAAC,WAAW,iBAAiB,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAEjF,OAAO,oBAAC,QAAD;GAAM,WAAW;GAAoB;EAAe,CAAA;CAC7D;AACF;AAEA,SAAS,OAAO,EAAE,SAA8B;CAC9C,mBAAmB,QAAQ;CAE3B,OACE,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACE,oBAAC,QAAD;GAAM,eAAY;GAAO,WAAU;EAAgC,CAAA,GACnE,oBAAC,QAAD;GAAM,WAAU;GAA0B,UAAA;EAAY,CAAA,CAClD;;AAEV;AAEA,IAAM,WAAW,WAAwC,SAAS,KAChE,EAAE,UAAU,WAAW,GAAG,aAC1B,KACA;CACA,MAAM,oBAAoB,CAAC,eAAe,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAE7E,OACE,oBAAC,YAAY,UAAb;EAAsB,OAAA;EACpB,UAAA,oBAAC,MAAD;GAAI,GAAI;GAAW,WAAW;GAAwB;GACnD;EACC,CAAA;CACgB,CAAA;AAE1B,CAAC;AAED,IAAM,OAAO,OAAO,OAAO,UAAU,EACnC,MAAM,OAAO,OAAO,MAAM;CACxB;CACA,MAAM,WAAW,MAAM;CACvB,aAAa,WAAW,aAAa;CACrC,SAAS,WAAW,SAAS;CAC7B;CACA,OAAO,WAAW,OAAO;CACzB,UAAU,WAAW,UAAU;AACjC,CAAC,EACH,CAAC"}
|
|
@@ -1,80 +1,20 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* @description Props for a single list row, rendered as a navigation link
|
|
15
|
-
* when `href` is set or as an action button when `onClick` is set.
|
|
16
|
-
*/
|
|
17
|
-
export interface ListItemProps {
|
|
18
|
-
/**
|
|
19
|
-
* @description Primary single-line row label.
|
|
20
|
-
*/
|
|
21
|
-
title: ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* @description Optional secondary single-line preview text shown below
|
|
24
|
-
* `title`.
|
|
25
|
-
*/
|
|
26
|
-
subtitle?: ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* @description Optional leading slot, for example an `Avatar` or icon.
|
|
29
|
-
*/
|
|
30
|
-
leading?: ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* @description Optional trailing slot for row-level actions or metadata,
|
|
33
|
-
* freely composable as any `ReactNode`. Consumers render their own content
|
|
34
|
-
* here, including any future standard-content sub-components chayns UI
|
|
35
|
-
* provides for recurring trailing content.
|
|
36
|
-
*/
|
|
37
|
-
trailing?: ReactNode;
|
|
38
|
-
/**
|
|
39
|
-
* @description Shows an accent unread indicator.
|
|
40
|
-
* @default false
|
|
41
|
-
* @remarks Pending replacement per LIST-006 (CONFIRMED): this boolean
|
|
42
|
-
* contract is planned to be superseded by a generic, non-chat-specific
|
|
43
|
-
* status/accent indicator composed via `trailing`. The exact replacement
|
|
44
|
-
* component/prop name is not yet decided — do not assume a new prop name
|
|
45
|
-
* is already available.
|
|
46
|
-
*/
|
|
47
|
-
unread?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* @description Localized accessible name for the unread indicator. Required
|
|
50
|
-
* for the indicator to be perceivable by assistive technology; see the
|
|
51
|
-
* `unread` remarks regarding its planned replacement.
|
|
52
|
-
*/
|
|
53
|
-
unreadLabel?: string;
|
|
54
|
-
/**
|
|
55
|
-
* @description Renders the row as a navigation link (native `<a>`) with
|
|
56
|
-
* this destination. Mutually exclusive in practice with `onClick` — a row
|
|
57
|
-
* represents either navigation or an action, not both.
|
|
58
|
-
*/
|
|
59
|
-
href?: string;
|
|
60
|
-
/**
|
|
61
|
-
* @description Renders the row as an action button (native `<button>`)
|
|
62
|
-
* with this click handler.
|
|
63
|
-
*/
|
|
64
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
65
|
-
/**
|
|
66
|
-
* @description Disables the action button variant. Not applicable when the
|
|
67
|
-
* row renders as a navigation link.
|
|
68
|
-
* @default false
|
|
69
|
-
*/
|
|
70
|
-
disabled?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* @description Additional class names appended to the list item element.
|
|
73
|
-
*/
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
export type ListProps = ComponentPropsWithRef<'ul'>;
|
|
3
|
+
export type ListItemProps = ComponentPropsWithRef<'li'>;
|
|
4
|
+
export type ListItemActionProps = (Omit<ComponentPropsWithRef<'a'>, 'children'> & {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
href: string;
|
|
7
|
+
}) | (Omit<ComponentPropsWithRef<'button'>, 'children' | 'type'> & {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
href?: never;
|
|
10
|
+
type?: never;
|
|
11
|
+
});
|
|
12
|
+
export interface ListItemPartProps {
|
|
13
|
+
children: ReactNode;
|
|
74
14
|
className?: string;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
15
|
+
}
|
|
16
|
+
export interface ListItemStatusProps {
|
|
17
|
+
/** Localized description of the otherwise colour-only status dot. */
|
|
18
|
+
label: Exclude<ReactNode, boolean | null | undefined>;
|
|
79
19
|
}
|
|
80
20
|
//# sourceMappingURL=List.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.types.d.ts","sourceRoot":"","sources":["../../../src/components/list/List.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"List.types.d.ts","sourceRoot":"","sources":["../../../src/components/list/List.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,SAAS,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;AAExD,MAAM,MAAM,mBAAmB,GAC3B,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GACtF,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IAC5D,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CAAC,CAAC;AAEP,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const ListContext: import("react").Context<boolean>;
|
|
2
|
+
declare const ListItemContext: import("react").Context<boolean>;
|
|
3
|
+
declare function useListContext(): void;
|
|
4
|
+
declare function useListItemContext(part: string): void;
|
|
5
|
+
export { ListContext, ListItemContext, useListContext, useListItemContext };
|
|
6
|
+
//# sourceMappingURL=ListContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListContext.d.ts","sourceRoot":"","sources":["../../../src/components/list/ListContext.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW,kCAAuB,CAAC;AACzC,QAAA,MAAM,eAAe,kCAAuB,CAAC;AAE7C,iBAAS,cAAc,SAItB;AAED,iBAAS,kBAAkB,CAAC,IAAI,EAAE,MAAM,QAIvC;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
//#region src/components/list/ListContext.ts
|
|
3
|
+
var ListContext = createContext(false);
|
|
4
|
+
var ListItemContext = createContext(false);
|
|
5
|
+
function useListContext() {
|
|
6
|
+
if (!useContext(ListContext)) throw new Error("List.Item must be rendered within List.");
|
|
7
|
+
}
|
|
8
|
+
function useListItemContext(part) {
|
|
9
|
+
if (!useContext(ListItemContext)) throw new Error(`List.Item.${part} must be rendered within List.Item.`);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ListContext, ListItemContext, useListContext, useListItemContext };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=ListContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListContext.js","names":[],"sources":["../../../src/components/list/ListContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nconst ListContext = createContext(false);\nconst ListItemContext = createContext(false);\n\nfunction useListContext() {\n if (!useContext(ListContext)) {\n throw new Error('List.Item must be rendered within List.');\n }\n}\n\nfunction useListItemContext(part: string) {\n if (!useContext(ListItemContext)) {\n throw new Error(`List.Item.${part} must be rendered within List.Item.`);\n }\n}\n\nexport { ListContext, ListItemContext, useListContext, useListItemContext };\n"],"mappings":";;AAEA,IAAM,cAAc,cAAc,KAAK;AACvC,IAAM,kBAAkB,cAAc,KAAK;AAE3C,SAAS,iBAAiB;CACxB,IAAI,CAAC,WAAW,WAAW,GACzB,MAAM,IAAI,MAAM,yCAAyC;AAE7D;AAEA,SAAS,mBAAmB,MAAc;CACxC,IAAI,CAAC,WAAW,eAAe,GAC7B,MAAM,IAAI,MAAM,aAAa,KAAK,oCAAoC;AAE1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageBox.d.ts","sourceRoot":"","sources":["../../../src/components/message-box/MessageBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,iBAAS,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAgB,EAAE,GAAG,UAAU,EAAE,EAAE,eAAe,+BAU5F;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/message-box/MessageBox.tsx
|
|
3
|
+
function MessageBox({ children, className, tone = "neutral", ...asideProps }) {
|
|
4
|
+
const resolvedClassName = [
|
|
5
|
+
"chayns-message-box",
|
|
6
|
+
`chayns-message-box--${tone}`,
|
|
7
|
+
className
|
|
8
|
+
].filter(Boolean).join(" ");
|
|
9
|
+
return /* @__PURE__ */ jsx("aside", {
|
|
10
|
+
...asideProps,
|
|
11
|
+
className: resolvedClassName,
|
|
12
|
+
role: "note",
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { MessageBox as default };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=MessageBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageBox.js","names":[],"sources":["../../../src/components/message-box/MessageBox.tsx"],"sourcesContent":["import type { MessageBoxProps } from './MessageBox.types.js';\n\nfunction MessageBox({ children, className, tone = 'neutral', ...asideProps }: MessageBoxProps) {\n const resolvedClassName = ['chayns-message-box', `chayns-message-box--${tone}`, className]\n .filter(Boolean)\n .join(' ');\n\n return (\n <aside {...asideProps} className={resolvedClassName} role=\"note\">\n {children}\n </aside>\n );\n}\n\nexport default MessageBox;\n"],"mappings":";;AAEA,SAAS,WAAW,EAAE,UAAU,WAAW,OAAO,WAAW,GAAG,cAA+B;CAC7F,MAAM,oBAAoB;EAAC;EAAsB,uBAAuB;EAAQ;CAAS,CAAC,CACvF,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,oBAAC,SAAD;EAAO,GAAI;EAAY,WAAW;EAAmB,MAAK;EACvD;CACI,CAAA;AAEX"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
/** Supported static MessageBox presentations. */
|
|
3
|
+
export type MessageBoxTone = 'neutral' | 'admin' | 'warning';
|
|
4
|
+
/** Props for a static, freely composed aside note. */
|
|
5
|
+
export interface MessageBoxProps extends Omit<ComponentPropsWithRef<'aside'>, 'children' | 'role'> {
|
|
6
|
+
/** Surface presentation for the static note. */
|
|
7
|
+
tone?: MessageBoxTone;
|
|
8
|
+
/** Consumer-composed content such as title, text, icon and follow action. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** MessageBox owns its static note role. */
|
|
11
|
+
role?: never;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=MessageBox.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageBox.types.d.ts","sourceRoot":"","sources":["../../../src/components/message-box/MessageBox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7D,sDAAsD;AACtD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAChG,gDAAgD;IAChD,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,EAAE,SAAS,CAAC;IAEpB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,KAAK,CAAC;CACd"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type { PopupProps } from './Popup.types.js';
|
|
2
|
-
declare const
|
|
3
|
-
|
|
1
|
+
import type { PopupProps, PopupTriggerProps } from './Popup.types.js';
|
|
2
|
+
declare const _default: (({ children, closeOnEscape, closeOnOutsidePress, defaultOpen, onOpenChange, open, }: PopupProps) => import("react").JSX.Element) & {
|
|
3
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<PopupTriggerProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
4
7
|
//# sourceMappingURL=Popup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/popup/Popup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/popup/Popup.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAqB,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;8GAuFtF,UAAU;;;;AAkDb,wBAAyD"}
|