@g4rcez/components 3.0.1 → 4.0.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/dist/CaretDown.es-Cj7klWI3.js +33 -0
- package/dist/CaretDown.es-Cj7klWI3.js.map +1 -0
- package/dist/CaretRight.es-0-M8D9y8.js +33 -0
- package/dist/CaretRight.es-0-M8D9y8.js.map +1 -0
- package/dist/CheckCircle.es-C6QWLfk_.js +33 -0
- package/dist/CheckCircle.es-C6QWLfk_.js.map +1 -0
- package/dist/File.es-CA-vuPED.js +33 -0
- package/dist/File.es-CA-vuPED.js.map +1 -0
- package/dist/IconBase.es-DJ1oCtpo.js +50 -0
- package/dist/IconBase.es-DJ1oCtpo.js.map +1 -0
- package/dist/Info.es-CrZKs4q4.js +33 -0
- package/dist/Info.es-CrZKs4q4.js.map +1 -0
- package/dist/MotionConfigContext-C7MqlSdv.js +2713 -0
- package/dist/MotionConfigContext-C7MqlSdv.js.map +1 -0
- package/dist/Warning.es-D_eI6tLe.js +39 -0
- package/dist/Warning.es-D_eI6tLe.js.map +1 -0
- package/dist/X.es-BJ1O93El.js +39 -0
- package/dist/X.es-BJ1O93El.js.map +1 -0
- package/dist/ai/docs/Alert.md +1 -1
- package/dist/ai/docs/AnimatedList.md +3 -3
- package/dist/ai/docs/Button.md +1 -1
- package/dist/ai/docs/CommandPalette.md +7 -7
- package/dist/ai/docs/Dropdown.md +4 -4
- package/dist/ai/docs/Empty.md +9 -9
- package/dist/ai/docs/Expand.md +1 -1
- package/dist/ai/docs/FileUpload.md +2 -2
- package/dist/ai/docs/Input.md +2 -2
- package/dist/ai/docs/InputField.md +2 -2
- package/dist/ai/docs/List.md +3 -3
- package/dist/ai/docs/Menu.md +3 -3
- package/dist/ai/docs/MultiSelect.md +1 -1
- package/dist/ai/docs/PageCalendar.md +1 -1
- package/dist/ai/docs/Select.md +1 -1
- package/dist/ai/docs/Slot.md +1 -1
- package/dist/ai/docs/Stats.md +11 -11
- package/dist/ai/docs/Table.md +1 -1
- package/dist/ai/docs/Tag.md +2 -2
- package/dist/ai/docs/Timeline.md +5 -5
- package/dist/ai/docs/Toolbar.md +2 -2
- package/dist/ai/docs/Tooltip.md +3 -3
- package/dist/ai/docs/TransferList.md +2 -2
- package/dist/autocomplete-Cn9Z2hLq.js +375 -0
- package/dist/autocomplete-Cn9Z2hLq.js.map +1 -0
- package/dist/calendar-B5lSd0ID.js +1747 -0
- package/dist/calendar-B5lSd0ID.js.map +1 -0
- package/dist/components/core/button.js +76 -0
- package/dist/components/core/button.js.map +1 -0
- package/dist/components/core/tag.js +67 -0
- package/dist/components/core/tag.js.map +1 -0
- package/dist/components/display/alert.js +94 -0
- package/dist/components/display/alert.js.map +1 -0
- package/dist/components/display/calendar.js +15 -0
- package/dist/components/display/calendar.js.map +1 -0
- package/dist/components/display/card.d.ts +2 -2
- package/dist/components/display/card.d.ts.map +1 -1
- package/dist/components/display/card.js +84 -0
- package/dist/components/display/card.js.map +1 -0
- package/dist/components/display/empty.d.ts +2 -2
- package/dist/components/display/empty.d.ts.map +1 -1
- package/dist/components/display/list.js +93 -0
- package/dist/components/display/list.js.map +1 -0
- package/dist/components/display/notifications.js +15 -0
- package/dist/components/display/notifications.js.map +1 -0
- package/dist/components/display/stats.js +16 -0
- package/dist/components/display/stats.js.map +1 -0
- package/dist/components/display/tabs.js +12 -0
- package/dist/components/display/tabs.js.map +1 -0
- package/dist/components/display/timeline.js +29 -0
- package/dist/components/display/timeline.js.map +1 -0
- package/dist/components/floating/command-palette.d.ts +3 -3
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/dropdown.js +58 -0
- package/dist/components/floating/dropdown.js.map +1 -0
- package/dist/components/floating/expand.js +41 -0
- package/dist/components/floating/expand.js.map +1 -0
- package/dist/components/floating/menu.d.ts +2 -2
- package/dist/components/floating/menu.d.ts.map +1 -1
- package/dist/components/floating/menu.js +177 -0
- package/dist/components/floating/menu.js.map +1 -0
- package/dist/components/floating/modal.js +297 -0
- package/dist/components/floating/modal.js.map +1 -0
- package/dist/components/floating/tooltip.js +73 -0
- package/dist/components/floating/tooltip.js.map +1 -0
- package/dist/components/form/autocomplete.js +16 -0
- package/dist/components/form/autocomplete.js.map +1 -0
- package/dist/components/form/checkbox.js +44 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/date-picker.js +12 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/file-upload.d.ts.map +1 -1
- package/dist/components/form/file-upload.js +11 -0
- package/dist/components/form/file-upload.js.map +1 -0
- package/dist/components/form/form.js +8 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/input.js +5 -0
- package/dist/components/form/input.js.map +1 -0
- package/dist/components/form/radiobox.js +30 -0
- package/dist/components/form/radiobox.js.map +1 -0
- package/dist/components/form/select.js +106 -0
- package/dist/components/form/select.js.map +1 -0
- package/dist/components/form/switch.js +65 -0
- package/dist/components/form/switch.js.map +1 -0
- package/dist/components/form/task-list.js +68 -0
- package/dist/components/form/task-list.js.map +1 -0
- package/dist/components/form/transfer-list.js +55 -0
- package/dist/components/form/transfer-list.js.map +1 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -1
- package/dist/components/table/table.js +10 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/config/context.d.ts +2 -0
- package/dist/config/context.d.ts.map +1 -1
- package/dist/constants-r-AHn273.js +6 -0
- package/dist/constants-r-AHn273.js.map +1 -0
- package/dist/context-BFXNJVn2.js +161 -0
- package/dist/context-BFXNJVn2.js.map +1 -0
- package/dist/date-picker-DwNo22lx.js +1626 -0
- package/dist/date-picker-DwNo22lx.js.map +1 -0
- package/dist/dom-Dl8XH0CK.js +2833 -0
- package/dist/dom-Dl8XH0CK.js.map +1 -0
- package/dist/file-upload-Brf2NkLr.js +3245 -0
- package/dist/file-upload-Brf2NkLr.js.map +1 -0
- package/dist/floating-ui.react-QNHG9W4N.js +3706 -0
- package/dist/floating-ui.react-QNHG9W4N.js.map +1 -0
- package/dist/fns-D2eyJKd5.js +33 -0
- package/dist/fns-D2eyJKd5.js.map +1 -0
- package/dist/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/index-0YMC-_Lt.js +20 -0
- package/dist/index-0YMC-_Lt.js.map +1 -0
- package/dist/index-BelDtX5M.js +1821 -0
- package/dist/index-BelDtX5M.js.map +1 -0
- package/dist/index-C-PuFUZi.js +3416 -0
- package/dist/index-C-PuFUZi.js.map +1 -0
- package/dist/index-DJSMaZR4.js +35 -0
- package/dist/index-DJSMaZR4.js.map +1 -0
- package/dist/index-Z-fZHxfJ.js +335 -0
- package/dist/index-Z-fZHxfJ.js.map +1 -0
- package/dist/index-t1qLJTt5.js +351 -0
- package/dist/index-t1qLJTt5.js.map +1 -0
- package/dist/index.esm-BaIwleSE.js +343 -0
- package/dist/index.esm-BaIwleSE.js.map +1 -0
- package/dist/index.js +8125 -27
- package/dist/index.js.map +1 -1
- package/dist/input-CrGrSnUt.js +441 -0
- package/dist/input-CrGrSnUt.js.map +1 -0
- package/dist/input-field-5vYcz5tT.js +166 -0
- package/dist/input-field-5vYcz5tT.js.map +1 -0
- package/dist/notifications-cUdVPs-B.js +2786 -0
- package/dist/notifications-cUdVPs-B.js.map +1 -0
- package/dist/polymorph-B5n9fs_K.js +10 -0
- package/dist/polymorph-B5n9fs_K.js.map +1 -0
- package/dist/proxy-BZcQiBrp.js +2495 -0
- package/dist/proxy-BZcQiBrp.js.map +1 -0
- package/dist/skeleton-D75GFBV6.js +10 -0
- package/dist/skeleton-D75GFBV6.js.map +1 -0
- package/dist/slot-CRyweuj0.js +79 -0
- package/dist/slot-CRyweuj0.js.map +1 -0
- package/dist/styles/common.js +29 -0
- package/dist/styles/dark.js +214 -0
- package/dist/styles/design-tokens.js +98 -0
- package/dist/styles/light.js +214 -0
- package/dist/styles/theme.js +4 -0
- package/dist/styles/theme.types.js +1 -0
- package/dist/tabs-S00a8qq8.js +106 -0
- package/dist/tabs-S00a8qq8.js.map +1 -0
- package/dist/use-motion-value-eGwNuWuw.js +14 -0
- package/dist/use-motion-value-eGwNuWuw.js.map +1 -0
- package/dist/use-stable-ref-CYh-YkID.js +11 -0
- package/dist/use-stable-ref-CYh-YkID.js.map +1 -0
- package/dist/use-translations-BwLKTrZv.js +10 -0
- package/dist/use-translations-BwLKTrZv.js.map +1 -0
- package/package.json +4 -5
- package/dist/index.mjs +0 -37108
- package/dist/index.mjs.map +0 -1
- package/dist/index.umd.js +0 -28
- package/dist/index.umd.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as o, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "../../dom-Dl8XH0CK.js";
|
|
3
|
+
const n = ({ children: r, className: e = "", size: l, ...a }) => /* @__PURE__ */ o(
|
|
4
|
+
"label",
|
|
5
|
+
{
|
|
6
|
+
"data-component": "radiobox",
|
|
7
|
+
"data-disabled": a.disabled,
|
|
8
|
+
"aria-disabled": a.disabled,
|
|
9
|
+
className: "group flex items-center gap-2 font-normal data-[disabled=true]:cursor-not-allowed",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ d(
|
|
12
|
+
"input",
|
|
13
|
+
{
|
|
14
|
+
...a,
|
|
15
|
+
type: "radio",
|
|
16
|
+
className: i(
|
|
17
|
+
"app form-radio inline-block h-4 w-4 appearance-none rounded-full border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed",
|
|
18
|
+
e
|
|
19
|
+
),
|
|
20
|
+
...a
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
r
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
export {
|
|
28
|
+
n as Radiobox
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=radiobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radiobox.js","sources":["../../../src/components/form/radiobox.tsx"],"sourcesContent":["import React from \"react\";\nimport { css } from \"../../lib/dom\";\nimport { Override } from \"../../types\";\n\nexport type RadioboxProps = Override<\n React.PropsWithChildren<React.ComponentProps<\"input\">>,\n {\n size?: \"medium\" | \"large\";\n }\n>;\n\nexport const Radiobox = ({ children, className = \"\", size, ...props }: RadioboxProps) => (\n <label\n data-component=\"radiobox\"\n data-disabled={props.disabled}\n aria-disabled={props.disabled}\n className=\"group flex items-center gap-2 font-normal data-[disabled=true]:cursor-not-allowed\"\n >\n <input\n {...props}\n type=\"radio\"\n className={css(\n \"app form-radio inline-block h-4 w-4 appearance-none rounded-full border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed\",\n className\n )}\n {...props}\n />\n {children}\n </label>\n);\n"],"names":["Radiobox","children","className","size","props","jsxs","jsx","css"],"mappings":";;AAWO,MAAMA,IAAW,CAAC,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,MAAAC,GAAM,GAAGC,EAAA,MAC1D,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,kBAAe;AAAA,IACf,iBAAeD,EAAM;AAAA,IACrB,iBAAeA,EAAM;AAAA,IACrB,WAAU;AAAA,IAEV,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACI,GAAGF;AAAA,UACJ,MAAK;AAAA,UACL,WAAWG;AAAA,YACP;AAAA,YACAL;AAAA,UAAA;AAAA,UAEH,GAAGE;AAAA,QAAA;AAAA,MAAA;AAAA,MAEPH;AAAA,IAAA;AAAA,EAAA;AACL;"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as R, useRef as E, useImperativeHandle as j, useEffect as z, createElement as A } from "react";
|
|
3
|
+
import { e as D } from "../../CaretDown.es-Cj7klWI3.js";
|
|
4
|
+
import { u as F } from "../../use-translations-BwLKTrZv.js";
|
|
5
|
+
import { i as L, c as $, m as H } from "../../dom-Dl8XH0CK.js";
|
|
6
|
+
import { I as S } from "../../input-field-5vYcz5tT.js";
|
|
7
|
+
const P = R(
|
|
8
|
+
({
|
|
9
|
+
required: o = !0,
|
|
10
|
+
options: s,
|
|
11
|
+
info: u,
|
|
12
|
+
selectContainer: T = "",
|
|
13
|
+
feedback: d = null,
|
|
14
|
+
labelClassName: m,
|
|
15
|
+
interactive: f,
|
|
16
|
+
rightLabel: h,
|
|
17
|
+
hiddenLabel: g,
|
|
18
|
+
loading: b,
|
|
19
|
+
optionalText: p,
|
|
20
|
+
container: v,
|
|
21
|
+
hideLeft: x = !1,
|
|
22
|
+
right: y,
|
|
23
|
+
left: C,
|
|
24
|
+
error: N,
|
|
25
|
+
...e
|
|
26
|
+
}, i) => {
|
|
27
|
+
const k = F(), n = E(null), l = e.id ?? e.name;
|
|
28
|
+
j(i, () => n.current), z(() => {
|
|
29
|
+
if (n.current === null) return;
|
|
30
|
+
const t = new AbortController(), c = n.current, I = L(n.current);
|
|
31
|
+
return c.addEventListener("change", () => c.setAttribute("data-selected", "true"), {
|
|
32
|
+
once: !0,
|
|
33
|
+
signal: t.signal
|
|
34
|
+
}), () => {
|
|
35
|
+
I(), t.abort();
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
const w = () => n.current?.focus();
|
|
39
|
+
return /* @__PURE__ */ r(
|
|
40
|
+
S,
|
|
41
|
+
{
|
|
42
|
+
info: u,
|
|
43
|
+
left: C,
|
|
44
|
+
error: N,
|
|
45
|
+
form: e.form,
|
|
46
|
+
loading: b,
|
|
47
|
+
name: e.name,
|
|
48
|
+
feedback: d,
|
|
49
|
+
hideLeft: x,
|
|
50
|
+
required: o,
|
|
51
|
+
title: e.title,
|
|
52
|
+
container: v,
|
|
53
|
+
componentName: "select",
|
|
54
|
+
rightLabel: h,
|
|
55
|
+
hiddenLabel: g,
|
|
56
|
+
interactive: f,
|
|
57
|
+
id: e.name || e.id,
|
|
58
|
+
optionalText: p,
|
|
59
|
+
labelClassName: m,
|
|
60
|
+
placeholder: e.placeholder,
|
|
61
|
+
right: /* @__PURE__ */ a("label", { htmlFor: l, children: [
|
|
62
|
+
y,
|
|
63
|
+
/* @__PURE__ */ a("button", { onClick: w, type: "button", className: "mt-2 transition-colors hover:text-primary", children: [
|
|
64
|
+
/* @__PURE__ */ r(D, { size: 20 }),
|
|
65
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: k.inputCaretDown })
|
|
66
|
+
] })
|
|
67
|
+
] }),
|
|
68
|
+
children: /* @__PURE__ */ a(
|
|
69
|
+
"select",
|
|
70
|
+
{
|
|
71
|
+
...e,
|
|
72
|
+
id: l,
|
|
73
|
+
name: l,
|
|
74
|
+
required: o,
|
|
75
|
+
ref: H(i, n),
|
|
76
|
+
"data-selected": !!e.value || !1,
|
|
77
|
+
title: typeof e.title == "string" ? e.title : void 0,
|
|
78
|
+
className: $(
|
|
79
|
+
"input select group h-10 w-full flex-1 appearance-none rounded-md text-base",
|
|
80
|
+
"bg-transparent px-2 py-1 text-foreground placeholder-input-placeholder",
|
|
81
|
+
"outline-none transition-colors group-error:text-danger group-error:placeholder-input-mask-error",
|
|
82
|
+
"data-[selected=false]:text-input-placeholder",
|
|
83
|
+
e.className
|
|
84
|
+
),
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ r("option", { value: "", disabled: !0, hidden: !0, children: e.placeholder }),
|
|
87
|
+
s.map((t) => /* @__PURE__ */ A(
|
|
88
|
+
"option",
|
|
89
|
+
{
|
|
90
|
+
...t,
|
|
91
|
+
value: t.value,
|
|
92
|
+
children: t.label ?? t.value,
|
|
93
|
+
key: `${l}-select-option-${t.value}`
|
|
94
|
+
}
|
|
95
|
+
))
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
export {
|
|
104
|
+
P as Select
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sources":["../../../src/components/form/select.tsx"],"sourcesContent":["\"use client\";\nimport { CaretDownIcon } from \"@phosphor-icons/react\";\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef } from \"react\";\nimport { useTranslations } from \"../../hooks/use-translations\";\nimport { css, initializeInputDataset, mergeRefs } from \"../../lib/dom\";\nimport { Override } from \"../../types\";\nimport { InputField, InputFieldProps } from \"./input-field\";\n\nexport type OptionProps = Override<\n React.ComponentProps<\"option\">,\n {\n value: string;\n \"data-dynamic\"?: string;\n } & Partial<Record<`data-${string}`, string>>\n>;\n\nexport type SelectProps = Override<\n InputFieldProps<\"select\">,\n {\n options: OptionProps[];\n selectContainer?: string;\n }\n>;\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n required = true,\n options,\n info,\n selectContainer = \"\",\n feedback = null,\n labelClassName,\n interactive,\n rightLabel,\n hiddenLabel,\n loading,\n optionalText,\n container,\n hideLeft = false,\n right,\n left,\n error,\n ...props\n }: SelectProps,\n ref\n ) => {\n const translation = useTranslations();\n const inputRef = useRef<HTMLSelectElement>(null);\n const id = props.id ?? props.name;\n useImperativeHandle(ref, () => inputRef.current!);\n\n useEffect(() => {\n if (inputRef.current === null) return;\n const controller = new AbortController();\n const input = inputRef.current;\n const focus = initializeInputDataset(inputRef.current);\n input.addEventListener(\"change\", () => input.setAttribute(\"data-selected\", \"true\"), {\n once: true,\n signal: controller.signal,\n });\n return () => {\n focus();\n controller.abort();\n };\n }, []);\n\n const onClickLabel = () => inputRef.current?.focus();\n\n return (\n <InputField<\"select\">\n info={info}\n left={left}\n error={error}\n form={props.form}\n loading={loading}\n name={props.name}\n feedback={feedback}\n hideLeft={hideLeft}\n required={required}\n title={props.title}\n container={container}\n componentName=\"select\"\n rightLabel={rightLabel}\n hiddenLabel={hiddenLabel}\n interactive={interactive}\n id={props.name || props.id}\n optionalText={optionalText}\n labelClassName={labelClassName}\n placeholder={props.placeholder}\n right={\n <label htmlFor={id}>\n {right}\n <button onClick={onClickLabel} type=\"button\" className=\"mt-2 transition-colors hover:text-primary\">\n <CaretDownIcon size={20} />\n <span className=\"sr-only\">{translation.inputCaretDown}</span>\n </button>\n </label>\n }\n >\n <select\n {...props}\n id={id}\n name={id}\n required={required}\n ref={mergeRefs(ref, inputRef)}\n data-selected={!!props.value || false}\n title={typeof props.title === \"string\" ? props.title : undefined}\n className={css(\n \"input select group h-10 w-full flex-1 appearance-none rounded-md text-base\",\n \"bg-transparent px-2 py-1 text-foreground placeholder-input-placeholder\",\n \"outline-none transition-colors group-error:text-danger group-error:placeholder-input-mask-error\",\n \"data-[selected=false]:text-input-placeholder\",\n props.className\n )}\n >\n <option value=\"\" disabled hidden>\n {props.placeholder}\n </option>\n {options.map((option) => (\n <option\n {...option}\n value={option.value}\n children={option.label ?? option.value}\n key={`${id}-select-option-${option.value}`}\n />\n ))}\n </select>\n </InputField>\n );\n }\n);\n"],"names":["Select","forwardRef","required","options","info","selectContainer","feedback","labelClassName","interactive","rightLabel","hiddenLabel","loading","optionalText","container","hideLeft","right","left","error","props","ref","translation","useTranslations","inputRef","useRef","id","useImperativeHandle","useEffect","controller","input","focus","initializeInputDataset","onClickLabel","jsx","InputField","jsxs","CaretDownIcon","mergeRefs","css","option","createElement"],"mappings":";;;;;;AAwBO,MAAMA,IAASC;AAAA,EAClB,CACI;AAAA,IACI,UAAAC,IAAW;AAAA,IACX,SAAAC;AAAA,IACA,MAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,UAAAC,IAAW;AAAA,IACX,gBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAEPC,MACC;AACD,UAAMC,IAAcC,EAAA,GACdC,IAAWC,EAA0B,IAAI,GACzCC,IAAKN,EAAM,MAAMA,EAAM;AAC7B,IAAAO,EAAoBN,GAAK,MAAMG,EAAS,OAAQ,GAEhDI,EAAU,MAAM;AACZ,UAAIJ,EAAS,YAAY,KAAM;AAC/B,YAAMK,IAAa,IAAI,gBAAA,GACjBC,IAAQN,EAAS,SACjBO,IAAQC,EAAuBR,EAAS,OAAO;AACrD,aAAAM,EAAM,iBAAiB,UAAU,MAAMA,EAAM,aAAa,iBAAiB,MAAM,GAAG;AAAA,QAChF,MAAM;AAAA,QACN,QAAQD,EAAW;AAAA,MAAA,CACtB,GACM,MAAM;AACT,QAAAE,EAAA,GACAF,EAAW,MAAA;AAAA,MAAM;AAAA,IACrB,GACD,EAAE;AAEL,UAAMI,IAAe,MAAMT,EAAS,SAAS,MAAA;AAE7C,WACI,gBAAAU;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,MAAA7B;AAAA,QACA,MAAAY;AAAA,QACA,OAAAC;AAAA,QACA,MAAMC,EAAM;AAAA,QACZ,SAAAP;AAAA,QACA,MAAMO,EAAM;AAAA,QACZ,UAAAZ;AAAA,QACA,UAAAQ;AAAA,QACA,UAAAZ;AAAA,QACA,OAAOgB,EAAM;AAAA,QACb,WAAAL;AAAA,QACA,eAAc;AAAA,QACd,YAAAJ;AAAA,QACA,aAAAC;AAAA,QACA,aAAAF;AAAA,QACA,IAAIU,EAAM,QAAQA,EAAM;AAAA,QACxB,cAAAN;AAAA,QACA,gBAAAL;AAAA,QACA,aAAaW,EAAM;AAAA,QACnB,OACI,gBAAAgB,EAAC,SAAA,EAAM,SAASV,GACX,UAAA;AAAA,UAAAT;AAAA,4BACA,UAAA,EAAO,SAASgB,GAAc,MAAK,UAAS,WAAU,6CACnD,UAAA;AAAA,YAAA,gBAAAC,EAACG,GAAA,EAAc,MAAM,GAAA,CAAI;AAAA,YACzB,gBAAAH,EAAC,QAAA,EAAK,WAAU,WAAW,YAAY,eAAA,CAAe;AAAA,UAAA,EAAA,CAC1D;AAAA,QAAA,GACJ;AAAA,QAGJ,UAAA,gBAAAE;AAAA,UAAC;AAAA,UAAA;AAAA,YACI,GAAGhB;AAAA,YACJ,IAAAM;AAAA,YACA,MAAMA;AAAA,YACN,UAAAtB;AAAA,YACA,KAAKkC,EAAUjB,GAAKG,CAAQ;AAAA,YAC5B,iBAAe,CAAC,CAACJ,EAAM,SAAS;AAAA,YAChC,OAAO,OAAOA,EAAM,SAAU,WAAWA,EAAM,QAAQ;AAAA,YACvD,WAAWmB;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACAnB,EAAM;AAAA,YAAA;AAAA,YAGV,UAAA;AAAA,cAAA,gBAAAc,EAAC,UAAA,EAAO,OAAM,IAAG,UAAQ,IAAC,QAAM,IAC3B,YAAM,YAAA,CACX;AAAA,cACC7B,EAAQ,IAAI,CAACmC,MACV,gBAAAC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACI,GAAGD;AAAA,kBACJ,OAAOA,EAAO;AAAA,kBACd,UAAUA,EAAO,SAASA,EAAO;AAAA,kBACjC,KAAK,GAAGd,CAAE,kBAAkBc,EAAO,KAAK;AAAA,gBAAA;AAAA,cAAA,CAE/C;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACL;AAAA,IAAA;AAAA,EACJ;AAGZ;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x, useId as w, useState as p, useRef as C, useImperativeHandle as y, useEffect as v } from "react";
|
|
3
|
+
import { u as N } from "../../use-stable-ref-CYh-YkID.js";
|
|
4
|
+
import { c as E } from "../../dom-Dl8XH0CK.js";
|
|
5
|
+
const L = x(({ children: u, loading: s, container: h, error: f, ...e }, m) => {
|
|
6
|
+
const r = w(), [b, i] = p(e.checked ?? !1), c = b, t = C(null), d = N(e.onChange);
|
|
7
|
+
y(m, () => t.current), v(() => {
|
|
8
|
+
if (t.current !== null && d.current) {
|
|
9
|
+
const n = (g) => {
|
|
10
|
+
d.current && d.current(g);
|
|
11
|
+
}, l = t.current;
|
|
12
|
+
return l.addEventListener("change", n), () => l?.removeEventListener("change", n);
|
|
13
|
+
}
|
|
14
|
+
}, []);
|
|
15
|
+
const k = () => {
|
|
16
|
+
const n = !t.current?.checked;
|
|
17
|
+
i(n), e?.onCheck?.(n), t.current !== null && (t.current.checked = n, t.current.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ o("fieldset", { className: E("flex flex-col flex-wrap justify-center", h), "data-component": "switch", disabled: e.disabled || s, children: [
|
|
20
|
+
/* @__PURE__ */ o("span", { className: "flex flex-row flex-wrap items-center", children: [
|
|
21
|
+
/* @__PURE__ */ a(
|
|
22
|
+
"input",
|
|
23
|
+
{
|
|
24
|
+
...e,
|
|
25
|
+
hidden: !0,
|
|
26
|
+
ref: t,
|
|
27
|
+
type: "checkbox",
|
|
28
|
+
checked: c,
|
|
29
|
+
id: e.id || r,
|
|
30
|
+
"data-trigger": "change",
|
|
31
|
+
"data-checked": c,
|
|
32
|
+
disabled: e.disabled || s,
|
|
33
|
+
onChange: (n) => i(n.target.checked)
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ a(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
role: "switch",
|
|
41
|
+
onClick: k,
|
|
42
|
+
"aria-checked": c,
|
|
43
|
+
"data-checked": c,
|
|
44
|
+
"aria-labelledby": `${r}-label`,
|
|
45
|
+
disabled: e.disabled || s,
|
|
46
|
+
className: "relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 data-[checked=false]:bg-input-switch-bg data-[checked=true]:bg-primary",
|
|
47
|
+
children: /* @__PURE__ */ a(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
"data-checked": c,
|
|
52
|
+
className: "inline-block aspect-square size-5 transform rounded-full shadow ring-0 transition duration-300 ease-in-out data-[checked=false]:translate-x-0 data-[checked=true]:translate-x-5 data-[checked=false]:bg-disabled data-[checked=true]:bg-input-switch"
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ a("label", { htmlFor: e.id || r, className: "ml-3 inline-block text-sm", id: `${r}-label`, children: /* @__PURE__ */ a("span", { className: "font-medium text-foreground", children: u }) })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ a("span", { className: "mt-1 flex-1 whitespace-nowrap text-xs text-danger empty:mt-0 empty:hidden", children: f })
|
|
60
|
+
] });
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
L as Switch
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","sources":["../../../src/components/form/switch.tsx"],"sourcesContent":["\"use client\";\nimport React, { forwardRef, useEffect, useId, useImperativeHandle, useRef, useState } from \"react\";\nimport { useStableRef } from \"../../hooks/use-stable-ref\";\nimport { css } from \"../../lib/dom\";\n\nexport type SwitchProps = React.ComponentProps<\"input\"> & {\n error?: string;\n loading?: boolean;\n container?: string;\n onCheck?: (nextValue: boolean) => void;\n};\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(({ children, loading, container, error, ...props }: SwitchProps, ref) => {\n const id = useId();\n const [innerChecked, setInnerChecked] = useState(props.checked ?? false);\n const checked = innerChecked;\n const innerRef = useRef<HTMLInputElement>(null);\n const stableOnChange = useStableRef(props.onChange);\n useImperativeHandle(ref, () => innerRef.current!);\n\n useEffect(() => {\n if (innerRef.current !== null) {\n if (stableOnChange.current) {\n const onChange = (e: any) => {\n if (stableOnChange.current) stableOnChange.current(e);\n };\n const ref = innerRef.current;\n ref.addEventListener(\"change\", onChange);\n return () => ref?.removeEventListener(\"change\", onChange);\n }\n }\n }, []);\n\n const onCheck = () => {\n const checked = !innerRef.current?.checked;\n setInnerChecked(checked);\n props?.onCheck?.(checked);\n if (innerRef.current !== null) {\n innerRef.current.checked = checked;\n innerRef.current.dispatchEvent(new Event(\"change\", { bubbles: true }));\n }\n };\n\n return (\n <fieldset className={css(\"flex flex-col flex-wrap justify-center\", container)} data-component=\"switch\" disabled={props.disabled || loading}>\n <span className=\"flex flex-row flex-wrap items-center\">\n <input\n {...props}\n hidden\n ref={innerRef}\n type=\"checkbox\"\n checked={checked}\n id={props.id || id}\n data-trigger=\"change\"\n data-checked={checked}\n disabled={props.disabled || loading}\n onChange={(e) => setInnerChecked(e.target.checked)}\n />\n <button\n type=\"button\"\n role=\"switch\"\n onClick={onCheck}\n aria-checked={checked}\n data-checked={checked}\n aria-labelledby={`${id}-label`}\n disabled={props.disabled || loading}\n className=\"relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 data-[checked=false]:bg-input-switch-bg data-[checked=true]:bg-primary\"\n >\n <span\n aria-hidden=\"true\"\n data-checked={checked}\n className=\"inline-block aspect-square size-5 transform rounded-full shadow ring-0 transition duration-300 ease-in-out data-[checked=false]:translate-x-0 data-[checked=true]:translate-x-5 data-[checked=false]:bg-disabled data-[checked=true]:bg-input-switch\"\n />\n </button>\n <label htmlFor={props.id || id} className=\"ml-3 inline-block text-sm\" id={`${id}-label`}>\n <span className=\"font-medium text-foreground\">{children}</span>\n </label>\n </span>\n <span className=\"mt-1 flex-1 whitespace-nowrap text-xs text-danger empty:mt-0 empty:hidden\">{error}</span>\n </fieldset>\n );\n});\n"],"names":["Switch","forwardRef","children","loading","container","error","props","ref","id","useId","innerChecked","setInnerChecked","useState","checked","innerRef","useRef","stableOnChange","useStableRef","useImperativeHandle","useEffect","onChange","e","onCheck","jsxs","css","jsx"],"mappings":";;;;AAYO,MAAMA,IAASC,EAA0C,CAAC,EAAE,UAAAC,GAAU,SAAAC,GAAS,WAAAC,GAAW,OAAAC,GAAO,GAAGC,EAAA,GAAsBC,MAAQ;AACrI,QAAMC,IAAKC,EAAA,GACL,CAACC,GAAcC,CAAe,IAAIC,EAASN,EAAM,WAAW,EAAK,GACjEO,IAAUH,GACVI,IAAWC,EAAyB,IAAI,GACxCC,IAAiBC,EAAaX,EAAM,QAAQ;AAClD,EAAAY,EAAoBX,GAAK,MAAMO,EAAS,OAAQ,GAEhDK,EAAU,MAAM;AACZ,QAAIL,EAAS,YAAY,QACjBE,EAAe,SAAS;AACxB,YAAMI,IAAW,CAACC,MAAW;AACzB,QAAIL,EAAe,WAASA,EAAe,QAAQK,CAAC;AAAA,MAAA,GAElDd,IAAMO,EAAS;AACrBP,aAAAA,EAAI,iBAAiB,UAAUa,CAAQ,GAChC,MAAMb,GAAK,oBAAoB,UAAUa,CAAQ;AAAA,IAAA;AAAA,EAEhE,GACD,EAAE;AAEL,QAAME,IAAU,MAAM;AAClB,UAAMT,IAAU,CAACC,EAAS,SAAS;AACnC,IAAAH,EAAgBE,CAAO,GACvBP,GAAO,UAAUO,CAAO,GACpBC,EAAS,YAAY,SACrBA,EAAS,QAAQ,UAAUD,GAC3BC,EAAS,QAAQ,cAAc,IAAI,MAAM,UAAU,EAAE,SAAS,GAAA,CAAM,CAAC;AAAA,EACzE;AAGJ,SACI,gBAAAS,EAAC,YAAA,EAAS,WAAWC,EAAI,0CAA0CpB,CAAS,GAAG,kBAAe,UAAS,UAAUE,EAAM,YAAYH,GAC/H,UAAA;AAAA,IAAA,gBAAAoB,EAAC,QAAA,EAAK,WAAU,wCACZ,UAAA;AAAA,MAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACI,GAAGnB;AAAA,UACJ,QAAM;AAAA,UACN,KAAKQ;AAAA,UACL,MAAK;AAAA,UACL,SAAAD;AAAA,UACA,IAAIP,EAAM,MAAME;AAAA,UAChB,gBAAa;AAAA,UACb,gBAAcK;AAAA,UACd,UAAUP,EAAM,YAAYH;AAAA,UAC5B,UAAU,CAACkB,MAAMV,EAAgBU,EAAE,OAAO,OAAO;AAAA,QAAA;AAAA,MAAA;AAAA,MAErD,gBAAAI;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,MAAK;AAAA,UACL,SAASH;AAAA,UACT,gBAAcT;AAAA,UACd,gBAAcA;AAAA,UACd,mBAAiB,GAAGL,CAAE;AAAA,UACtB,UAAUF,EAAM,YAAYH;AAAA,UAC5B,WAAU;AAAA,UAEV,UAAA,gBAAAsB;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,eAAY;AAAA,cACZ,gBAAcZ;AAAA,cACd,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACd;AAAA,MAAA;AAAA,wBAEH,SAAA,EAAM,SAASP,EAAM,MAAME,GAAI,WAAU,6BAA4B,IAAI,GAAGA,CAAE,UAC3E,UAAA,gBAAAiB,EAAC,UAAK,WAAU,+BAA+B,UAAAvB,GAAS,EAAA,CAC5D;AAAA,IAAA,GACJ;AAAA,IACA,gBAAAuB,EAAC,QAAA,EAAK,WAAU,6EAA6E,UAAApB,EAAA,CAAM;AAAA,EAAA,GACvG;AAER,CAAC;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as f, useState as m, useContext as p, useMemo as M } from "react";
|
|
3
|
+
import { e as g, h, i as x, p as y, w as v, M as E, u as R } from "../../MotionConfigContext-C7MqlSdv.js";
|
|
4
|
+
import { c as k } from "../../index-t1qLJTt5.js";
|
|
5
|
+
function C(e, n) {
|
|
6
|
+
if (e === "first")
|
|
7
|
+
return 0;
|
|
8
|
+
{
|
|
9
|
+
const t = n - 1;
|
|
10
|
+
return e === "last" ? t : t / 2;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function A(e = 0.1, { startDelay: n = 0, from: t = 0, ease: o } = {}) {
|
|
14
|
+
return (i, a) => {
|
|
15
|
+
const u = typeof t == "number" ? t : C(t, a), c = Math.abs(u - i);
|
|
16
|
+
let r = e * c;
|
|
17
|
+
if (o) {
|
|
18
|
+
const s = a * e;
|
|
19
|
+
r = g(o)(r / s) * s;
|
|
20
|
+
}
|
|
21
|
+
return n + r;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function b(e) {
|
|
25
|
+
return f(() => () => e(), []);
|
|
26
|
+
}
|
|
27
|
+
function L() {
|
|
28
|
+
!h.current && x();
|
|
29
|
+
const [e] = m(y.current);
|
|
30
|
+
return process.env.NODE_ENV !== "production" && v(e !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), e;
|
|
31
|
+
}
|
|
32
|
+
function O() {
|
|
33
|
+
const e = L(), { reducedMotion: n } = p(E);
|
|
34
|
+
return n === "never" ? !1 : n === "always" ? !0 : e;
|
|
35
|
+
}
|
|
36
|
+
function w() {
|
|
37
|
+
const e = R(() => ({
|
|
38
|
+
current: null,
|
|
39
|
+
// Will be hydrated by React
|
|
40
|
+
animations: []
|
|
41
|
+
})), n = O() ?? void 0, t = M(() => k({ scope: e, reduceMotion: n }), [e, n]);
|
|
42
|
+
return b(() => {
|
|
43
|
+
e.animations.forEach((o) => o.stop()), e.animations.length = 0;
|
|
44
|
+
}), [e, t];
|
|
45
|
+
}
|
|
46
|
+
const T = (e) => {
|
|
47
|
+
const [n, t] = w();
|
|
48
|
+
return f(() => {
|
|
49
|
+
const o = n.current;
|
|
50
|
+
if (!o) return;
|
|
51
|
+
const i = (a) => {
|
|
52
|
+
const u = a.target, c = Array.from(o.querySelectorAll("input[data-task=true]")), r = c.every((d) => d.checked), s = c.indexOf(u);
|
|
53
|
+
r && s !== -1 && t(
|
|
54
|
+
"input",
|
|
55
|
+
{ scale: [1, 1.35, 1], rotate: [0, 20, -20, 0] },
|
|
56
|
+
{
|
|
57
|
+
duration: 0.5,
|
|
58
|
+
delay: A(0.075, { from: s })
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
return o.addEventListener("change", i), () => o.removeEventListener("change", i);
|
|
63
|
+
}, []), /* @__PURE__ */ l("fieldset", { ...e, "data-component": "task-list", ref: n });
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
T as TaskList
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=task-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-list.js","sources":["../../../node_modules/motion-dom/dist/es/utils/stagger.mjs","../../../node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs","../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs","../../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs","../../../node_modules/framer-motion/dist/es/animation/hooks/use-animate.mjs","../../../src/components/form/task-list.tsx"],"sourcesContent":["import { easingDefinitionToFunction } from 'motion-utils';\n\nfunction getOriginIndex(from, total) {\n if (from === \"first\") {\n return 0;\n }\n else {\n const lastIndex = total - 1;\n return from === \"last\" ? lastIndex : lastIndex / 2;\n }\n}\nfunction stagger(duration = 0.1, { startDelay = 0, from = 0, ease } = {}) {\n return (i, total) => {\n const fromIndex = typeof from === \"number\" ? from : getOriginIndex(from, total);\n const distance = Math.abs(fromIndex - i);\n let delay = duration * distance;\n if (ease) {\n const maxDelay = total * duration;\n const easingFunction = easingDefinitionToFunction(ease);\n delay = easingFunction(delay / maxDelay) * maxDelay;\n }\n return startDelay + delay;\n };\n}\n\nexport { getOriginIndex, stagger };\n//# sourceMappingURL=stagger.mjs.map\n","\"use client\";\nimport { useEffect } from 'react';\n\nfunction useUnmountEffect(callback) {\n return useEffect(() => () => callback(), []);\n}\n\nexport { useUnmountEffect };\n//# sourceMappingURL=use-unmount-effect.mjs.map\n","\"use client\";\nimport { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion } from 'motion-dom';\nimport { warnOnce } from 'motion-utils';\nimport { useState } from 'react';\n\n/**\n * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting.\n *\n * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing\n * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion.\n *\n * It will actively respond to changes and re-render your components with the latest setting.\n *\n * ```jsx\n * export function Sidebar({ isOpen }) {\n * const shouldReduceMotion = useReducedMotion()\n * const closedX = shouldReduceMotion ? 0 : \"-100%\"\n *\n * return (\n * <motion.div animate={{\n * opacity: isOpen ? 1 : 0,\n * x: isOpen ? 0 : closedX\n * }} />\n * )\n * }\n * ```\n *\n * @return boolean\n *\n * @public\n */\nfunction useReducedMotion() {\n /**\n * Lazy initialisation of prefersReducedMotion\n */\n !hasReducedMotionListener.current && initPrefersReducedMotion();\n const [shouldReduceMotion] = useState(prefersReducedMotion.current);\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(shouldReduceMotion !== true, \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\", \"reduced-motion-disabled\");\n }\n /**\n * TODO See if people miss automatically updating shouldReduceMotion setting\n */\n return shouldReduceMotion;\n}\n\nexport { useReducedMotion };\n//# sourceMappingURL=use-reduced-motion.mjs.map\n","\"use client\";\nimport { useContext } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\nimport { useReducedMotion } from './use-reduced-motion.mjs';\n\nfunction useReducedMotionConfig() {\n const reducedMotionPreference = useReducedMotion();\n const { reducedMotion } = useContext(MotionConfigContext);\n if (reducedMotion === \"never\") {\n return false;\n }\n else if (reducedMotion === \"always\") {\n return true;\n }\n else {\n return reducedMotionPreference;\n }\n}\n\nexport { useReducedMotionConfig };\n//# sourceMappingURL=use-reduced-motion-config.mjs.map\n","\"use client\";\nimport { useMemo } from 'react';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { useUnmountEffect } from '../../utils/use-unmount-effect.mjs';\nimport { useReducedMotionConfig } from '../../utils/reduced-motion/use-reduced-motion-config.mjs';\nimport { createScopedAnimate } from '../animate/index.mjs';\n\nfunction useAnimate() {\n const scope = useConstant(() => ({\n current: null, // Will be hydrated by React\n animations: [],\n }));\n const reduceMotion = useReducedMotionConfig() ?? undefined;\n const animate = useMemo(() => createScopedAnimate({ scope, reduceMotion }), [scope, reduceMotion]);\n useUnmountEffect(() => {\n scope.animations.forEach((animation) => animation.stop());\n scope.animations.length = 0;\n });\n return [scope, animate];\n}\n\nexport { useAnimate };\n//# sourceMappingURL=use-animate.mjs.map\n","\"use client\";\nimport { stagger, useAnimate } from \"motion/react\";\nimport { ComponentProps, PropsWithChildren, useEffect } from \"react\";\n\nexport const TaskList = (props: PropsWithChildren<ComponentProps<\"fieldset\">>) => {\n const [ref, animate] = useAnimate();\n\n useEffect(() => {\n const container = ref.current as HTMLFieldSetElement | null;\n if (!container) return;\n const handler = (e: Event) => {\n const input = e.target as HTMLInputElement;\n const items = Array.from(container.querySelectorAll(\"input[data-task=true]\")) as HTMLInputElement[];\n const allTaskChecked = items.every((el) => el.checked);\n const index = items.indexOf(input);\n if (allTaskChecked && index !== -1) {\n animate(\n \"input\",\n { scale: [1, 1.35, 1], rotate: [0, 20, -20, 0] },\n {\n duration: 0.5,\n delay: stagger(0.075, { from: index }),\n }\n );\n }\n };\n container.addEventListener(\"change\", handler);\n return () => container.removeEventListener(\"change\", handler);\n }, []);\n\n return <fieldset {...props} data-component=\"task-list\" ref={ref} />;\n};\n"],"names":["getOriginIndex","from","total","lastIndex","stagger","duration","startDelay","ease","fromIndex","distance","delay","maxDelay","easingDefinitionToFunction","useUnmountEffect","callback","useEffect","useReducedMotion","hasReducedMotionListener","initPrefersReducedMotion","shouldReduceMotion","useState","prefersReducedMotion","warnOnce","useReducedMotionConfig","reducedMotionPreference","reducedMotion","useContext","MotionConfigContext","useAnimate","scope","useConstant","reduceMotion","animate","useMemo","createScopedAnimate","animation","TaskList","props","ref","container","handler","e","input","items","allTaskChecked","el","index"],"mappings":";;;;AAEA,SAASA,EAAeC,GAAMC,GAAO;AACjC,MAAID,MAAS;AACT,WAAO;AAEN;AACD,UAAME,IAAYD,IAAQ;AAC1B,WAAOD,MAAS,SAASE,IAAYA,IAAY;AAAA,EACzD;AACA;AACA,SAASC,EAAQC,IAAW,KAAK,EAAE,YAAAC,IAAa,GAAG,MAAAL,IAAO,GAAG,MAAAM,EAAI,IAAK,IAAI;AACtE,SAAO,CAAC,GAAGL,MAAU;AACjB,UAAMM,IAAY,OAAOP,KAAS,WAAWA,IAAOD,EAAeC,GAAMC,CAAK,GACxEO,IAAW,KAAK,IAAID,IAAY,CAAC;AACvC,QAAIE,IAAQL,IAAWI;AACvB,QAAIF,GAAM;AACN,YAAMI,IAAWT,IAAQG;AAEzB,MAAAK,IADuBE,EAA2BL,CAAI,EAC/BG,IAAQC,CAAQ,IAAIA;AAAA,IACvD;AACQ,WAAOL,IAAaI;AAAA,EAC5B;AACA;ACpBA,SAASG,EAAiBC,GAAU;AAChC,SAAOC,EAAU,MAAM,MAAMD,EAAQ,GAAI,CAAA,CAAE;AAC/C;AC0BA,SAASE,IAAmB;AAIxB,GAACC,EAAyB,WAAWC,EAAwB;AAC7D,QAAM,CAACC,CAAkB,IAAIC,EAASC,EAAqB,OAAO;AAClE,SAAI,QAAQ,IAAI,aAAa,gBACzBC,EAASH,MAAuB,IAAM,0FAA0F,yBAAyB,GAKtJA;AACX;ACvCA,SAASI,IAAyB;AAC9B,QAAMC,IAA0BR,EAAgB,GAC1C,EAAE,eAAAS,EAAa,IAAKC,EAAWC,CAAmB;AACxD,SAAIF,MAAkB,UACX,KAEFA,MAAkB,WAChB,KAGAD;AAEf;ACVA,SAASI,IAAa;AAClB,QAAMC,IAAQC,EAAY,OAAO;AAAA,IAC7B,SAAS;AAAA;AAAA,IACT,YAAY,CAAA;AAAA,EACpB,EAAM,GACIC,IAAeR,EAAsB,KAAM,QAC3CS,IAAUC,EAAQ,MAAMC,EAAoB,EAAE,OAAAL,GAAO,cAAAE,EAAY,CAAE,GAAG,CAACF,GAAOE,CAAY,CAAC;AACjG,SAAAlB,EAAiB,MAAM;AACnB,IAAAgB,EAAM,WAAW,QAAQ,CAACM,MAAcA,EAAU,MAAM,GACxDN,EAAM,WAAW,SAAS;AAAA,EAClC,CAAK,GACM,CAACA,GAAOG,CAAO;AAC1B;ACfO,MAAMI,IAAW,CAACC,MAAyD;AAC9E,QAAM,CAACC,GAAKN,CAAO,IAAIJ,EAAA;AAEvB,SAAAb,EAAU,MAAM;AACZ,UAAMwB,IAAYD,EAAI;AACtB,QAAI,CAACC,EAAW;AAChB,UAAMC,IAAU,CAACC,MAAa;AAC1B,YAAMC,IAAQD,EAAE,QACVE,IAAQ,MAAM,KAAKJ,EAAU,iBAAiB,uBAAuB,CAAC,GACtEK,IAAiBD,EAAM,MAAM,CAACE,MAAOA,EAAG,OAAO,GAC/CC,IAAQH,EAAM,QAAQD,CAAK;AACjC,MAAIE,KAAkBE,MAAU,MAC5Bd;AAAA,QACI;AAAA,QACA,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,IAAI,KAAK,CAAC,EAAA;AAAA,QAC7C;AAAA,UACI,UAAU;AAAA,UACV,OAAO5B,EAAQ,OAAO,EAAE,MAAM0C,GAAO;AAAA,QAAA;AAAA,MACzC;AAAA,IAER;AAEJ,WAAAP,EAAU,iBAAiB,UAAUC,CAAO,GACrC,MAAMD,EAAU,oBAAoB,UAAUC,CAAO;AAAA,EAAA,GAC7D,EAAE,qBAEG,YAAA,EAAU,GAAGH,GAAO,kBAAe,aAAY,KAAAC,GAAU;AACrE;","x_google_ignoreList":[0,1,2,3,4]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { e as l } from "../../CaretRight.es-0-M8D9y8.js";
|
|
3
|
+
import { useState as d, useEffect as m, forwardRef as a, useRef as f, Fragment as u } from "react";
|
|
4
|
+
import { Y as p } from "../../index-C-PuFUZi.js";
|
|
5
|
+
import { Button as h } from "../core/button.js";
|
|
6
|
+
import { Checkbox as b } from "./checkbox.js";
|
|
7
|
+
import { I as x } from "../../input-CrGrSnUt.js";
|
|
8
|
+
const g = (n) => {
|
|
9
|
+
const [r, t] = d(0);
|
|
10
|
+
return m(() => {
|
|
11
|
+
const s = n.current;
|
|
12
|
+
if (!s) return;
|
|
13
|
+
const o = s.parentElement;
|
|
14
|
+
if (!o) return;
|
|
15
|
+
const i = () => {
|
|
16
|
+
t(o.clientHeight);
|
|
17
|
+
};
|
|
18
|
+
return o.addEventListener("resize", i), i(), () => {
|
|
19
|
+
o.removeEventListener("resize", i);
|
|
20
|
+
};
|
|
21
|
+
}, []), r;
|
|
22
|
+
}, v = {
|
|
23
|
+
Item: a(function(r, t) {
|
|
24
|
+
return /* @__PURE__ */ e("li", { ...r, ref: t, className: "flex items-center justify-between gap-1" });
|
|
25
|
+
}),
|
|
26
|
+
List: a(function(r, t) {
|
|
27
|
+
return /* @__PURE__ */ e("ul", { ...r, ref: t, className: "space-y-3" });
|
|
28
|
+
})
|
|
29
|
+
}, H = (n) => {
|
|
30
|
+
const r = f(null), t = g(r);
|
|
31
|
+
return /* @__PURE__ */ c("div", { className: "flex flex-row gap-4", ref: r, children: [
|
|
32
|
+
/* @__PURE__ */ c("div", { className: "flex w-fit min-w-64 flex-col space-y-4 whitespace-nowrap rounded-lg border border-card-border py-8", children: [
|
|
33
|
+
/* @__PURE__ */ e("header", { className: "border-b border-card-border pb-2" }),
|
|
34
|
+
/* @__PURE__ */ c("div", { className: "space-y-2 px-8", children: [
|
|
35
|
+
/* @__PURE__ */ e(x, { rightLabel: "", title: "Search", placeholder: "Looking for..." }),
|
|
36
|
+
/* @__PURE__ */ e(
|
|
37
|
+
p,
|
|
38
|
+
{
|
|
39
|
+
height: t,
|
|
40
|
+
useWindowScroll: !0,
|
|
41
|
+
data: n.source,
|
|
42
|
+
components: v,
|
|
43
|
+
itemContent: (s, o) => /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(n.Item, { data: o }) }) })
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(l, {}) }) }),
|
|
49
|
+
/* @__PURE__ */ e("div", {})
|
|
50
|
+
] });
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
H as TransferList
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=transfer-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transfer-list.js","sources":["../../../src/hooks/use-parent.ts","../../../src/components/form/transfer-list.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\n\nexport const useParentHeight = (ref: React.RefObject<HTMLElement>) => {\n const [h, setH] = useState(0);\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n const parent = element.parentElement;\n if (!parent) return;\n const listener = () => {\n setH(parent.clientHeight);\n };\n parent.addEventListener(\"resize\", listener);\n listener();\n return () => {\n parent.removeEventListener(\"resize\", listener);\n };\n }, []);\n return h;\n};\n","\"use client\";\nimport { CaretRightIcon } from \"@phosphor-icons/react\";\nimport React, { forwardRef, Fragment, useRef } from \"react\";\nimport { Virtuoso } from \"react-virtuoso\";\nimport { useParentHeight } from \"../../hooks/use-parent\";\nimport { POJO, SetState } from \"../../types\";\nimport { Button } from \"../core/button\";\nimport { Checkbox } from \"../form/checkbox\";\nimport { Input } from \"./input\";\n\nexport type TransferListProps<T> = {\n source: T[];\n target: T[];\n Item: React.FC<{ data: T }>;\n reference: keyof T;\n setSource: SetState<T[]>;\n setTarget: SetState<T[]>;\n};\n\nconst components = {\n Item: forwardRef(function InnerList(props: any, ref) {\n return <li {...props} ref={ref} className=\"flex items-center justify-between gap-1\" />;\n }),\n List: forwardRef(function InnerList(props: any, ref) {\n return <ul {...props} ref={ref} className=\"space-y-3\" />;\n }),\n};\n\nexport const TransferList = <T extends POJO, K extends keyof T>(props: TransferListProps<T>) => {\n const ref = useRef<HTMLDivElement>(null!);\n const h = useParentHeight(ref);\n return (\n <div className=\"flex flex-row gap-4\" ref={ref}>\n <div className=\"flex w-fit min-w-64 flex-col space-y-4 whitespace-nowrap rounded-lg border border-card-border py-8\">\n <header className=\"border-b border-card-border pb-2\"></header>\n <div className=\"space-y-2 px-8\">\n <Input rightLabel=\"\" title=\"Search\" placeholder=\"Looking for...\" />\n <Virtuoso\n height={h}\n useWindowScroll\n data={props.source}\n components={components as any}\n itemContent={(_, row) => (\n <Fragment>\n <Checkbox>\n <props.Item data={row} />\n </Checkbox>\n </Fragment>\n )}\n />\n </div>\n </div>\n <div>\n <Button>\n <CaretRightIcon />\n </Button>\n </div>\n <div></div>\n </div>\n );\n};\n"],"names":["useParentHeight","ref","h","setH","useState","useEffect","element","parent","listener","components","forwardRef","props","TransferList","useRef","jsxs","jsx","Input","Virtuoso","_","row","Fragment","Checkbox","Button","CaretRightIcon"],"mappings":";;;;;;;AAEO,MAAMA,IAAkB,CAACC,MAAsC;AAClE,QAAM,CAACC,GAAGC,CAAI,IAAIC,EAAS,CAAC;AAC5B,SAAAC,EAAU,MAAM;AACZ,UAAMC,IAAUL,EAAI;AACpB,QAAI,CAACK,EAAS;AACd,UAAMC,IAASD,EAAQ;AACvB,QAAI,CAACC,EAAQ;AACb,UAAMC,IAAW,MAAM;AACnB,MAAAL,EAAKI,EAAO,YAAY;AAAA,IAAA;AAE5B,WAAAA,EAAO,iBAAiB,UAAUC,CAAQ,GAC1CA,EAAA,GACO,MAAM;AACT,MAAAD,EAAO,oBAAoB,UAAUC,CAAQ;AAAA,IAAA;AAAA,EACjD,GACD,EAAE,GACEN;AACX,GCAMO,IAAa;AAAA,EACf,MAAMC,EAAW,SAAmBC,GAAYV,GAAK;AACjD,6BAAQ,MAAA,EAAI,GAAGU,GAAO,KAAAV,GAAU,WAAU,2CAA0C;AAAA,EAAA,CACvF;AAAA,EACD,MAAMS,EAAW,SAAmBC,GAAYV,GAAK;AACjD,6BAAQ,MAAA,EAAI,GAAGU,GAAO,KAAAV,GAAU,WAAU,aAAY;AAAA,EAAA,CACzD;AACL,GAEaW,IAAe,CAAoCD,MAAgC;AAC5F,QAAMV,IAAMY,EAAuB,IAAK,GAClCX,IAAIF,EAAgBC,CAAG;AAC7B,SACI,gBAAAa,EAAC,OAAA,EAAI,WAAU,uBAAsB,KAAAb,GACjC,UAAA;AAAA,IAAA,gBAAAa,EAAC,OAAA,EAAI,WAAU,sGACX,UAAA;AAAA,MAAA,gBAAAC,EAAC,UAAA,EAAO,WAAU,mCAAA,CAAmC;AAAA,MACrD,gBAAAD,EAAC,OAAA,EAAI,WAAU,kBACX,UAAA;AAAA,QAAA,gBAAAC,EAACC,KAAM,YAAW,IAAG,OAAM,UAAS,aAAY,kBAAiB;AAAA,QACjE,gBAAAD;AAAA,UAACE;AAAAA,UAAA;AAAA,YACG,QAAQf;AAAA,YACR,iBAAe;AAAA,YACf,MAAMS,EAAM;AAAA,YACZ,YAAAF;AAAA,YACA,aAAa,CAACS,GAAGC,wBACZC,GAAA,EACG,UAAA,gBAAAL,EAACM,GAAA,EACG,UAAA,gBAAAN,EAACJ,EAAM,MAAN,EAAW,MAAMQ,EAAA,CAAK,GAC3B,EAAA,CACJ;AAAA,UAAA;AAAA,QAAA;AAAA,MAER,EAAA,CACJ;AAAA,IAAA,GACJ;AAAA,sBACC,OAAA,EACG,UAAA,gBAAAJ,EAACO,KACG,UAAA,gBAAAP,EAACQ,GAAA,EAAe,GACpB,EAAA,CACJ;AAAA,sBACC,OAAA,CAAA,CAAI;AAAA,EAAA,GACT;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-header.d.ts","sourceRoot":"","sources":["../../../src/components/page-calendar/calendar-header.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhD,KAAK,mBAAmB,GAAG;IACvB,WAAW,EAAE,IAAI,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,cAAc,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC3B,WAAW,EACX,WAAW,EACX,OAAO,EACP,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,GACb,EAAE,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"calendar-header.d.ts","sourceRoot":"","sources":["../../../src/components/page-calendar/calendar-header.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhD,KAAK,mBAAmB,GAAG;IACvB,WAAW,EAAE,IAAI,CAAC;IAClB,WAAW,EAAE,QAAQ,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,cAAc,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,cAAc,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC3B,WAAW,EACX,WAAW,EACX,OAAO,EACP,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,GACb,EAAE,mBAAmB,+BAuHrB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../../index-Z-fZHxfJ.js";
|
|
4
|
+
import "../../input-field-5vYcz5tT.js";
|
|
5
|
+
import { T as e } from "../../index-BelDtX5M.js";
|
|
6
|
+
import "../../proxy-BZcQiBrp.js";
|
|
7
|
+
export {
|
|
8
|
+
e as Table
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/dist/config/context.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IconProps } from "@phosphor-icons/react";
|
|
1
2
|
import type { Locales } from "the-mask-input";
|
|
2
3
|
import { parsers } from "../styles/design-tokens";
|
|
3
4
|
import { type Translations } from "./default-translations";
|
|
@@ -8,6 +9,7 @@ export type ContextProps = Partial<{
|
|
|
8
9
|
locale: Locales | undefined;
|
|
9
10
|
parser: typeof parsers.hsla;
|
|
10
11
|
rootFloating?: HTMLElement | null;
|
|
12
|
+
iconWeight: IconProps["weight"];
|
|
11
13
|
}>;
|
|
12
14
|
export declare const Context: import("react").Context<Partial<{
|
|
13
15
|
tweaks: Tweaks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/config/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/config/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;CACnC,CAAC,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;GAMlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-r-AHn273.js","sources":["../src/constants.ts"],"sourcesContent":["export const FLOATING_DELAY = 200;\n\nexport const TYPEAHEAD_RESET_DELAY = 500;\n"],"names":["FLOATING_DELAY","TYPEAHEAD_RESET_DELAY"],"mappings":"AAAO,MAAMA,IAAiB,KAEjBC,IAAwB;"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Fragment as g, createContext as h } from "react";
|
|
2
|
+
import { jsxs as C } from "react/jsx-runtime";
|
|
3
|
+
const y = {
|
|
4
|
+
hex: (e) => e,
|
|
5
|
+
raw: (e) => e,
|
|
6
|
+
hsl: (e) => `hsl(${e})`,
|
|
7
|
+
rgb: (e) => `rgb(${e})`,
|
|
8
|
+
z: (e, t, a) => `var(--z-${a})`,
|
|
9
|
+
hsla: (e) => `hsla(${e})`,
|
|
10
|
+
rgba: (e) => `rgba(${e})`,
|
|
11
|
+
cssVariable: (e, t, a) => `var(--${a})`,
|
|
12
|
+
formatWithVar: (e) => (t, a, r) => `${e}(var(--${r}), <alpha-value>)`
|
|
13
|
+
}, i = (e, t, a = "", r = "") => Object.entries(e).reduce((l, [o, n]) => {
|
|
14
|
+
const s = r === "" ? `${a}${o}` : `${r}-${o}`;
|
|
15
|
+
if (typeof n == "string") {
|
|
16
|
+
const u = r === "" ? `${a}${o}` : o;
|
|
17
|
+
return l.concat(t(n, u, s));
|
|
18
|
+
}
|
|
19
|
+
return l.concat(i(n, t, a, s));
|
|
20
|
+
}, []), $ = (e, t, a = "", r = "") => Object.entries(e).reduce((l, [o, n]) => {
|
|
21
|
+
const s = r === "" ? `${a}${o}` : `${r}-${o}`;
|
|
22
|
+
if (typeof n == "string") {
|
|
23
|
+
const u = r === "" ? `${a}${o}` : o;
|
|
24
|
+
return { ...l, [u]: t(n, o, s) };
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
...l,
|
|
28
|
+
[o]: $(n, t, a, s)
|
|
29
|
+
};
|
|
30
|
+
}, {}), p = {
|
|
31
|
+
default: (e) => `:root { ${e} }`,
|
|
32
|
+
dark: (e) => `html.dark {${e}}`
|
|
33
|
+
}, c = (e, t) => {
|
|
34
|
+
const a = t.value || ((l, o) => o), r = e.map((l) => `${l.key}: ${a(l.key, l.value)}`).join(";");
|
|
35
|
+
return t.result(r);
|
|
36
|
+
}, S = {
|
|
37
|
+
default: (e) => c(e, { result: p.default }),
|
|
38
|
+
dark: (e) => c(e, { result: p.dark })
|
|
39
|
+
}, d = (e) => (t, a, r) => {
|
|
40
|
+
const l = { key: `--${r}`, value: `${t}` };
|
|
41
|
+
return e ? e(l) : l;
|
|
42
|
+
}, T = (e) => ({ key: e.key.replace(/^--/, "--z-"), value: e.value }), b = (e, t) => {
|
|
43
|
+
const a = i(e.colors, d(t?.colors)), r = i(e.spacing, d(t?.spacing)), l = i(e.rounded, d(t?.rounded)), o = i(e.shadow, d(t?.rounded)), n = i(e.zIndex, d(t?.zIndex ?? T)), s = e.custom ? i(e.custom, d(t?.customTokens)) : [];
|
|
44
|
+
return a.concat(r, l, s, n, o);
|
|
45
|
+
}, w = (e, t) => c(b(e), {
|
|
46
|
+
result: (a) => `html${t ? `.${t}` : ""} {${a}}`,
|
|
47
|
+
value: (a, r) => r.replace("hsla(", "").replace(")", "")
|
|
48
|
+
}), f = (e, t) => b(e, t).reduce((r, l) => ({ ...r, [l.key]: l.value }), {}), P = (e, t) => c(b(e, t), {
|
|
49
|
+
result: (a) => `html${t?.name ? `.${t.name}` : ""} {${a}}`,
|
|
50
|
+
value: (a, r) => r
|
|
51
|
+
}), F = {
|
|
52
|
+
autocompleteEmpty: "Nothing here...",
|
|
53
|
+
calendarBackMonth: "Back month",
|
|
54
|
+
calendarFromDate: "From",
|
|
55
|
+
calendarMonthLabel: "Month",
|
|
56
|
+
calendarNextMonth: "Next month",
|
|
57
|
+
calendarDatetimeTitle: "Time",
|
|
58
|
+
calendarToDate: "To",
|
|
59
|
+
calendarToday: "Today",
|
|
60
|
+
pageCalendarMonthView: "Month view",
|
|
61
|
+
pageCalendarWeekView: "Week view",
|
|
62
|
+
pageCalendarDayView: "Day view",
|
|
63
|
+
pageCalendarPrevious: "Previous",
|
|
64
|
+
pageCalendarNext: "Next",
|
|
65
|
+
pageCalendarToday: "Today",
|
|
66
|
+
pageCalendarAddEvent: "Add event",
|
|
67
|
+
pageCalendarWeekLabel: (e) => `Week ${e}`,
|
|
68
|
+
pageCalendarFilter: "Filter:",
|
|
69
|
+
pageCalendarMoreEvents: (e) => `+${e} more...`,
|
|
70
|
+
pageCalendarLabel: "Calendar",
|
|
71
|
+
pageCalendarNavigation: "Calendar navigation",
|
|
72
|
+
pageCalendarMonthGrid: "Calendar month",
|
|
73
|
+
pageCalendarFilterEnabled: "enabled",
|
|
74
|
+
pageCalendarFilterDisabled: "disabled",
|
|
75
|
+
pageCalendarEventCount: (e) => e === 1 ? "1 event" : `${e} events`,
|
|
76
|
+
pageCalendarEventAt: (e, t) => `${e} at ${t}`,
|
|
77
|
+
commandPaletteEmpty: "Nothing here...",
|
|
78
|
+
commandPaletteLoading: "Loading...",
|
|
79
|
+
datePickerCalendarButtonLabel: "Click to open a date picker",
|
|
80
|
+
emptyDataMessage: "No data",
|
|
81
|
+
inputCaretDown: "Click to see all options",
|
|
82
|
+
inputCloseValue: "Click to clear the value",
|
|
83
|
+
inputOptionalLabel: "Optional",
|
|
84
|
+
wizardNext: "Next",
|
|
85
|
+
wizardPrev: "Previous",
|
|
86
|
+
wizardFinish: "Finish",
|
|
87
|
+
wizardSkip: "Skip",
|
|
88
|
+
multiSelectInnerPlaceholder: "Search...",
|
|
89
|
+
multiSelectSelectedLabel: "Selected",
|
|
90
|
+
tableColumnResizer: "Resize column",
|
|
91
|
+
tableFilterColumnPlaceholder: "Filter by",
|
|
92
|
+
tableFilterColumnTitle: "Filter by",
|
|
93
|
+
tableFilterDropdownTitle: "Filters",
|
|
94
|
+
tableFilterDropdownTitleUnique: "Filter by",
|
|
95
|
+
tableFilterLabel: "Filters",
|
|
96
|
+
tableFilterNewFilter: "New filter",
|
|
97
|
+
tableFilterOperatorPlaceholder: "Equals to...",
|
|
98
|
+
tableFilterOperatorTitle: "Operation",
|
|
99
|
+
tableFilterTypeContains: "Contains",
|
|
100
|
+
tableFilterTypeEndsWith: "Ends with",
|
|
101
|
+
tableFilterTypeGreaterThan: "Greater than",
|
|
102
|
+
tableFilterTypeIs: "Is",
|
|
103
|
+
tableFilterTypeIsNot: "Is not",
|
|
104
|
+
tableFilterTypeLessThan: "Less than",
|
|
105
|
+
tableFilterTypeNotContains: "Not contains",
|
|
106
|
+
tableFilterTypeStartsWith: "Starts with",
|
|
107
|
+
tableFilterValuePlaceholder: "Something...",
|
|
108
|
+
tableFilterValueTitle: "Value",
|
|
109
|
+
tableGroupLabel: "Group",
|
|
110
|
+
tableGroupLabelWithCount: "Group",
|
|
111
|
+
tablePaginationFooter: (e) => /* @__PURE__ */ C(g, { children: [
|
|
112
|
+
e.current,
|
|
113
|
+
" to ",
|
|
114
|
+
e.pages,
|
|
115
|
+
" of ",
|
|
116
|
+
e.totalItems,
|
|
117
|
+
" items.",
|
|
118
|
+
Array.isArray(e.sizes) ? e.select : null,
|
|
119
|
+
" ",
|
|
120
|
+
"per page."
|
|
121
|
+
] }),
|
|
122
|
+
tablePaginationNext: "Next",
|
|
123
|
+
tablePaginationPrevious: "Previous",
|
|
124
|
+
tablePaginationSelectLabel: "Select the size of page",
|
|
125
|
+
tableSortAddButton: "Add sort",
|
|
126
|
+
tableSortAsc: "Ascending",
|
|
127
|
+
tableSortDesc: "Descending",
|
|
128
|
+
tableSortDropdownTitle: "Order by",
|
|
129
|
+
tableSortOrderByLabel: "Order by",
|
|
130
|
+
tableSortOrderInputPlaceholder: "Order by",
|
|
131
|
+
tableSortOrderInputTitle: "Order by",
|
|
132
|
+
tableSortTypeInputPlaceholder: "Ascending",
|
|
133
|
+
tableSortTypeInputTitle: "Sort type",
|
|
134
|
+
uploadIdle: "You can drag your files here",
|
|
135
|
+
uploadIdleButton: "Choose your files",
|
|
136
|
+
uploadDragging: (e) => `Dragging ${e.n} ${e.n > 0 ? "files" : "file"}`,
|
|
137
|
+
uploadDialogTitle: "Details of your file",
|
|
138
|
+
datepickerPlaceholder: (e) => "day/month/year"
|
|
139
|
+
}, m = {
|
|
140
|
+
input: { iconFeedback: !0 },
|
|
141
|
+
table: { operations: !0, sorters: !0, filters: !0, sticky: void 0 }
|
|
142
|
+
}, D = h({
|
|
143
|
+
parser: y.hsla,
|
|
144
|
+
tweaks: m,
|
|
145
|
+
floatingRef: void 0,
|
|
146
|
+
map: F,
|
|
147
|
+
locale: void 0
|
|
148
|
+
});
|
|
149
|
+
export {
|
|
150
|
+
D as C,
|
|
151
|
+
m as a,
|
|
152
|
+
S as b,
|
|
153
|
+
$ as c,
|
|
154
|
+
F as d,
|
|
155
|
+
w as e,
|
|
156
|
+
f,
|
|
157
|
+
P as g,
|
|
158
|
+
y as p,
|
|
159
|
+
i as r
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=context-BFXNJVn2.js.map
|