vector-prototype-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/Accordion/Accordion.js +79 -0
- package/Accordion/Accordion.js.map +1 -0
- package/Accordion/Accordion.module.css +1 -0
- package/Accordion/Accordion.module.css.js +36 -0
- package/Accordion/Accordion.module.css.js.map +1 -0
- package/ActionMenu/ActionMenu.js +49 -0
- package/ActionMenu/ActionMenu.js.map +1 -0
- package/ActionMenu/ActionMenu.module.css +1 -0
- package/ActionMenu/ActionMenu.module.css.js +16 -0
- package/ActionMenu/ActionMenu.module.css.js.map +1 -0
- package/Autocomplete/Autocomplete.js +226 -0
- package/Autocomplete/Autocomplete.js.map +1 -0
- package/Autocomplete/Autocomplete.module.css +1 -0
- package/Autocomplete/Autocomplete.module.css.js +46 -0
- package/Autocomplete/Autocomplete.module.css.js.map +1 -0
- package/Avatar/Avatar.js +66 -0
- package/Avatar/Avatar.js.map +1 -0
- package/Avatar/Avatar.module.css +1 -0
- package/Avatar/Avatar.module.css.js +26 -0
- package/Avatar/Avatar.module.css.js.map +1 -0
- package/Badge/Badge.js +40 -0
- package/Badge/Badge.js.map +1 -0
- package/Badge/Badge.module.css +1 -0
- package/Badge/Badge.module.css.js +24 -0
- package/Badge/Badge.module.css.js.map +1 -0
- package/BottomBar/BottomBar.js +19 -0
- package/BottomBar/BottomBar.js.map +1 -0
- package/BottomBar/BottomBar.module.css +1 -0
- package/BottomBar/BottomBar.module.css.js +10 -0
- package/BottomBar/BottomBar.module.css.js.map +1 -0
- package/Breadcrumbs/Breadcrumbs.js +40 -0
- package/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/Breadcrumbs/Breadcrumbs.module.css +1 -0
- package/Breadcrumbs/Breadcrumbs.module.css.js +18 -0
- package/Breadcrumbs/Breadcrumbs.module.css.js.map +1 -0
- package/Button/Button.js +53 -0
- package/Button/Button.js.map +1 -0
- package/Button/Button.module.css +1 -0
- package/Button/Button.module.css.js +24 -0
- package/Button/Button.module.css.js.map +1 -0
- package/Callout/Callout.js +66 -0
- package/Callout/Callout.js.map +1 -0
- package/Callout/Callout.module.css +1 -0
- package/Callout/Callout.module.css.js +28 -0
- package/Callout/Callout.module.css.js.map +1 -0
- package/Card/Card.js +39 -0
- package/Card/Card.js.map +1 -0
- package/Card/Card.module.css +1 -0
- package/Card/Card.module.css.js +18 -0
- package/Card/Card.module.css.js.map +1 -0
- package/Checkbox/Checkbox.js +90 -0
- package/Checkbox/Checkbox.js.map +1 -0
- package/Checkbox/Checkbox.module.css +1 -0
- package/Checkbox/Checkbox.module.css.js +22 -0
- package/Checkbox/Checkbox.module.css.js.map +1 -0
- package/Chip/Chip.js +62 -0
- package/Chip/Chip.js.map +1 -0
- package/Chip/Chip.module.css +1 -0
- package/Chip/Chip.module.css.js +24 -0
- package/Chip/Chip.module.css.js.map +1 -0
- package/DatePicker/DatePicker.js +157 -0
- package/DatePicker/DatePicker.js.map +1 -0
- package/DatePicker/DatePicker.module.css +1 -0
- package/DatePicker/DatePicker.module.css.js +48 -0
- package/DatePicker/DatePicker.module.css.js.map +1 -0
- package/DatePicker/DatePickerCalendar.js +94 -0
- package/DatePicker/DatePickerCalendar.js.map +1 -0
- package/DatePicker/DatePickerCalendar.module.css +1 -0
- package/DatePicker/DatePickerCalendar.module.css.js +32 -0
- package/DatePicker/DatePickerCalendar.module.css.js.map +1 -0
- package/Divider/Divider.js +22 -0
- package/Divider/Divider.js.map +1 -0
- package/Divider/Divider.module.css +1 -0
- package/Divider/Divider.module.css.js +12 -0
- package/Divider/Divider.module.css.js.map +1 -0
- package/Dropdown/Dropdown.js +100 -0
- package/Dropdown/Dropdown.js.map +1 -0
- package/Dropdown/Dropdown.module.css +1 -0
- package/Dropdown/Dropdown.module.css.js +20 -0
- package/Dropdown/Dropdown.module.css.js.map +1 -0
- package/Icon/Icon.js +8 -0
- package/Icon/Icon.js.map +1 -0
- package/IconButton/IconButton.js +42 -0
- package/IconButton/IconButton.js.map +1 -0
- package/IconButton/IconButton.module.css +1 -0
- package/IconButton/IconButton.module.css.js +20 -0
- package/IconButton/IconButton.module.css.js.map +1 -0
- package/InputNumber/InputNumber.js +106 -0
- package/InputNumber/InputNumber.js.map +1 -0
- package/InputNumber/InputNumber.module.css +1 -0
- package/InputNumber/InputNumber.module.css.js +30 -0
- package/InputNumber/InputNumber.module.css.js.map +1 -0
- package/Menu/Menu.js +182 -0
- package/Menu/Menu.js.map +1 -0
- package/Menu/Menu.module.css +1 -0
- package/Menu/Menu.module.css.js +56 -0
- package/Menu/Menu.module.css.js.map +1 -0
- package/Menu/menuData.js +188 -0
- package/Menu/menuData.js.map +1 -0
- package/Message/Message.js +88 -0
- package/Message/Message.js.map +1 -0
- package/Message/Message.module.css +1 -0
- package/Message/Message.module.css.js +32 -0
- package/Message/Message.module.css.js.map +1 -0
- package/Modal/Modal.js +186 -0
- package/Modal/Modal.js.map +1 -0
- package/Modal/Modal.module.css +1 -0
- package/Modal/Modal.module.css.js +44 -0
- package/Modal/Modal.module.css.js.map +1 -0
- package/Multiselect/Multiselect.js +249 -0
- package/Multiselect/Multiselect.js.map +1 -0
- package/Multiselect/Multiselect.module.css +1 -0
- package/Multiselect/Multiselect.module.css.js +64 -0
- package/Multiselect/Multiselect.module.css.js.map +1 -0
- package/Overlay/Overlay.js +18 -0
- package/Overlay/Overlay.js.map +1 -0
- package/Overlay/Overlay.module.css +1 -0
- package/Overlay/Overlay.module.css.js +8 -0
- package/Overlay/Overlay.module.css.js.map +1 -0
- package/Paginator/Paginator.js +118 -0
- package/Paginator/Paginator.js.map +1 -0
- package/Paginator/Paginator.module.css +1 -0
- package/Paginator/Paginator.module.css.js +22 -0
- package/Paginator/Paginator.module.css.js.map +1 -0
- package/Panel/Panel.js +38 -0
- package/Panel/Panel.js.map +1 -0
- package/Panel/Panel.module.css +1 -0
- package/Panel/Panel.module.css.js +16 -0
- package/Panel/Panel.module.css.js.map +1 -0
- package/ProgressSpinner/ProgressSpinner.js +64 -0
- package/ProgressSpinner/ProgressSpinner.js.map +1 -0
- package/ProgressSpinner/ProgressSpinner.module.css +1 -0
- package/ProgressSpinner/ProgressSpinner.module.css.js +16 -0
- package/ProgressSpinner/ProgressSpinner.module.css.js.map +1 -0
- package/Radio/Radio.js +44 -0
- package/Radio/Radio.js.map +1 -0
- package/Radio/Radio.module.css +1 -0
- package/Radio/Radio.module.css.js +18 -0
- package/Radio/Radio.module.css.js.map +1 -0
- package/SegmentControl/SegmentControl.js +74 -0
- package/SegmentControl/SegmentControl.js.map +1 -0
- package/SegmentControl/SegmentControl.module.css +1 -0
- package/SegmentControl/SegmentControl.module.css.js +16 -0
- package/SegmentControl/SegmentControl.module.css.js.map +1 -0
- package/Select/Select.js +153 -0
- package/Select/Select.js.map +1 -0
- package/Select/Select.module.css +1 -0
- package/Select/Select.module.css.js +46 -0
- package/Select/Select.module.css.js.map +1 -0
- package/Skeleton/Skeleton.js +78 -0
- package/Skeleton/Skeleton.js.map +1 -0
- package/Skeleton/Skeleton.module.css +1 -0
- package/Skeleton/Skeleton.module.css.js +18 -0
- package/Skeleton/Skeleton.module.css.js.map +1 -0
- package/Slider/Slider.js +116 -0
- package/Slider/Slider.js.map +1 -0
- package/Slider/Slider.module.css +1 -0
- package/Slider/Slider.module.css.js +24 -0
- package/Slider/Slider.module.css.js.map +1 -0
- package/Slot/Slot.js +25 -0
- package/Slot/Slot.js.map +1 -0
- package/Slot/Slot.module.css +1 -0
- package/Slot/Slot.module.css.js +16 -0
- package/Slot/Slot.module.css.js.map +1 -0
- package/Switch/Switch.js +42 -0
- package/Switch/Switch.js.map +1 -0
- package/Switch/Switch.module.css +1 -0
- package/Switch/Switch.module.css.js +11 -0
- package/Switch/Switch.module.css.js.map +1 -0
- package/Table/Table.js +268 -0
- package/Table/Table.js.map +1 -0
- package/Table/Table.module.css +1 -0
- package/Table/Table.module.css.js +64 -0
- package/Table/Table.module.css.js.map +1 -0
- package/TableTree/TableTree.js +139 -0
- package/TableTree/TableTree.js.map +1 -0
- package/TableTree/TableTree.module.css +1 -0
- package/TableTree/TableTree.module.css.js +62 -0
- package/TableTree/TableTree.module.css.js.map +1 -0
- package/Tabs/Tabs.js +92 -0
- package/Tabs/Tabs.js.map +1 -0
- package/Tabs/Tabs.module.css +1 -0
- package/Tabs/Tabs.module.css.js +18 -0
- package/Tabs/Tabs.module.css.js.map +1 -0
- package/Tag/Tag.js +48 -0
- package/Tag/Tag.js.map +1 -0
- package/Tag/Tag.module.css +1 -0
- package/Tag/Tag.module.css.js +30 -0
- package/Tag/Tag.module.css.js.map +1 -0
- package/TextField/TextField.js +93 -0
- package/TextField/TextField.js.map +1 -0
- package/TextField/TextField.module.css +1 -0
- package/TextField/TextField.module.css.js +36 -0
- package/TextField/TextField.module.css.js.map +1 -0
- package/Textarea/Textarea.js +52 -0
- package/Textarea/Textarea.js.map +1 -0
- package/Textarea/Textarea.module.css +1 -0
- package/Textarea/Textarea.module.css.js +32 -0
- package/Textarea/Textarea.module.css.js.map +1 -0
- package/Toast/Toast.js +82 -0
- package/Toast/Toast.js.map +1 -0
- package/Toast/Toast.module.css +1 -0
- package/Toast/Toast.module.css.js +28 -0
- package/Toast/Toast.module.css.js.map +1 -0
- package/Tooltip/Tooltip.js +61 -0
- package/Tooltip/Tooltip.js.map +1 -0
- package/Tooltip/Tooltip.module.css +1 -0
- package/Tooltip/Tooltip.module.css.js +26 -0
- package/Tooltip/Tooltip.module.css.js.map +1 -0
- package/TopBar/TopBar.js +87 -0
- package/TopBar/TopBar.js.map +1 -0
- package/TopBar/TopBar.module.css +1 -0
- package/TopBar/TopBar.module.css.js +30 -0
- package/TopBar/TopBar.module.css.js.map +1 -0
- package/index.js +90 -4157
- package/index.js.map +1 -1
- package/package.json +3 -4
- package/style.css +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import './Select.module.css';const e = "_selectWrapper_i9fx6_2", i = "_label_i9fx6_11", n = "_field_i9fx6_24", _ = "_sizeLarge_i9fx6_57", c = "_sizeMedium_i9fx6_61", s = "_sizeSmall_i9fx6_65", l = "_sizeXsmall_i9fx6_69", t = "_fieldError_i9fx6_79", a = "_fieldFocus_i9fx6_79", o = "_valueText_i9fx6_147", r = "_placeholder_i9fx6_160", f = "_caretIcon_i9fx6_166", x = "_caretIconOpen_i9fx6_175", d = "_leadingIcon_i9fx6_180", p = "_hint_i9fx6_189", u = "_hintDanger_i9fx6_200", h = "_hintSuccess_i9fx6_204", g = "_hintWarning_i9fx6_208", m = "_fieldWrapper_i9fx6_213", z = "_menuPanel_i9fx6_222", I = {
|
|
2
|
+
selectWrapper: e,
|
|
3
|
+
label: i,
|
|
4
|
+
field: n,
|
|
5
|
+
sizeLarge: _,
|
|
6
|
+
sizeMedium: c,
|
|
7
|
+
sizeSmall: s,
|
|
8
|
+
sizeXsmall: l,
|
|
9
|
+
fieldError: t,
|
|
10
|
+
fieldFocus: a,
|
|
11
|
+
valueText: o,
|
|
12
|
+
placeholder: r,
|
|
13
|
+
caretIcon: f,
|
|
14
|
+
caretIconOpen: x,
|
|
15
|
+
leadingIcon: d,
|
|
16
|
+
hint: p,
|
|
17
|
+
hintDanger: u,
|
|
18
|
+
hintSuccess: h,
|
|
19
|
+
hintWarning: g,
|
|
20
|
+
fieldWrapper: m,
|
|
21
|
+
menuPanel: z
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
f as caretIcon,
|
|
25
|
+
x as caretIconOpen,
|
|
26
|
+
I as default,
|
|
27
|
+
n as field,
|
|
28
|
+
t as fieldError,
|
|
29
|
+
a as fieldFocus,
|
|
30
|
+
m as fieldWrapper,
|
|
31
|
+
p as hint,
|
|
32
|
+
u as hintDanger,
|
|
33
|
+
h as hintSuccess,
|
|
34
|
+
g as hintWarning,
|
|
35
|
+
i as label,
|
|
36
|
+
d as leadingIcon,
|
|
37
|
+
z as menuPanel,
|
|
38
|
+
r as placeholder,
|
|
39
|
+
e as selectWrapper,
|
|
40
|
+
_ as sizeLarge,
|
|
41
|
+
c as sizeMedium,
|
|
42
|
+
s as sizeSmall,
|
|
43
|
+
l as sizeXsmall,
|
|
44
|
+
o as valueText
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=Select.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import n from "./Skeleton.module.css.js";
|
|
3
|
+
const p = {
|
|
4
|
+
text: n.text,
|
|
5
|
+
rect: n.rect,
|
|
6
|
+
circle: n.circle
|
|
7
|
+
};
|
|
8
|
+
function i(t) {
|
|
9
|
+
if (t != null)
|
|
10
|
+
return typeof t == "number" ? `${t}px` : t;
|
|
11
|
+
}
|
|
12
|
+
function m({
|
|
13
|
+
variant: t = "text",
|
|
14
|
+
width: o,
|
|
15
|
+
height: a,
|
|
16
|
+
radius: l,
|
|
17
|
+
animated: s = !0,
|
|
18
|
+
className: d,
|
|
19
|
+
style: u,
|
|
20
|
+
...h
|
|
21
|
+
}) {
|
|
22
|
+
const f = [
|
|
23
|
+
n.skeleton,
|
|
24
|
+
p[t],
|
|
25
|
+
s ? n.animated : void 0,
|
|
26
|
+
d
|
|
27
|
+
].filter(Boolean).join(" ");
|
|
28
|
+
let e = i(o), r = i(a);
|
|
29
|
+
t === "circle" && (e = e ?? r ?? "40px", r = r ?? e);
|
|
30
|
+
const x = {
|
|
31
|
+
width: e,
|
|
32
|
+
height: r,
|
|
33
|
+
borderRadius: i(l),
|
|
34
|
+
...u
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ c("span", { className: f, style: x, "aria-hidden": "true", ...h });
|
|
37
|
+
}
|
|
38
|
+
function g({
|
|
39
|
+
lines: t = 3,
|
|
40
|
+
lastLineWidth: o = "60%",
|
|
41
|
+
gap: a = 8,
|
|
42
|
+
animated: l = !0,
|
|
43
|
+
className: s,
|
|
44
|
+
style: d,
|
|
45
|
+
...u
|
|
46
|
+
}) {
|
|
47
|
+
const h = [n.textGroup, s].filter(Boolean).join(" ");
|
|
48
|
+
return /* @__PURE__ */ c(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: h,
|
|
52
|
+
style: { gap: i(a), ...d },
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
...u,
|
|
55
|
+
children: Array.from({ length: Math.max(0, t) }).map((f, e) => {
|
|
56
|
+
const r = e === t - 1 && t > 1;
|
|
57
|
+
return /* @__PURE__ */ c(
|
|
58
|
+
m,
|
|
59
|
+
{
|
|
60
|
+
variant: "text",
|
|
61
|
+
animated: l,
|
|
62
|
+
width: r ? o : "100%"
|
|
63
|
+
},
|
|
64
|
+
e
|
|
65
|
+
);
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
function A({ size: t = 40, ...o }) {
|
|
71
|
+
return /* @__PURE__ */ c(m, { variant: "circle", width: t, height: t, ...o });
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
m as Skeleton,
|
|
75
|
+
A as SkeletonAvatar,
|
|
76
|
+
g as SkeletonText
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.js","sources":["../../src/Skeleton/Skeleton.tsx"],"sourcesContent":["import React from 'react';\nimport styles from './Skeleton.module.css';\n\n/* ─── Base Skeleton ──────────────────────────────────────────── */\n\nexport type SkeletonVariant = 'text' | 'rect' | 'circle';\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Shape of the placeholder. */\n variant?: SkeletonVariant;\n /** Width — number (px) or any CSS length. Default comes from the variant. */\n width?: number | string;\n /** Height — number (px) or any CSS length. Default comes from the variant. */\n height?: number | string;\n /** Border-radius override — number (px) or any CSS length. */\n radius?: number | string;\n /** Whether to play the pulse animation (default true). */\n animated?: boolean;\n}\n\nconst VARIANT_CLASS: Record<SkeletonVariant, string> = {\n text: styles.text,\n rect: styles.rect,\n circle: styles.circle,\n};\n\nfunction toCssSize(value: number | string | undefined): string | undefined {\n if (value == null) return undefined;\n return typeof value === 'number' ? `${value}px` : value;\n}\n\n/**\n * Decorative loading placeholder. It is `aria-hidden` by default — mark the\n * surrounding region with `aria-busy=\"true\"` so assistive tech announces the\n * loading state instead of the empty boxes.\n */\nexport function Skeleton({\n variant = 'text',\n width,\n height,\n radius,\n animated = true,\n className,\n style,\n ...props\n}: SkeletonProps) {\n const cls = [\n styles.skeleton,\n VARIANT_CLASS[variant],\n animated ? styles.animated : undefined,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n let w = toCssSize(width);\n let h = toCssSize(height);\n // A circle is symmetric: if only one dimension is given, mirror it.\n if (variant === 'circle') {\n w = w ?? h ?? '40px';\n h = h ?? w;\n }\n\n const mergedStyle: React.CSSProperties = {\n width: w,\n height: h,\n borderRadius: toCssSize(radius),\n ...style,\n };\n\n return <span className={cls} style={mergedStyle} aria-hidden=\"true\" {...props} />;\n}\n\n/* ─── SkeletonText preset ────────────────────────────────────── */\n\nexport interface SkeletonTextProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Number of text lines to render (default 3). */\n lines?: number;\n /** Width of the last line — shorter looks more natural (default '60%'). */\n lastLineWidth?: number | string;\n /** Gap between lines — number (px) or any CSS length (default 8). */\n gap?: number | string;\n /** Whether to play the pulse animation (default true). */\n animated?: boolean;\n}\n\n/** Stacked text lines, with a shorter final line for a natural look. */\nexport function SkeletonText({\n lines = 3,\n lastLineWidth = '60%',\n gap = 8,\n animated = true,\n className,\n style,\n ...props\n}: SkeletonTextProps) {\n const cls = [styles.textGroup, className].filter(Boolean).join(' ');\n\n return (\n <div\n className={cls}\n style={{ gap: toCssSize(gap), ...style }}\n aria-hidden=\"true\"\n {...props}\n >\n {Array.from({ length: Math.max(0, lines) }).map((_, i) => {\n const isLast = i === lines - 1 && lines > 1;\n return (\n <Skeleton\n key={i}\n variant=\"text\"\n animated={animated}\n width={isLast ? lastLineWidth : '100%'}\n />\n );\n })}\n </div>\n );\n}\n\n/* ─── SkeletonAvatar preset ──────────────────────────────────── */\n\nexport interface SkeletonAvatarProps\n extends Omit<SkeletonProps, 'variant' | 'width' | 'height'> {\n /** Diameter — number (px) or any CSS length (default 40). */\n size?: number | string;\n}\n\n/** Circular placeholder for an avatar / profile image. */\nexport function SkeletonAvatar({ size = 40, ...rest }: SkeletonAvatarProps) {\n return <Skeleton variant=\"circle\" width={size} height={size} {...rest} />;\n}\n"],"names":["VARIANT_CLASS","styles","toCssSize","value","Skeleton","variant","width","height","radius","animated","className","style","props","cls","w","h","mergedStyle","jsx","SkeletonText","lines","lastLineWidth","gap","_","i","isLast","SkeletonAvatar","size","rest"],"mappings":";;AAoBA,MAAMA,IAAiD;AAAA,EACrD,MAAQC,EAAO;AAAA,EACf,MAAQA,EAAO;AAAA,EACf,QAAQA,EAAO;AACjB;AAEA,SAASC,EAAUC,GAAwD;AACzE,MAAIA,KAAS;AACb,WAAO,OAAOA,KAAU,WAAW,GAAGA,CAAK,OAAOA;AACpD;AAOO,SAASC,EAAS;AAAA,EACvB,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GAAkB;AAChB,QAAMC,IAAM;AAAA,IACVZ,EAAO;AAAA,IACPD,EAAcK,CAAO;AAAA,IACrBI,IAAWR,EAAO,WAAW;AAAA,IAC7BS;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,MAAII,IAAIZ,EAAUI,CAAK,GACnBS,IAAIb,EAAUK,CAAM;AAExB,EAAIF,MAAY,aACdS,IAAIA,KAAKC,KAAK,QACdA,IAAIA,KAAKD;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pa6_1{0%,to{opacity:1}50%{opacity:.45}}._skeleton_81pa6_13{display:block;flex-shrink:0;background-color:var(--color-fill-neutral-muted)}._animated_81pa6_19{animation:_skeleton-pulse_81pa6_1 1.4s ease-in-out infinite}._text_81pa6_24{width:100%;height:1em;border-radius:4px}._rect_81pa6_30{width:100%;height:16px;border-radius:8px}._circle_81pa6_36{border-radius:9999px}._textGroup_81pa6_41{display:flex;flex-direction:column;width:100%}@media (prefers-reduced-motion: reduce){._animated_81pa6_19{animation:none}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './Skeleton.module.css';const t = "_skeleton_81pa6_13", e = "_animated_81pa6_19", _ = "_text_81pa6_24", c = "_rect_81pa6_30", a = "_circle_81pa6_36", o = "_textGroup_81pa6_41", n = {
|
|
2
|
+
skeleton: t,
|
|
3
|
+
animated: e,
|
|
4
|
+
text: _,
|
|
5
|
+
rect: c,
|
|
6
|
+
circle: a,
|
|
7
|
+
textGroup: o
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
e as animated,
|
|
11
|
+
a as circle,
|
|
12
|
+
n as default,
|
|
13
|
+
c as rect,
|
|
14
|
+
t as skeleton,
|
|
15
|
+
_ as text,
|
|
16
|
+
o as textGroup
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=Skeleton.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/Slider/Slider.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import S, { useId as $, useCallback as h } from "react";
|
|
3
|
+
import { TextField as N } from "../TextField/TextField.js";
|
|
4
|
+
import e from "./Slider.module.css.js";
|
|
5
|
+
function z({
|
|
6
|
+
value: f,
|
|
7
|
+
defaultValue: y = 0,
|
|
8
|
+
min: a = 0,
|
|
9
|
+
max: l = 100,
|
|
10
|
+
step: u = 1,
|
|
11
|
+
showUpperFields: w = !1,
|
|
12
|
+
showBottomFields: M = !1,
|
|
13
|
+
disabled: c = !1,
|
|
14
|
+
"aria-label": j,
|
|
15
|
+
"aria-labelledby": k,
|
|
16
|
+
onChange: r,
|
|
17
|
+
className: I
|
|
18
|
+
}) {
|
|
19
|
+
const R = $(), i = f !== void 0, [V, m] = S.useState(y), d = i ? f : V, v = Math.min(
|
|
20
|
+
100,
|
|
21
|
+
Math.max(0, (d - a) / (l - a) * 100)
|
|
22
|
+
), x = h(
|
|
23
|
+
(o) => {
|
|
24
|
+
const s = Number(o.target.value);
|
|
25
|
+
i || m(s), r == null || r(s);
|
|
26
|
+
},
|
|
27
|
+
[i, r]
|
|
28
|
+
), F = h(
|
|
29
|
+
(o) => {
|
|
30
|
+
const s = o.target.value;
|
|
31
|
+
if (s === "") return;
|
|
32
|
+
const p = Math.min(l, Math.max(a, Number(s)));
|
|
33
|
+
i || m(p), r == null || r(p);
|
|
34
|
+
},
|
|
35
|
+
[i, a, l, r]
|
|
36
|
+
), L = [
|
|
37
|
+
e.slider,
|
|
38
|
+
c ? e.disabled : void 0,
|
|
39
|
+
I
|
|
40
|
+
].filter(Boolean).join(" "), b = /* @__PURE__ */ n("div", { className: e.fieldRow, children: [
|
|
41
|
+
/* @__PURE__ */ t("div", { className: e.field, children: /* @__PURE__ */ t(
|
|
42
|
+
N,
|
|
43
|
+
{
|
|
44
|
+
showLabel: !1,
|
|
45
|
+
type: "number",
|
|
46
|
+
value: d,
|
|
47
|
+
min: a,
|
|
48
|
+
max: l,
|
|
49
|
+
step: u,
|
|
50
|
+
disabled: c,
|
|
51
|
+
onChange: F,
|
|
52
|
+
"aria-label": "Minimum value",
|
|
53
|
+
placeholder: "0"
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ t("div", { className: e.field, children: /* @__PURE__ */ t(
|
|
57
|
+
N,
|
|
58
|
+
{
|
|
59
|
+
showLabel: !1,
|
|
60
|
+
type: "number",
|
|
61
|
+
value: l,
|
|
62
|
+
min: a,
|
|
63
|
+
max: l,
|
|
64
|
+
step: u,
|
|
65
|
+
disabled: c,
|
|
66
|
+
readOnly: !0,
|
|
67
|
+
"aria-label": "Maximum value",
|
|
68
|
+
placeholder: "0"
|
|
69
|
+
}
|
|
70
|
+
) })
|
|
71
|
+
] });
|
|
72
|
+
return /* @__PURE__ */ n("div", { className: L, children: [
|
|
73
|
+
w && b,
|
|
74
|
+
/* @__PURE__ */ n("div", { className: e.trackContainer, children: [
|
|
75
|
+
/* @__PURE__ */ t("div", { className: e.track, children: /* @__PURE__ */ t(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: e.range,
|
|
79
|
+
style: { width: `${v}%` }
|
|
80
|
+
}
|
|
81
|
+
) }),
|
|
82
|
+
/* @__PURE__ */ t(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: e.thumb,
|
|
86
|
+
style: { left: `${v}%` },
|
|
87
|
+
"aria-hidden": "true"
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ t(
|
|
91
|
+
"input",
|
|
92
|
+
{
|
|
93
|
+
id: R,
|
|
94
|
+
type: "range",
|
|
95
|
+
className: e.input,
|
|
96
|
+
min: a,
|
|
97
|
+
max: l,
|
|
98
|
+
step: u,
|
|
99
|
+
value: d,
|
|
100
|
+
disabled: c,
|
|
101
|
+
"aria-label": j,
|
|
102
|
+
"aria-labelledby": k,
|
|
103
|
+
"aria-valuemin": a,
|
|
104
|
+
"aria-valuemax": l,
|
|
105
|
+
"aria-valuenow": d,
|
|
106
|
+
onChange: x
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] }),
|
|
110
|
+
M && b
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
z as Slider
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=Slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.js","sources":["../../src/Slider/Slider.tsx"],"sourcesContent":["import React, { useId, useCallback } from 'react';\nimport { TextField } from '../TextField/index.js';\nimport styles from './Slider.module.css';\n\nexport interface SliderProps {\n /** Current value (controlled). */\n value?: number;\n /** Default value for uncontrolled usage. */\n defaultValue?: number;\n /** Minimum value. Defaults to 0. */\n min?: number;\n /** Maximum value. Defaults to 100. */\n max?: number;\n /** Step increment. Defaults to 1. */\n step?: number;\n /** Show numeric input fields above the track. */\n showUpperFields?: boolean;\n /** Show numeric input fields below the track. */\n showBottomFields?: boolean;\n /** Disabled state — opacity 0.5, not interactive. */\n disabled?: boolean;\n /** Accessible label for the slider. */\n 'aria-label'?: string;\n /** ID of an element that labels the slider. */\n 'aria-labelledby'?: string;\n /** Called when the value changes. */\n onChange?: (value: number) => void;\n /** Additional class name applied to the root wrapper. */\n className?: string;\n}\n\nexport function Slider({\n value,\n defaultValue = 0,\n min = 0,\n max = 100,\n step = 1,\n showUpperFields = false,\n showBottomFields = false,\n disabled = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n onChange,\n className,\n}: SliderProps) {\n const inputId = useId();\n const isControlled = value !== undefined;\n\n const [internalValue, setInternalValue] = React.useState<number>(defaultValue);\n const currentValue = isControlled ? value : internalValue;\n\n // Percentage along the track (0–100) for positioning thumb & range\n const percentage = Math.min(\n 100,\n Math.max(0, ((currentValue - min) / (max - min)) * 100)\n );\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const next = Number(e.target.value);\n if (!isControlled) setInternalValue(next);\n onChange?.(next);\n },\n [isControlled, onChange]\n );\n\n const handleFieldChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = e.target.value;\n if (raw === '') return;\n const clamped = Math.min(max, Math.max(min, Number(raw)));\n if (!isControlled) setInternalValue(clamped);\n onChange?.(clamped);\n },\n [isControlled, min, max, onChange]\n );\n\n const rootCls = [\n styles.slider,\n disabled ? styles.disabled : undefined,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const fieldRow = (\n <div className={styles.fieldRow}>\n <div className={styles.field}>\n <TextField\n showLabel={false}\n type=\"number\"\n value={currentValue}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n onChange={handleFieldChange}\n aria-label=\"Minimum value\"\n placeholder=\"0\"\n />\n </div>\n <div className={styles.field}>\n <TextField\n showLabel={false}\n type=\"number\"\n value={max}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n readOnly\n aria-label=\"Maximum value\"\n placeholder=\"0\"\n />\n </div>\n </div>\n );\n\n return (\n <div className={rootCls}>\n {showUpperFields && fieldRow}\n\n {/* Track container — provides 24px tall hit area */}\n <div className={styles.trackContainer}>\n {/* Background track */}\n <div className={styles.track}>\n {/* Filled range */}\n <div\n className={styles.range}\n style={{ width: `${percentage}%` }}\n />\n </div>\n\n {/* Draggable thumb positioned by percentage */}\n <div\n className={styles.thumb}\n style={{ left: `${percentage}%` }}\n aria-hidden=\"true\"\n />\n\n {/* Hidden native input — drives all interaction and accessibility */}\n <input\n id={inputId}\n type=\"range\"\n className={styles.input}\n min={min}\n max={max}\n step={step}\n value={currentValue}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={currentValue}\n onChange={handleChange}\n />\n </div>\n\n {showBottomFields && fieldRow}\n </div>\n );\n}\n"],"names":["Slider","value","defaultValue","min","max","step","showUpperFields","showBottomFields","disabled","ariaLabel","ariaLabelledby","onChange","className","inputId","useId","isControlled","internalValue","setInternalValue","React","currentValue","percentage","handleChange","useCallback","e","next","handleFieldChange","raw","clamped","rootCls","styles","fieldRow","jsxs","jsx","TextField"],"mappings":";;;;AA+BO,SAASA,EAAO;AAAA,EACrB,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,KAAAC,IAAM;AAAA,EACN,KAAAC,IAAM;AAAA,EACN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A,UACP,UAAAX;AAAA,UACA,cAAYC;AAAA,UACZ,mBAAiBC;AAAA,UACjB,iBAAeP;AAAA,UACf,iBAAeC;AAAA,UACf,iBAAee;AAAA,UACf,UAAUE;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ,GACF;AAAA,IAECd,KAAoBuB;AAAA,EAAA,GACvB;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._slider_1nq38_2{display:flex;flex-direction:column;gap:8px;width:100%;position:relative}._slider_1nq38_2._disabled_1nq38_11{opacity:.5;cursor:not-allowed;pointer-events:none}._fieldRow_1nq38_18{display:flex;align-items:center;justify-content:space-between;width:100%}._field_1nq38_18{display:flex;flex-direction:column;gap:4px;width:100px}._trackContainer_1nq38_35{position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;height:24px;width:100%;flex-shrink:0}._track_1nq38_35{position:relative;width:100%;height:4px;background-color:var(--color-fill-neutral-muted);border-radius:9999px;overflow:visible}._range_1nq38_57{position:absolute;top:0;left:0;height:4px;background-color:var(--color-fill-brand-default);border-radius:9999px}._input_1nq38_68{position:absolute;right:0;bottom:0;left:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;top:-10px;height:24px;-webkit-appearance:none;-moz-appearance:none;appearance:none}._thumb_1nq38_85{position:absolute;top:50%;transform:translate(-50%,-50%);width:24px;height:24px;border-radius:9999px;background-color:var(--color-canvas-neutral-white);border:7px solid var(--color-stroke-brand-default);box-sizing:border-box;pointer-events:none;flex-shrink:0;transition:box-shadow .12s ease}._trackContainer_1nq38_35:focus-within ._thumb_1nq38_85{box-shadow:var(--shadow-focus)}._trackContainer_1nq38_35:hover:not(._disabled_1nq38_11) ._thumb_1nq38_85{border-color:var(--color-stroke-interaction-brand-hover)}._trackContainer_1nq38_35:hover:not(._disabled_1nq38_11) ._range_1nq38_57{background-color:var(--color-fill-interaction-brand-hover)}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import './Slider.module.css';const n = "_slider_1nq38_2", t = "_disabled_1nq38_11", _ = "_fieldRow_1nq38_18", e = "_field_1nq38_18", s = "_trackContainer_1nq38_35", i = "_track_1nq38_35", a = "_range_1nq38_57", o = "_input_1nq38_68", c = "_thumb_1nq38_85", d = {
|
|
2
|
+
slider: n,
|
|
3
|
+
disabled: t,
|
|
4
|
+
fieldRow: _,
|
|
5
|
+
field: e,
|
|
6
|
+
trackContainer: s,
|
|
7
|
+
track: i,
|
|
8
|
+
range: a,
|
|
9
|
+
input: o,
|
|
10
|
+
thumb: c
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
d as default,
|
|
14
|
+
t as disabled,
|
|
15
|
+
e as field,
|
|
16
|
+
_ as fieldRow,
|
|
17
|
+
o as input,
|
|
18
|
+
a as range,
|
|
19
|
+
n as slider,
|
|
20
|
+
c as thumb,
|
|
21
|
+
i as track,
|
|
22
|
+
s as trackContainer
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Slider.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/Slot/Slot.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as s, jsxs as c, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { BoxArrowUp as d } from "@phosphor-icons/react";
|
|
3
|
+
import { Icon as f } from "../Icon/Icon.js";
|
|
4
|
+
import o from "./Slot.module.css.js";
|
|
5
|
+
function h({
|
|
6
|
+
children: t,
|
|
7
|
+
placeholderIcon: n,
|
|
8
|
+
placeholderLabel: r = "Slot",
|
|
9
|
+
className: e,
|
|
10
|
+
...i
|
|
11
|
+
}) {
|
|
12
|
+
const l = t == null || typeof t == "string" && t.trim() === "", m = n ?? d, a = [
|
|
13
|
+
o.slot,
|
|
14
|
+
l ? o.slotEmpty : o.slotFilled,
|
|
15
|
+
e
|
|
16
|
+
].filter(Boolean).join(" ");
|
|
17
|
+
return /* @__PURE__ */ s("div", { className: a, ...i, children: l ? /* @__PURE__ */ c(p, { children: [
|
|
18
|
+
/* @__PURE__ */ s("span", { className: o.iconBadge, "aria-hidden": "true", children: /* @__PURE__ */ s(f, { as: m, size: 16, weight: "bold" }) }),
|
|
19
|
+
/* @__PURE__ */ s("span", { className: o.label, children: r })
|
|
20
|
+
] }) : t });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
h as Slot
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Slot.js.map
|
package/Slot/Slot.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slot.js","sources":["../../src/Slot/Slot.tsx"],"sourcesContent":["import React from 'react';\nimport type { Icon as PhosphorIcon } from '@phosphor-icons/react';\nimport { BoxArrowUp } from '@phosphor-icons/react';\nimport { Icon } from '../Icon/index.js';\nimport styles from './Slot.module.css';\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Content to render inside the slot.\n * When provided, the placeholder indicator is hidden and children\n * fill the slot area directly.\n */\n children?: React.ReactNode;\n /**\n * Icon shown in the empty-state indicator badge.\n * Defaults to BoxArrowUp (matches the Figma Slot placeholder).\n */\n placeholderIcon?: PhosphorIcon;\n /**\n * Label shown next to the icon in the empty-state indicator.\n * Defaults to \"Slot\".\n */\n placeholderLabel?: string;\n}\n\nexport function Slot({\n children,\n placeholderIcon,\n placeholderLabel = 'Slot',\n className,\n ...props\n}: SlotProps) {\n const isEmpty = children == null || (typeof children === 'string' && children.trim() === '');\n const IconComponent = placeholderIcon ?? BoxArrowUp;\n\n const cls = [\n styles.slot,\n isEmpty ? styles.slotEmpty : styles.slotFilled,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={cls} {...props}>\n {isEmpty ? (\n <>\n <span className={styles.iconBadge} aria-hidden=\"true\">\n <Icon as={IconComponent} size={16} weight=\"bold\" />\n </span>\n <span className={styles.label}>{placeholderLabel}</span>\n </>\n ) : (\n children\n )}\n </div>\n );\n}\n"],"names":["Slot","children","placeholderIcon","placeholderLabel","className","props","isEmpty","IconComponent","BoxArrowUp","cls","styles","jsxs","Fragment","jsx","Icon"],"mappings":";;;;AAyBO,SAASA,EAAK;AAAA,EACnB,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,WAAAC;AAAA,EACA,GAAGC;AACL,GAAc;AACZ,QAAMC,IAAUL,KAAY,QAAS,OAAOA,KAAa,YAAYA,EAAS,WAAW,IACnFM,IAAgBL,KAAmBM,GAEnCC,IAAM;AAAA,IACVC,EAAO;AAAA,IACPJ,IAAUI,EAAO,YAAYA,EAAO;AAAA,IACpCN;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BACG,OAAA,EAAI,WAAWK,GAAM,GAAGJ,GACtB,cACC,gBAAAM,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWH,EAAO,WAAW,eAAY,QAC7C,UAAA,gBAAAG,EAACC,GAAA,EAAK,IAAIP,GAAe,MAAM,IAAI,QAAO,QAAO,GACnD;AAAA,IACA,gBAAAM,EAAC,QAAA,EAAK,WAAWH,EAAO,OAAQ,UAAAP,EAAA,CAAiB;AAAA,EAAA,EAAA,CACnD,IAEAF,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._slot_wse4n_8{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:240px;min-height:80px;width:100%;height:100%;position:relative;box-sizing:border-box}._slotEmpty_wse4n_25{background-color:#9747ff1a;border:1px dashed #9747ff}._iconBadge_wse4n_31{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:9999px;background-color:var(--color-canvas-neutral-white);color:#7e15e0;flex-shrink:0}._label_wse4n_44{font-family:var(--font-family-base, system-ui, sans-serif);font-size:var(--font-size-14);font-weight:var(--font-weight-semibold);line-height:var(--font-line-height-14);color:#7e15e0;white-space:nowrap}._slotFilled_wse4n_56{display:block;border:none;background-color:transparent;min-width:unset;min-height:unset;width:100%;height:auto}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './Slot.module.css';const l = "_slot_wse4n_8", s = "_slotEmpty_wse4n_25", t = "_iconBadge_wse4n_31", o = "_label_wse4n_44", e = "_slotFilled_wse4n_56", _ = {
|
|
2
|
+
slot: l,
|
|
3
|
+
slotEmpty: s,
|
|
4
|
+
iconBadge: t,
|
|
5
|
+
label: o,
|
|
6
|
+
slotFilled: e
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
_ as default,
|
|
10
|
+
t as iconBadge,
|
|
11
|
+
o as label,
|
|
12
|
+
l as slot,
|
|
13
|
+
s as slotEmpty,
|
|
14
|
+
e as slotFilled
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Slot.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slot.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/Switch/Switch.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as b, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import j, { useId as w } from "react";
|
|
3
|
+
import t from "./Switch.module.css.js";
|
|
4
|
+
function S({
|
|
5
|
+
checked: c,
|
|
6
|
+
defaultChecked: l = !1,
|
|
7
|
+
onChange: s,
|
|
8
|
+
label: i,
|
|
9
|
+
disabled: n,
|
|
10
|
+
className: d,
|
|
11
|
+
id: m,
|
|
12
|
+
...f
|
|
13
|
+
}) {
|
|
14
|
+
const [p, u] = j.useState(l), o = c !== void 0, r = o ? c : p, h = w(), k = m ?? h;
|
|
15
|
+
function x() {
|
|
16
|
+
const a = !r;
|
|
17
|
+
o || u(a), s == null || s(a);
|
|
18
|
+
}
|
|
19
|
+
const N = [t.switch, d].filter(Boolean).join(" ");
|
|
20
|
+
return /* @__PURE__ */ b(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
id: k,
|
|
24
|
+
type: "button",
|
|
25
|
+
role: "switch",
|
|
26
|
+
className: N,
|
|
27
|
+
"aria-checked": r,
|
|
28
|
+
"aria-disabled": n,
|
|
29
|
+
disabled: n,
|
|
30
|
+
onClick: x,
|
|
31
|
+
...f,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ e("span", { className: t.track, children: /* @__PURE__ */ e("span", { className: t.thumb }) }),
|
|
34
|
+
i && /* @__PURE__ */ e("span", { className: t.label, children: i })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
S as Switch
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../src/Switch/Switch.tsx"],"sourcesContent":["import React, { useId } from 'react';\nimport styles from './Switch.module.css';\n\nexport interface SwitchProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n /** Whether the switch is toggled on */\n checked?: boolean;\n /** Default checked state for uncontrolled usage */\n defaultChecked?: boolean;\n /** Callback when the user toggles the switch */\n onChange?: (checked: boolean) => void;\n /** Optional label text rendered beside the track */\n label?: string;\n}\n\nexport function Switch({\n checked,\n defaultChecked = false,\n onChange,\n label,\n disabled,\n className,\n id: idProp,\n ...props\n}: SwitchProps) {\n // Support both controlled and uncontrolled modes\n const [internalChecked, setInternalChecked] = React.useState(defaultChecked);\n const isControlled = checked !== undefined;\n const isChecked = isControlled ? checked : internalChecked;\n\n const generatedId = useId();\n const id = idProp ?? generatedId;\n\n function handleClick() {\n const next = !isChecked;\n if (!isControlled) {\n setInternalChecked(next);\n }\n onChange?.(next);\n }\n\n const cls = [styles.switch, className].filter(Boolean).join(' ');\n\n return (\n <button\n id={id}\n type=\"button\"\n role=\"switch\"\n className={cls}\n aria-checked={isChecked}\n aria-disabled={disabled}\n disabled={disabled}\n onClick={handleClick}\n {...props}\n >\n <span className={styles.track}>\n <span className={styles.thumb} />\n </span>\n {label && <span className={styles.label}>{label}</span>}\n </button>\n );\n}\n"],"names":["Switch","checked","defaultChecked","onChange","label","disabled","className","idProp","props","internalChecked","setInternalChecked","React","isControlled","isChecked","generatedId","useId","id","handleClick","next","cls","styles","jsxs","jsx"],"mappings":";;;AAeO,SAASA,EAAO;AAAA,EACrB,SAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAIC;AAAA,EACJ,GAAGC;AACL,GAAgB;AAEd,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAM,SAAST,CAAc,GACrEU,IAAeX,MAAY,QAC3BY,IAAYD,IAAeX,IAAUQ,GAErCK,IAAcC,EAAA,GACdC,IAAKT,KAAUO;AAErB,WAASG,IAAc;AACrB,UAAMC,IAAO,CAACL;AACd,IAAKD,KACHF,EAAmBQ,CAAI,GAEzBf,KAAA,QAAAA,EAAWe;AAAA,EACb;AAEA,QAAMC,IAAM,CAACC,EAAO,QAAQd,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE/D,SACE,gBAAAe;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAAL;AAAA,MACA,MAAK;AAAA,MACL,MAAK;AAAA,MACL,WAAWG;AAAA,MACX,gBAAcN;AAAA,MACd,iBAAeR;AAAA,MACf,UAAAA;AAAA,MACA,SAASY;AAAA,MACR,GAAGT;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAc,EAAC,QAAA,EAAK,WAAWF,EAAO,OACtB,4BAAC,QAAA,EAAK,WAAWA,EAAO,MAAA,CAAO,EAAA,CACjC;AAAA,QACChB,KAAS,gBAAAkB,EAAC,QAAA,EAAK,WAAWF,EAAO,OAAQ,UAAAhB,EAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGtD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._switch_1w8fg_17{display:inline-flex;align-items:center;gap:8px;background:none;border:none;padding:0;cursor:pointer;font-family:var(--font-family-base, system-ui, sans-serif);font-size:var(--font-size-14);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-14);color:var(--color-text-neutral-mudle);transition:opacity .12s ease}._switch_1w8fg_17:focus-visible{outline:none}._switch_1w8fg_17:focus-visible ._track_1w8fg_38{box-shadow:var(--shadow-focus)}._switch_1w8fg_17:disabled,._switch_1w8fg_17[aria-disabled=true]{opacity:.5;cursor:not-allowed;pointer-events:none}._track_1w8fg_38{position:relative;display:flex;align-items:center;width:36px;height:24px;border-radius:100px;flex-shrink:0;background-color:var(--color-fill-neutral-muted);transition:background-color .12s ease,box-shadow .12s ease}._thumb_1w8fg_66{position:absolute;left:0;width:24px;height:24px;box-sizing:border-box;border-radius:50%;background-color:var(--color-canvas-neutral-white);border:4px solid var(--color-stroke-neutral-default);transition:left .12s ease,border-color .12s ease}._switch_1w8fg_17:hover:not(:disabled) ._track_1w8fg_38{background-color:var(--color-fill-interaction-neutral-muted-hover)}._switch_1w8fg_17:hover:not(:disabled) ._thumb_1w8fg_66{border-color:var(--color-stroke-interaction-neutral-hover)}._switch_1w8fg_17[aria-checked=true] ._track_1w8fg_38{background-color:var(--color-fill-brand-default)}._switch_1w8fg_17[aria-checked=true] ._thumb_1w8fg_66{left:12px;border-color:var(--color-stroke-brand-default)}._switch_1w8fg_17[aria-checked=true]:hover:not(:disabled) ._track_1w8fg_38{background-color:var(--color-fill-interaction-brand-hover)}._switch_1w8fg_17[aria-checked=true]:hover:not(:disabled) ._thumb_1w8fg_66{border-color:var(--color-stroke-interaction-brand-hover)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|