@lazar-ui/kit 0.1.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 +182 -0
- package/dist/Overlay-RmiBtqDR.mjs +1011 -0
- package/dist/accordion.css +1 -0
- package/dist/accordion.d.ts +53 -0
- package/dist/accordion.js +48 -0
- package/dist/alert.css +1 -0
- package/dist/alert.d.ts +33 -0
- package/dist/alert.js +20 -0
- package/dist/avatar.css +1 -0
- package/dist/avatar.d.ts +34 -0
- package/dist/avatar.js +41 -0
- package/dist/badge.css +1 -0
- package/dist/badge.d.ts +33 -0
- package/dist/badge.js +23 -0
- package/dist/breadcrumbs.css +1 -0
- package/dist/breadcrumbs.d.ts +80 -0
- package/dist/breadcrumbs.js +63 -0
- package/dist/button.css +1 -0
- package/dist/button.d.ts +66 -0
- package/dist/button.js +46 -0
- package/dist/camelCase-PtIYufW8.mjs +528 -0
- package/dist/card.css +1 -0
- package/dist/card.d.ts +42 -0
- package/dist/card.js +24 -0
- package/dist/checkbox.css +1 -0
- package/dist/checkbox.d.ts +41 -0
- package/dist/checkbox.js +42 -0
- package/dist/clsx-OuTLNxxd.mjs +16 -0
- package/dist/config-provider.d.ts +78 -0
- package/dist/config-provider.js +14 -0
- package/dist/css/palettes/indigo.css +104 -0
- package/dist/css/palettes/monochrome.css +104 -0
- package/dist/css/semantic.css +113 -0
- package/dist/dialog.css +1 -0
- package/dist/dialog.d.ts +91 -0
- package/dist/dialog.js +75 -0
- package/dist/drawer.css +1 -0
- package/dist/drawer.d.ts +128 -0
- package/dist/drawer.js +106 -0
- package/dist/empty-state.css +1 -0
- package/dist/empty-state.d.ts +33 -0
- package/dist/empty-state.js +52 -0
- package/dist/error-boundary.css +1 -0
- package/dist/error-boundary.d.ts +55 -0
- package/dist/error-boundary.js +37 -0
- package/dist/flex.css +1 -0
- package/dist/flex.d.ts +68 -0
- package/dist/flex.js +73 -0
- package/dist/form-field.css +1 -0
- package/dist/form-field.d.ts +27 -0
- package/dist/form-field.js +22 -0
- package/dist/getComponentSlots-DwAYUFNk.mjs +16 -0
- package/dist/getVariantClassName-D7Nhpuec.mjs +8 -0
- package/dist/input.css +1 -0
- package/dist/input.d.ts +39 -0
- package/dist/input.js +146 -0
- package/dist/isValidReactNode-CmYwTWCE.mjs +18 -0
- package/dist/menu.css +1 -0
- package/dist/menu.d.ts +94 -0
- package/dist/menu.js +135 -0
- package/dist/pagination.css +1 -0
- package/dist/pagination.d.ts +40 -0
- package/dist/pagination.js +74 -0
- package/dist/popover.css +1 -0
- package/dist/popover.d.ts +54 -0
- package/dist/popover.js +65 -0
- package/dist/select.css +1 -0
- package/dist/select.d.ts +64 -0
- package/dist/select.js +170 -0
- package/dist/separator.css +1 -0
- package/dist/separator.d.ts +25 -0
- package/dist/separator.js +24 -0
- package/dist/skeleton.css +1 -0
- package/dist/skeleton.d.ts +38 -0
- package/dist/skeleton.js +27 -0
- package/dist/spinner.css +1 -0
- package/dist/spinner.d.ts +31 -0
- package/dist/spinner.js +29 -0
- package/dist/switch.css +1 -0
- package/dist/switch.d.ts +44 -0
- package/dist/switch.js +37 -0
- package/dist/table.css +1 -0
- package/dist/table.d.ts +60 -0
- package/dist/table.js +40 -0
- package/dist/tabs.css +1 -0
- package/dist/tabs.d.ts +69 -0
- package/dist/tabs.js +79 -0
- package/dist/textarea.css +1 -0
- package/dist/textarea.d.ts +53 -0
- package/dist/textarea.js +46 -0
- package/dist/tooltip.css +1 -0
- package/dist/tooltip.d.ts +38 -0
- package/dist/tooltip.js +99 -0
- package/dist/useLocale-D2Z0JH0l.mjs +70 -0
- package/dist/useModalOverlay-D5Bs9FCB.mjs +486 -0
- package/dist/useOverlayPosition-DVu1Qziq.mjs +451 -0
- package/dist/useOverlayTriggerState-BIo1Jcba.mjs +221 -0
- package/dist/utils.d.ts +58 -0
- package/dist/utils.js +18 -0
- package/package.json +76 -0
package/dist/popover.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as C, useContext as R, useRef as d } from "react";
|
|
3
|
+
import { c as T } from "./clsx-OuTLNxxd.mjs";
|
|
4
|
+
import { r as h } from "./Overlay-RmiBtqDR.mjs";
|
|
5
|
+
import { $ as N, a as O } from "./useOverlayTriggerState-BIo1Jcba.mjs";
|
|
6
|
+
import { $ as _ } from "./useOverlayPosition-DVu1Qziq.mjs";
|
|
7
|
+
import './popover.css';const f = C(null), y = f.Provider, m = () => {
|
|
8
|
+
const e = R(f);
|
|
9
|
+
if (!e)
|
|
10
|
+
throw new Error("Sub-component must be used within a Popover");
|
|
11
|
+
return e;
|
|
12
|
+
}, p = "Popover", E = 4;
|
|
13
|
+
var i = ((e) => (e.TRIGGER = `${p}.Trigger`, e.CONTENT = `${p}.Content`, e))(i || {});
|
|
14
|
+
const F = "_content_qcofp_10", G = "_noPadding_qcofp_32", l = {
|
|
15
|
+
content: F,
|
|
16
|
+
noPadding: G
|
|
17
|
+
}, u = (e) => {
|
|
18
|
+
const { children: t, padding: n = !0 } = e, { triggerRef: o, state: r, placement: c } = m(), s = d(null), { overlayProps: $, placement: v } = _({
|
|
19
|
+
offset: E,
|
|
20
|
+
overlayRef: s,
|
|
21
|
+
placement: c,
|
|
22
|
+
shouldFlip: !0,
|
|
23
|
+
targetRef: o
|
|
24
|
+
}), { overlayProps: x } = N(
|
|
25
|
+
{
|
|
26
|
+
isDismissable: !0,
|
|
27
|
+
isOpen: r.isOpen,
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
29
|
+
onClose: r.close
|
|
30
|
+
},
|
|
31
|
+
s
|
|
32
|
+
);
|
|
33
|
+
return r.isOpen ? /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: T(l.content, !n && l.noPadding),
|
|
37
|
+
"data-placement": v,
|
|
38
|
+
ref: s,
|
|
39
|
+
...$,
|
|
40
|
+
...x,
|
|
41
|
+
children: t
|
|
42
|
+
}
|
|
43
|
+
) }) : null;
|
|
44
|
+
};
|
|
45
|
+
u.displayName = i.CONTENT;
|
|
46
|
+
const g = (e) => {
|
|
47
|
+
const { children: t, open: n, onOpenChange: o, placement: r = "bottom" } = e, c = d(null), s = O({ isOpen: n, onOpenChange: o });
|
|
48
|
+
return /* @__PURE__ */ a(y, { value: { placement: r, state: s, triggerRef: c }, children: t });
|
|
49
|
+
};
|
|
50
|
+
g.displayName = p;
|
|
51
|
+
const P = (e) => {
|
|
52
|
+
const { children: t } = e, { triggerRef: n, state: o } = m();
|
|
53
|
+
return (
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
55
|
+
/* @__PURE__ */ a("span", { "aria-expanded": o.isOpen, "aria-haspopup": "true", onClick: o.toggle, ref: n, children: t })
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
P.displayName = i.TRIGGER;
|
|
59
|
+
const b = g;
|
|
60
|
+
b.Trigger = P;
|
|
61
|
+
b.Content = u;
|
|
62
|
+
export {
|
|
63
|
+
b as Popover,
|
|
64
|
+
m as usePopoverContext
|
|
65
|
+
};
|
package/dist/select.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";:root{--select-radius: var(--radius-2);--select-min-height: 36px}._root_1howi_7{align-items:center;background:var(--color-background-primary);border:1px solid var(--color-border-primary);border-radius:var(--select-radius);cursor:pointer;display:inline-flex;gap:var(--space-2);justify-content:space-between;min-height:var(--select-min-height);outline:none;padding:0 var(--space-3);transition:border-color .15s ease;-webkit-user-select:none;user-select:none;white-space:nowrap}._root_1howi_7:focus-visible{border-color:var(--color-border-focus);box-shadow:0 0 0 2px color-mix(in sRGB,var(--color-border-focus) 20%,transparent)}._disabled_1howi_28{background:var(--color-background-disabled);border-color:var(--color-border-disabled);color:var(--color-text-disabled);cursor:not-allowed}._invalid_1howi_35{border-color:var(--color-background-error)}._sizeSm_1howi_39{font-size:var(--font-size-sm);min-height:28px;padding:0 var(--space-2)}._sizeMd_1howi_45{font-size:var(--font-size-md);min-height:36px;padding:0 var(--space-3)}._sizeLg_1howi_51{font-size:var(--font-size-lg);min-height:44px;padding:0 var(--space-4)}._displayText_1howi_57{color:var(--color-text-primary);flex:1;overflow:hidden;text-overflow:ellipsis}._displayTextPlaceholder_1howi_64{color:var(--color-text-tertiary)}._indicators_1howi_68{align-items:center;display:inline-flex;gap:var(--space-1)}._clearButton_1howi_74{align-items:center;background:none;border:none;color:var(--color-text-tertiary);cursor:pointer;display:inline-flex;font-size:var(--font-size-xs);height:16px;justify-content:center;line-height:1;padding:0;width:16px}._clearButton_1howi_74:hover{color:var(--color-text-secondary)}._chevron_1howi_92{color:var(--color-text-tertiary);flex-shrink:0;transition:transform .15s ease}._root_1howi_7[aria-expanded=true] ._chevron_1howi_92{transform:rotate(180deg)}._optionsList_1howi_103{list-style:none;margin:0;max-height:240px;min-width:100%;overflow-y:auto;padding:var(--space-1)}._noOptions_1howi_112{color:var(--color-text-tertiary);font-size:var(--font-size-sm);padding:var(--space-3) var(--space-2);text-align:center}._option_1howi_103{align-items:center;border-radius:var(--radius-1);cursor:pointer;display:flex;gap:var(--space-2);padding:var(--space-2);transition:background-color .1s ease}._option_1howi_103:hover{background:var(--color-background-secondary)}._optionSelected_1howi_132{background:var(--color-background-secondary);color:var(--color-text-primary);font-weight:var(--font-weight-medium)}._optionDisabled_1howi_138{color:var(--color-text-disabled);cursor:not-allowed}._optionDisabled_1howi_138:hover{background:transparent}._optionLabel_1howi_146{flex:1;overflow:hidden;text-overflow:ellipsis}._checkbox_1howi_153{align-items:center;border:1.5px solid var(--color-border-primary);border-radius:var(--radius-1);display:inline-flex;flex-shrink:0;height:16px;justify-content:center;transition:all .1s ease;width:16px}._checkboxChecked_1howi_165{background:var(--color-background-brand);border-color:var(--color-background-brand);color:var(--color-text-on-brand)}
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum ESelectSize {
|
|
4
|
+
SM = "sm",
|
|
5
|
+
MD = "md",
|
|
6
|
+
LG = "lg"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare interface ISelectOption {
|
|
10
|
+
/** Option display label. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Option unique value. */
|
|
13
|
+
value: string;
|
|
14
|
+
/** Whether the option is disabled. */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare interface ISelectProps {
|
|
19
|
+
/** Array of options to display in the dropdown. */
|
|
20
|
+
options: ISelectOption[];
|
|
21
|
+
/** Currently selected value(s). For single select — string, for multiple — string[]. */
|
|
22
|
+
value?: string | string[];
|
|
23
|
+
/** Callback when selection changes. */
|
|
24
|
+
onChange?: (value: string | string[]) => void;
|
|
25
|
+
/** Placeholder text when no option is selected. */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/** Whether multiple options can be selected. */
|
|
28
|
+
multiple?: boolean;
|
|
29
|
+
/** Select size. Default: `'md'`. */
|
|
30
|
+
size?: TSelectSize;
|
|
31
|
+
/** Whether the select is disabled. */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/** Whether the select value can be cleared. */
|
|
34
|
+
clearable?: boolean;
|
|
35
|
+
/** Whether the select is in an invalid state. */
|
|
36
|
+
invalid?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Select component. A dropdown selector built on top of Popover.
|
|
41
|
+
*
|
|
42
|
+
* Supports single and multiple selection, clearable option, and
|
|
43
|
+
* three sizes (`sm`, `md`, `lg`).
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* const [value, setValue] = useState('');
|
|
48
|
+
*
|
|
49
|
+
* <Select
|
|
50
|
+
* options={[
|
|
51
|
+
* { label: 'Users', value: 'users' },
|
|
52
|
+
* { label: 'Orders', value: 'orders' },
|
|
53
|
+
* ]}
|
|
54
|
+
* value={value}
|
|
55
|
+
* onChange={setValue}
|
|
56
|
+
* placeholder="Select data source"
|
|
57
|
+
* />
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare const Select: default_2.FC<ISelectProps>;
|
|
61
|
+
|
|
62
|
+
export declare type TSelectSize = `${ESelectSize.SM | ESelectSize.MD | ESelectSize.LG}`;
|
|
63
|
+
|
|
64
|
+
export { }
|
package/dist/select.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useCallback as _ } from "react";
|
|
3
|
+
import { c as h } from "./clsx-OuTLNxxd.mjs";
|
|
4
|
+
import { Popover as u } from "./popover.js";
|
|
5
|
+
import { u as P } from "./useLocale-D2Z0JH0l.mjs";
|
|
6
|
+
import { g as O } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
7
|
+
import './select.css';const M = "Select", B = "bottom start", D = "_root_1howi_7", j = "_disabled_1howi_28", A = "_invalid_1howi_35", E = "_sizeSm_1howi_39", I = "_sizeMd_1howi_45", W = "_sizeLg_1howi_51", F = "_displayText_1howi_57", U = "_displayTextPlaceholder_1howi_64", V = "_indicators_1howi_68", Y = "_clearButton_1howi_74", q = "_chevron_1howi_92", G = "_optionsList_1howi_103", H = "_noOptions_1howi_112", J = "_option_1howi_103", K = "_optionSelected_1howi_132", Q = "_optionDisabled_1howi_138", R = "_optionLabel_1howi_146", X = "_checkbox_1howi_153", Z = "_checkboxChecked_1howi_165", o = {
|
|
8
|
+
root: D,
|
|
9
|
+
disabled: j,
|
|
10
|
+
invalid: A,
|
|
11
|
+
sizeSm: E,
|
|
12
|
+
sizeMd: I,
|
|
13
|
+
sizeLg: W,
|
|
14
|
+
displayText: F,
|
|
15
|
+
displayTextPlaceholder: U,
|
|
16
|
+
indicators: V,
|
|
17
|
+
clearButton: Y,
|
|
18
|
+
chevron: q,
|
|
19
|
+
optionsList: G,
|
|
20
|
+
noOptions: H,
|
|
21
|
+
option: J,
|
|
22
|
+
optionSelected: K,
|
|
23
|
+
optionDisabled: Q,
|
|
24
|
+
optionLabel: R,
|
|
25
|
+
checkbox: X,
|
|
26
|
+
checkboxChecked: Z
|
|
27
|
+
}, $ = (v) => {
|
|
28
|
+
const {
|
|
29
|
+
clearable: f = !1,
|
|
30
|
+
disabled: a = !1,
|
|
31
|
+
invalid: b = !1,
|
|
32
|
+
multiple: s = !1,
|
|
33
|
+
onChange: t,
|
|
34
|
+
options: r,
|
|
35
|
+
placeholder: k,
|
|
36
|
+
size: w = "md",
|
|
37
|
+
value: n
|
|
38
|
+
} = v, [L, m] = z(!1), p = P(), d = s ? r.filter((e) => n?.includes(e.value)) : r.filter((e) => e.value === n), x = d.length > 0 ? d.map((e) => e.label).join(", ") : k ?? p.select.placeholder, g = _(
|
|
39
|
+
(e) => {
|
|
40
|
+
if (!e.disabled && t)
|
|
41
|
+
if (s) {
|
|
42
|
+
const l = n ?? [], y = l.includes(e.value) ? l.filter((T) => T !== e.value) : [...l, e.value];
|
|
43
|
+
t(y);
|
|
44
|
+
} else
|
|
45
|
+
t(e.value), m(!1);
|
|
46
|
+
},
|
|
47
|
+
[s, t, n]
|
|
48
|
+
), C = _(
|
|
49
|
+
(e) => {
|
|
50
|
+
e.stopPropagation(), t && t(s ? [] : "");
|
|
51
|
+
},
|
|
52
|
+
[s, t]
|
|
53
|
+
), N = _(
|
|
54
|
+
(e) => s ? n?.includes(e) ?? !1 : n === e,
|
|
55
|
+
[s, n]
|
|
56
|
+
), S = h(
|
|
57
|
+
o.root,
|
|
58
|
+
O("size", w, o),
|
|
59
|
+
a && o.disabled,
|
|
60
|
+
b && o.invalid
|
|
61
|
+
);
|
|
62
|
+
return /* @__PURE__ */ c(u, { onOpenChange: m, open: L, placement: B, children: [
|
|
63
|
+
/* @__PURE__ */ i(u.Trigger, { children: /* @__PURE__ */ c(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
"aria-disabled": a,
|
|
67
|
+
"aria-invalid": b,
|
|
68
|
+
className: S,
|
|
69
|
+
role: "combobox",
|
|
70
|
+
tabIndex: a ? -1 : 0,
|
|
71
|
+
onClick: a ? (e) => e.stopPropagation() : void 0,
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ i("span", { className: h(o.displayText, !d.length && o.displayTextPlaceholder), children: x }),
|
|
74
|
+
/* @__PURE__ */ c("span", { className: o.indicators, children: [
|
|
75
|
+
f && d.length > 0 && !a && /* @__PURE__ */ i(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
"aria-label": p.select.clear,
|
|
79
|
+
className: o.clearButton,
|
|
80
|
+
onClick: C,
|
|
81
|
+
tabIndex: -1,
|
|
82
|
+
type: "button",
|
|
83
|
+
children: "✕"
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ i(
|
|
87
|
+
"svg",
|
|
88
|
+
{
|
|
89
|
+
"aria-hidden": "true",
|
|
90
|
+
className: o.chevron,
|
|
91
|
+
height: "16",
|
|
92
|
+
viewBox: "0 0 16 16",
|
|
93
|
+
width: "16",
|
|
94
|
+
children: /* @__PURE__ */ i(
|
|
95
|
+
"path",
|
|
96
|
+
{
|
|
97
|
+
d: "M4 6 L8 10 L12 6",
|
|
98
|
+
fill: "none",
|
|
99
|
+
stroke: "currentColor",
|
|
100
|
+
strokeLinecap: "round",
|
|
101
|
+
strokeLinejoin: "round",
|
|
102
|
+
strokeWidth: "1.5"
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
) }),
|
|
111
|
+
/* @__PURE__ */ i(u.Content, { padding: !1, children: /* @__PURE__ */ c(
|
|
112
|
+
"ul",
|
|
113
|
+
{
|
|
114
|
+
"aria-label": x,
|
|
115
|
+
className: o.optionsList,
|
|
116
|
+
role: "listbox",
|
|
117
|
+
children: [
|
|
118
|
+
r.length === 0 && /* @__PURE__ */ i("li", { className: o.noOptions, children: p.select.noOptions }),
|
|
119
|
+
r.map((e) => {
|
|
120
|
+
const l = N(e.value);
|
|
121
|
+
return /* @__PURE__ */ c(
|
|
122
|
+
"li",
|
|
123
|
+
{
|
|
124
|
+
"aria-disabled": e.disabled,
|
|
125
|
+
"aria-selected": l,
|
|
126
|
+
className: h(
|
|
127
|
+
o.option,
|
|
128
|
+
l && o.optionSelected,
|
|
129
|
+
e.disabled && o.optionDisabled
|
|
130
|
+
),
|
|
131
|
+
onClick: () => {
|
|
132
|
+
g(e);
|
|
133
|
+
},
|
|
134
|
+
role: "option",
|
|
135
|
+
children: [
|
|
136
|
+
s && /* @__PURE__ */ i("span", { className: h(o.checkbox, l && o.checkboxChecked), children: l && /* @__PURE__ */ i(
|
|
137
|
+
"svg",
|
|
138
|
+
{
|
|
139
|
+
"aria-hidden": "true",
|
|
140
|
+
height: "12",
|
|
141
|
+
viewBox: "0 0 12 12",
|
|
142
|
+
width: "12",
|
|
143
|
+
children: /* @__PURE__ */ i(
|
|
144
|
+
"path",
|
|
145
|
+
{
|
|
146
|
+
d: "M2 6 L5 9 L10 3",
|
|
147
|
+
fill: "none",
|
|
148
|
+
stroke: "currentColor",
|
|
149
|
+
strokeLinecap: "round",
|
|
150
|
+
strokeLinejoin: "round",
|
|
151
|
+
strokeWidth: "2"
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
) }),
|
|
156
|
+
/* @__PURE__ */ i("span", { className: o.optionLabel, children: e.label })
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
e.value
|
|
160
|
+
);
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
) })
|
|
165
|
+
] });
|
|
166
|
+
};
|
|
167
|
+
$.displayName = M;
|
|
168
|
+
export {
|
|
169
|
+
$ as Select
|
|
170
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--separator-color: var(--color-border-primary)}._root_1o06b_5{background:var(--separator-color);border:none;height:1px;margin:0;padding-inline:var(--space-4);width:100%}._vertical_1o06b_14{height:100%;padding-block:var(--space-4);padding-inline:0;width:1px}._bleed_1o06b_21{padding:0}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare interface IProps {
|
|
4
|
+
/** Vertical orientation. Default: `false`. */
|
|
5
|
+
vertical?: boolean;
|
|
6
|
+
/** CSS colour of the line. Default: `var(--color-border-primary)`. */
|
|
7
|
+
color?: string;
|
|
8
|
+
/** Removes padding around the line. Default: `false`. */
|
|
9
|
+
bleed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Separator component. Renders a horizontal or vertical dividing line.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Separator />
|
|
18
|
+
* <Separator vertical />
|
|
19
|
+
* <Separator bleed />
|
|
20
|
+
* <Separator vertical bleed color="var(--color-text-success)" />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const Separator: default_2.FC<IProps>;
|
|
24
|
+
|
|
25
|
+
export { }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "./clsx-OuTLNxxd.mjs";
|
|
3
|
+
import './separator.css';const _ = "Separator", b = "_root_1o06b_5", i = "_vertical_1o06b_14", n = "_bleed_1o06b_21", o = {
|
|
4
|
+
root: b,
|
|
5
|
+
vertical: i,
|
|
6
|
+
bleed: n
|
|
7
|
+
}, m = (r) => {
|
|
8
|
+
const { vertical: e = !1, color: t, bleed: a = !1 } = r, s = c(
|
|
9
|
+
o.root,
|
|
10
|
+
e && o.vertical,
|
|
11
|
+
a && o.bleed
|
|
12
|
+
);
|
|
13
|
+
return /* @__PURE__ */ l(
|
|
14
|
+
"hr",
|
|
15
|
+
{
|
|
16
|
+
className: s,
|
|
17
|
+
style: { "--separator-color": t ?? "var(--color-border-primary)" }
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
m.displayName = _;
|
|
22
|
+
export {
|
|
23
|
+
m as Separator
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--skeleton-animation-duration: 1.8s}._root_dz5s8_5{animation:_skeleton-pulse_dz5s8_1 var(--skeleton-animation-duration) ease-in-out infinite;background:var(--color-background-tertiary);display:block;width:100%}._variantText_dz5s8_12{border-radius:var(--radius-1);height:1em}._variantCircular_dz5s8_17{border-radius:50%;height:40px;width:40px}._variantRectangular_dz5s8_23{border-radius:var(--radius-2);height:100px}@keyframes _skeleton-pulse_dz5s8_1{0%{opacity:1}50%{opacity:.4}to{opacity:1}}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum ESkeletonVariant {
|
|
4
|
+
TEXT = "text",
|
|
5
|
+
CIRCULAR = "circular",
|
|
6
|
+
RECTANGULAR = "rectangular"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare interface ISkeletonProps {
|
|
10
|
+
/** Visual variant: text line, circle, or rectangle. Default: 'text'. */
|
|
11
|
+
variant?: TSkeletonVariant;
|
|
12
|
+
/** CSS width. Numbers are treated as pixels. */
|
|
13
|
+
width?: string | number;
|
|
14
|
+
/** CSS height. Numbers are treated as pixels. */
|
|
15
|
+
height?: string | number;
|
|
16
|
+
/** Override border-radius. */
|
|
17
|
+
borderRadius?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Skeleton component. Renders a pulsing placeholder for loading content.
|
|
22
|
+
*
|
|
23
|
+
* Supports three variants: `text` (line of text), `circular` (avatar/circle), `rectangular` (card/image).
|
|
24
|
+
* Use `width` and `height` to control dimensions. Numbers are treated as pixels.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <Skeleton />
|
|
29
|
+
* <Skeleton variant="circular" width={40} height={40} />
|
|
30
|
+
* <Skeleton variant="rectangular" width="100%" height={200} />
|
|
31
|
+
* <Skeleton width="60%" />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const Skeleton: default_2.FC<ISkeletonProps>;
|
|
35
|
+
|
|
36
|
+
export declare type TSkeletonVariant = `${ESkeletonVariant.TEXT | ESkeletonVariant.CIRCULAR | ESkeletonVariant.RECTANGULAR}`;
|
|
37
|
+
|
|
38
|
+
export { }
|
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "./clsx-OuTLNxxd.mjs";
|
|
3
|
+
import { g as d } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
4
|
+
import './skeleton.css';const _ = "Skeleton", v = "_root_dz5s8_5", u = "_variantText_dz5s8_12", m = "_variantCircular_dz5s8_17", p = "_variantRectangular_dz5s8_23", e = {
|
|
5
|
+
root: v,
|
|
6
|
+
"skeleton-pulse": "_skeleton-pulse_dz5s8_1",
|
|
7
|
+
variantText: u,
|
|
8
|
+
variantCircular: m,
|
|
9
|
+
variantRectangular: p
|
|
10
|
+
}, x = (s) => {
|
|
11
|
+
const { borderRadius: o, height: t, variant: i = "text", width: a } = s, n = l(
|
|
12
|
+
e.root,
|
|
13
|
+
d("variant", i, e)
|
|
14
|
+
), r = {};
|
|
15
|
+
return a !== void 0 && (r.width = typeof a == "number" ? `${a}px` : a), t !== void 0 && (r.height = typeof t == "number" ? `${t}px` : t), o !== void 0 && (r.borderRadius = o), /* @__PURE__ */ c(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: n,
|
|
19
|
+
style: r,
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
x.displayName = _;
|
|
25
|
+
export {
|
|
26
|
+
x as Skeleton
|
|
27
|
+
};
|
package/dist/spinner.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--spinner-speed: .8s;--spinner-color: var(--color-text-secondary)}._root_1n8x7_6{animation:_spinner-rotate_1n8x7_1 var(--spinner-speed) linear infinite;border-color:var(--spinner-color);border-radius:50%;border-style:solid;border-top-color:transparent;border-width:2px;display:inline-block;flex-shrink:0}._sizeSm_1n8x7_17{height:16px;width:16px}._sizeMd_1n8x7_22{height:24px;width:24px}._sizeLg_1n8x7_27{height:32px;width:32px}._sizeXl_1n8x7_32{height:40px;width:40px}@keyframes _spinner-rotate_1n8x7_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum ESpinnerSize {
|
|
4
|
+
SM = "sm",
|
|
5
|
+
MD = "md",
|
|
6
|
+
LG = "lg",
|
|
7
|
+
XL = "xl"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare interface ISpinnerProps {
|
|
11
|
+
/** Size. Default: 'md'. */
|
|
12
|
+
size?: TSpinnerSize;
|
|
13
|
+
/** CSS color value for the spinner arc. Default: 'var(--color-text-secondary)'. */
|
|
14
|
+
color?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Spinner component. Renders a rotating arc indicator for loading states.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Spinner />
|
|
23
|
+
* <Spinner size="lg" />
|
|
24
|
+
* <Spinner color="var(--palette-brand)" />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const Spinner: default_2.FC<ISpinnerProps>;
|
|
28
|
+
|
|
29
|
+
export declare type TSpinnerSize = `${ESpinnerSize.SM | ESpinnerSize.MD | ESpinnerSize.LG | ESpinnerSize.XL}`;
|
|
30
|
+
|
|
31
|
+
export { }
|
package/dist/spinner.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "./clsx-OuTLNxxd.mjs";
|
|
3
|
+
import { g as a } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
4
|
+
import './spinner.css';const _ = "Spinner", c = "_root_1n8x7_6", l = "_sizeSm_1n8x7_17", m = "_sizeMd_1n8x7_22", z = "_sizeLg_1n8x7_27", p = "_sizeXl_1n8x7_32", s = {
|
|
5
|
+
root: c,
|
|
6
|
+
"spinner-rotate": "_spinner-rotate_1n8x7_1",
|
|
7
|
+
sizeSm: l,
|
|
8
|
+
sizeMd: m,
|
|
9
|
+
sizeLg: z,
|
|
10
|
+
sizeXl: p
|
|
11
|
+
}, x = (o) => {
|
|
12
|
+
const { color: e, size: t = "md" } = o, n = i(
|
|
13
|
+
s.root,
|
|
14
|
+
a("size", t, s)
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ r(
|
|
17
|
+
"span",
|
|
18
|
+
{
|
|
19
|
+
className: n,
|
|
20
|
+
role: "status",
|
|
21
|
+
"aria-label": "Loading",
|
|
22
|
+
style: { "--spinner-color": e ?? "var(--color-text-secondary)" }
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
x.displayName = _;
|
|
27
|
+
export {
|
|
28
|
+
x as Spinner
|
|
29
|
+
};
|
package/dist/switch.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--switch-track-width: 36px;--switch-track-height: 20px;--switch-track-radius: var(--radius-full);--switch-track-background: var(--palette-gray-300);--switch-track-background-checked: var(--palette-brand);--switch-track-background-disabled: var(--palette-gray-200);--switch-thumb-size: 16px;--switch-thumb-background: var(--palette-white);--switch-thumb-shadow: var(--shadow-xs);--switch-thumb-offset: 2px;--switch-label-font-size: var(--font-size-md);--switch-label-line-height: var(--line-height-md);--switch-label-color: var(--color-text-primary);--switch-label-gap: var(--space-2);--switch-transition-duration: .2s;--switch-transition-timing: cubic-bezier(.4, 0, .2, 1)}._root_84xww_24{align-items:center;cursor:pointer;display:inline-flex;flex-shrink:0;gap:var(--switch-label-gap);vertical-align:middle}._root_84xww_24._disabled_84xww_33{cursor:not-allowed;opacity:.5}._input_84xww_39{border:0;clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}._track_84xww_52{align-items:center;background:var(--switch-track-background);border-radius:var(--switch-track-radius);display:inline-flex;flex-shrink:0;height:var(--switch-track-height);position:relative;transition:background var(--switch-transition-duration) var(--switch-transition-timing);width:var(--switch-track-width)}._thumb_84xww_64{background:var(--switch-thumb-background);border-radius:50%;box-shadow:var(--switch-thumb-shadow);height:var(--switch-thumb-size);left:var(--switch-thumb-offset);position:absolute;transition:transform var(--switch-transition-duration) var(--switch-transition-timing),left var(--switch-transition-duration) var(--switch-transition-timing);width:var(--switch-thumb-size)}._label_84xww_75{color:var(--switch-label-color);font-size:var(--switch-label-font-size);line-height:var(--switch-label-line-height);-webkit-user-select:none;user-select:none}._input_84xww_39:checked+._track_84xww_52{background:var(--switch-track-background-checked)}._input_84xww_39:checked+._track_84xww_52 ._thumb_84xww_64{left:calc(var(--switch-track-width) - var(--switch-thumb-size) - var(--switch-thumb-offset))}._input_84xww_39:focus-visible+._track_84xww_52{box-shadow:0 0 0 2px var(--color-border-focus)}._input_84xww_39:disabled+._track_84xww_52{background:var(--switch-track-background-disabled)}._sizeSm_84xww_102{--switch-track-width: 28px;--switch-track-height: 16px;--switch-thumb-size: 12px;--switch-thumb-offset: 2px;--switch-label-font-size: var(--font-size-sm);--switch-label-line-height: var(--line-height-sm)}._sizeMd_84xww_112{--switch-track-width: 36px;--switch-track-height: 20px;--switch-thumb-size: 16px;--switch-thumb-offset: 2px;--switch-label-font-size: var(--font-size-md);--switch-label-line-height: var(--line-height-md)}._sizeLg_84xww_122{--switch-track-width: 44px;--switch-track-height: 24px;--switch-thumb-size: 20px;--switch-thumb-offset: 2px;--switch-label-font-size: var(--font-size-lg);--switch-label-line-height: var(--line-height-lg)}
|
package/dist/switch.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum ESwitchSize {
|
|
4
|
+
SM = "sm",
|
|
5
|
+
MD = "md",
|
|
6
|
+
LG = "lg"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare interface ISwitchProps extends TNativeInputProps, default_2.PropsWithChildren {
|
|
10
|
+
/** Size. Default: 'md'. */
|
|
11
|
+
size?: TSwitchSize;
|
|
12
|
+
/** When true, the switch is checked (on). Use for controlled mode. */
|
|
13
|
+
checked?: boolean;
|
|
14
|
+
/** Initial checked state for uncontrolled mode. */
|
|
15
|
+
defaultChecked?: boolean;
|
|
16
|
+
/** Disables the switch, preventing user interaction. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Callback invoked when the switch value changes. */
|
|
19
|
+
onChange?: default_2.ChangeEventHandler<HTMLInputElement>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Switch component. Renders a toggle switch for on/off settings.
|
|
24
|
+
*
|
|
25
|
+
* Supports controlled (`checked` + `onChange`) and uncontrolled (`defaultChecked`) modes.
|
|
26
|
+
* The underlying element is a native checkbox for accessibility.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Switch />
|
|
31
|
+
* <Switch defaultChecked />
|
|
32
|
+
* <Switch size="lg" />
|
|
33
|
+
* <Switch checked={isEnabled} onChange={handleChange} />
|
|
34
|
+
* <Switch disabled />
|
|
35
|
+
* <Switch>Enable notifications</Switch>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare const Switch: default_2.FC<ISwitchProps>;
|
|
39
|
+
|
|
40
|
+
declare type TNativeInputProps = Omit<default_2.InputHTMLAttributes<HTMLInputElement>, 'className' | 'size' | 'type'>;
|
|
41
|
+
|
|
42
|
+
export declare type TSwitchSize = `${ESwitchSize.SM | ESwitchSize.MD | ESwitchSize.LG}`;
|
|
43
|
+
|
|
44
|
+
export { }
|
package/dist/switch.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "./clsx-OuTLNxxd.mjs";
|
|
3
|
+
import { g as w } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
4
|
+
import './switch.css';const b = "Switch", h = "_root_84xww_24", p = "_disabled_84xww_33", x = "_input_84xww_39", u = "_track_84xww_52", z = "_thumb_84xww_64", N = "_label_84xww_75", k = "_sizeSm_84xww_102", g = "_sizeMd_84xww_112", S = "_sizeLg_84xww_122", s = {
|
|
5
|
+
root: h,
|
|
6
|
+
disabled: p,
|
|
7
|
+
input: x,
|
|
8
|
+
track: u,
|
|
9
|
+
thumb: z,
|
|
10
|
+
label: N,
|
|
11
|
+
sizeSm: k,
|
|
12
|
+
sizeMd: g,
|
|
13
|
+
sizeLg: S
|
|
14
|
+
}, f = (c) => {
|
|
15
|
+
const { children: t, checked: i, defaultChecked: o, disabled: a = !1, onChange: l, size: n = "md", ..._ } = c, r = m(s.root, w("size", n, s), a && s.disabled);
|
|
16
|
+
return /* @__PURE__ */ d("label", { className: r, children: [
|
|
17
|
+
/* @__PURE__ */ e(
|
|
18
|
+
"input",
|
|
19
|
+
{
|
|
20
|
+
..._,
|
|
21
|
+
checked: i,
|
|
22
|
+
className: s.input,
|
|
23
|
+
defaultChecked: o,
|
|
24
|
+
disabled: a,
|
|
25
|
+
onChange: l,
|
|
26
|
+
role: "switch",
|
|
27
|
+
type: "checkbox"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ e("span", { className: s.track, "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: s.thumb }) }),
|
|
31
|
+
t && /* @__PURE__ */ e("span", { className: s.label, children: t })
|
|
32
|
+
] });
|
|
33
|
+
};
|
|
34
|
+
f.displayName = b;
|
|
35
|
+
export {
|
|
36
|
+
f as Switch
|
|
37
|
+
};
|
package/dist/table.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--cell-bg-header: var(--color-background-tertiary);--cell-border-header: var(--color-border-secondary);--cell-padding: var(--space-3) var(--space-4);--cell-max-width: 200px}._root_hpkeq_8{background-color:transparent;border-bottom:1px solid var(--color-border-primary);max-width:var(--cell-max-width);overflow:hidden;padding:var(--cell-padding);text-overflow:ellipsis;white-space:nowrap}._root_hpkeq_8._header_hpkeq_17{background-color:var(--cell-bg-header);border-bottom:2px solid var(--cell-border-header)}._root_hpkeq_8._alignLeft_hpkeq_21{text-align:left}._root_hpkeq_8._alignRight_hpkeq_24{text-align:right}._root_hpkeq_8._alignCenter_hpkeq_27{text-align:center}:root{--table-bg-stripe: var(--color-background-secondary)}._root_1xa2n_5{background-color:var(--color-background-primary);border-bottom:1px solid var(--color-border-primary);transition:background-color .2s}._root_1xa2n_5:nth-child(odd){background-color:var(--table-bg-stripe)}._root_1xa2n_5:hover{background-color:var(--color-background-brand-secondary)}:root{--table-font-size: var(--font-size-md)}._root_op0kb_5{border-collapse:collapse;font-size:var(--table-font-size);table-layout:fixed;width:100%}
|
package/dist/table.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Table cell. Must be used as a child of `<Table.Row>`.
|
|
5
|
+
* Supports text alignment and header styling via `as="th"`.
|
|
6
|
+
*/
|
|
7
|
+
declare const Cell: default_2.FC<IProps>;
|
|
8
|
+
|
|
9
|
+
declare interface IProps extends default_2.PropsWithChildren {
|
|
10
|
+
/** Text alignment. */
|
|
11
|
+
align?: 'left' | 'center' | 'right';
|
|
12
|
+
/** HTML tag: `'td'` (default) or `'th'`. */
|
|
13
|
+
as?: 'td' | 'th';
|
|
14
|
+
/** Tooltip text (native `title` attribute). */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Cell width. */
|
|
17
|
+
width?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare interface IProps_2 extends default_2.PropsWithChildren {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare interface ITableProps extends default_2.PropsWithChildren {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Table row. Must be used as a child of `<Table>`.
|
|
28
|
+
* Accepts `<Table.Cell>` children.
|
|
29
|
+
*/
|
|
30
|
+
declare const Row: default_2.FC<IProps_2>;
|
|
31
|
+
|
|
32
|
+
export declare const Table: TTableCompoundComponent;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Table container. Renders an HTML `<table>` with striped rows and hover effects.
|
|
36
|
+
*
|
|
37
|
+
* Uses compound component pattern via `<Table.Row>` and `<Table.Cell>`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <Table>
|
|
42
|
+
* <Table.Row>
|
|
43
|
+
* <Table.Cell as="th">Name</Table.Cell>
|
|
44
|
+
* <Table.Cell as="th">Role</Table.Cell>
|
|
45
|
+
* </Table.Row>
|
|
46
|
+
* <Table.Row>
|
|
47
|
+
* <Table.Cell>John</Table.Cell>
|
|
48
|
+
* <Table.Cell>Developer</Table.Cell>
|
|
49
|
+
* </Table.Row>
|
|
50
|
+
* </Table>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare const Table_2: default_2.FC<ITableProps>;
|
|
54
|
+
|
|
55
|
+
declare type TTableCompoundComponent = typeof Table_2 & {
|
|
56
|
+
Cell: typeof Cell;
|
|
57
|
+
Row: typeof Row;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { }
|