@cerberus-design/react 0.15.0-next-7a184be → 0.15.0-next-47ecb2e
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/build/legacy/_tsup-dts-rollup.d.cts +319 -93
- package/build/legacy/components/checkbox/checkbox.cjs.map +1 -1
- package/build/legacy/components/checkbox/index.cjs.map +1 -1
- package/build/legacy/components/for.cjs.map +1 -1
- package/build/legacy/components/select/index.cjs +265 -0
- package/build/legacy/components/select/index.cjs.map +1 -0
- package/build/legacy/components/select/option-group.cjs +60 -0
- package/build/legacy/components/select/option-group.cjs.map +1 -0
- package/build/legacy/components/select/parts.cjs +153 -0
- package/build/legacy/components/select/parts.cjs.map +1 -0
- package/build/legacy/components/select/primitives.cjs +167 -0
- package/build/legacy/components/select/primitives.cjs.map +1 -0
- package/build/legacy/components/select/select.cjs +212 -0
- package/build/legacy/components/select/select.cjs.map +1 -0
- package/build/legacy/components/switch/index.cjs +118 -0
- package/build/legacy/components/switch/index.cjs.map +1 -0
- package/build/legacy/components/switch/parts.cjs +75 -0
- package/build/legacy/components/switch/parts.cjs.map +1 -0
- package/build/legacy/components/switch/primitives.cjs +72 -0
- package/build/legacy/components/switch/primitives.cjs.map +1 -0
- package/build/legacy/components/switch/switch-indicator.cjs +51 -0
- package/build/legacy/components/switch/switch-indicator.cjs.map +1 -0
- package/build/legacy/components/switch/switch.cjs +106 -0
- package/build/legacy/components/switch/switch.cjs.map +1 -0
- package/build/legacy/components/toggle/index.cjs +45 -0
- package/build/legacy/components/toggle/index.cjs.map +1 -0
- package/build/legacy/components/toggle/parts.cjs +41 -0
- package/build/legacy/components/toggle/parts.cjs.map +1 -0
- package/build/legacy/components/toggle/primitives.cjs +35 -0
- package/build/legacy/components/toggle/primitives.cjs.map +1 -0
- package/build/legacy/hooks/useToggle.cjs.map +1 -1
- package/build/legacy/index.cjs +617 -483
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +319 -93
- package/build/modern/chunk-2CVGNLIM.js +15 -0
- package/build/modern/chunk-2CVGNLIM.js.map +1 -0
- package/build/modern/chunk-2LF3HPNA.js +1 -0
- package/build/modern/chunk-CAZ3EICD.js +16 -0
- package/build/modern/chunk-CAZ3EICD.js.map +1 -0
- package/build/modern/chunk-CIMY2U22.js +10 -0
- package/build/modern/chunk-CIMY2U22.js.map +1 -0
- package/build/modern/chunk-IASVL7CW.js +19 -0
- package/build/modern/chunk-IASVL7CW.js.map +1 -0
- package/build/modern/{chunk-REO5GUNC.js → chunk-ICTISECN.js} +1 -1
- package/build/modern/chunk-ICTISECN.js.map +1 -0
- package/build/modern/{chunk-77FJSNGD.js → chunk-IIH363FO.js} +1 -1
- package/build/modern/{chunk-77FJSNGD.js.map → chunk-IIH363FO.js.map} +1 -1
- package/build/modern/chunk-KQQPZJEI.js +21 -0
- package/build/modern/chunk-KQQPZJEI.js.map +1 -0
- package/build/modern/chunk-LZWNHXRP.js +48 -0
- package/build/modern/chunk-LZWNHXRP.js.map +1 -0
- package/build/modern/chunk-OVHCXBBI.js +22 -0
- package/build/modern/chunk-OVHCXBBI.js.map +1 -0
- package/build/modern/chunk-P3SF56LT.js +47 -0
- package/build/modern/chunk-P3SF56LT.js.map +1 -0
- package/build/modern/chunk-QCBLRACK.js +133 -0
- package/build/modern/chunk-QCBLRACK.js.map +1 -0
- package/build/modern/chunk-UDY6USHW.js +1 -0
- package/build/modern/chunk-V4YYGGMH.js +1 -0
- package/build/modern/chunk-XTNGF4D6.js +41 -0
- package/build/modern/chunk-XTNGF4D6.js.map +1 -0
- package/build/modern/{chunk-UNN4LHRS.js → chunk-Y4ZEJ2EF.js} +1 -1
- package/build/modern/chunk-Y4ZEJ2EF.js.map +1 -0
- package/build/modern/components/checkbox/checkbox.js +1 -1
- package/build/modern/components/checkbox/index.js +1 -1
- package/build/modern/components/for.js +1 -1
- package/build/modern/components/select/index.js +57 -0
- package/build/modern/components/select/index.js.map +1 -0
- package/build/modern/components/select/option-group.js +10 -0
- package/build/modern/components/select/option-group.js.map +1 -0
- package/build/modern/components/select/parts.js +8 -0
- package/build/modern/components/select/parts.js.map +1 -0
- package/build/modern/components/{Select.server.js → select/primitives.js} +8 -4
- package/build/modern/components/select/primitives.js.map +1 -0
- package/build/modern/components/select/select.js +15 -0
- package/build/modern/components/select/select.js.map +1 -0
- package/build/modern/components/switch/index.js +26 -0
- package/build/modern/components/switch/index.js.map +1 -0
- package/build/modern/components/switch/parts.js +8 -0
- package/build/modern/components/switch/parts.js.map +1 -0
- package/build/modern/components/switch/primitives.js +15 -0
- package/build/modern/components/switch/primitives.js.map +1 -0
- package/build/modern/components/switch/switch-indicator.js +9 -0
- package/build/modern/components/switch/switch-indicator.js.map +1 -0
- package/build/modern/components/switch/switch.js +11 -0
- package/build/modern/components/switch/switch.js.map +1 -0
- package/build/modern/components/toggle/index.js +14 -0
- package/build/modern/components/toggle/index.js.map +1 -0
- package/build/modern/components/toggle/parts.js +8 -0
- package/build/modern/components/toggle/parts.js.map +1 -0
- package/build/modern/components/toggle/primitives.js +9 -0
- package/build/modern/components/toggle/primitives.js.map +1 -0
- package/build/modern/context/confirm-modal.js +1 -1
- package/build/modern/context/cta-modal.js +2 -2
- package/build/modern/context/prompt-modal.js +1 -1
- package/build/modern/hooks/useToggle.js +1 -1
- package/build/modern/index.js +110 -72
- package/build/modern/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/checkbox/checkbox.tsx +4 -10
- package/src/components/for.tsx +1 -1
- package/src/components/select/index.ts +4 -0
- package/src/components/select/option-group.tsx +34 -0
- package/src/components/select/parts.ts +113 -0
- package/src/components/select/primitives.tsx +205 -0
- package/src/components/select/select.tsx +135 -0
- package/src/components/switch/index.ts +3 -0
- package/src/components/switch/parts.ts +53 -0
- package/src/components/switch/primitives.tsx +69 -0
- package/src/components/switch/switch-indicator.tsx +9 -0
- package/src/components/switch/switch.tsx +30 -0
- package/src/components/toggle/index.ts +2 -0
- package/src/components/toggle/parts.ts +32 -0
- package/src/components/toggle/primitives.tsx +17 -0
- package/src/hooks/useToggle.ts +1 -3
- package/src/index.ts +6 -6
- package/build/legacy/components/Select.cjs +0 -142
- package/build/legacy/components/Select.cjs.map +0 -1
- package/build/legacy/components/Select.server.cjs +0 -78
- package/build/legacy/components/Select.server.cjs.map +0 -1
- package/build/legacy/components/Toggle.cjs +0 -94
- package/build/legacy/components/Toggle.cjs.map +0 -1
- package/build/modern/chunk-GENS32QO.js +0 -61
- package/build/modern/chunk-GENS32QO.js.map +0 -1
- package/build/modern/chunk-REO5GUNC.js.map +0 -1
- package/build/modern/chunk-S2X5OEPK.js +0 -89
- package/build/modern/chunk-S2X5OEPK.js.map +0 -1
- package/build/modern/chunk-UNN4LHRS.js.map +0 -1
- package/build/modern/chunk-YWMPB2JR.js +0 -41
- package/build/modern/chunk-YWMPB2JR.js.map +0 -1
- package/build/modern/components/Select.js +0 -20
- package/build/modern/components/Toggle.js +0 -9
- package/src/components/Select.server.tsx +0 -80
- package/src/components/Select.tsx +0 -219
- package/src/components/Toggle.tsx +0 -98
- /package/build/modern/{components/Select.js.map → chunk-2LF3HPNA.js.map} +0 -0
- /package/build/modern/{components/Select.server.js.map → chunk-UDY6USHW.js.map} +0 -0
- /package/build/modern/{components/Toggle.js.map → chunk-V4YYGGMH.js.map} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SelectItemGroup,
|
|
3
|
+
SelectItemGroupLabel
|
|
4
|
+
} from "./chunk-QCBLRACK.js";
|
|
5
|
+
|
|
6
|
+
// src/components/select/option-group.tsx
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function OptionGroup(props) {
|
|
9
|
+
return /* @__PURE__ */ jsx(SelectItemGroup, { ...props });
|
|
10
|
+
}
|
|
11
|
+
function OptionGroupLabel(props) {
|
|
12
|
+
return /* @__PURE__ */ jsx(SelectItemGroupLabel, { ...props });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
OptionGroup,
|
|
17
|
+
OptionGroupLabel
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=chunk-IASVL7CW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/select/option-group.tsx"],"sourcesContent":["import type {\n SelectItemGroupLabelProps,\n SelectItemGroupProps,\n} from '@ark-ui/react/select'\nimport { SelectItemGroup, SelectItemGroupLabel } from './primitives'\n\n/**\n * The OptionGroup component is a group of options in the dropdown list.\n * @definition [Select docs](https://cerberus.digitalu.design/react/select)\n * @definition [ARK docs](https://ark-ui.com/react/docs/components/select)\n * @example\n * ```tsx\n * <OptionGroup>\n * <OptionGroupLabel>Greek gods</OptionGroupLabel>\n * ...\n * </OptionGroup>\n * ```\n */\nexport function OptionGroup(props: SelectItemGroupProps) {\n return <SelectItemGroup {...props} />\n}\n\n/**\n * The OptionGroupLabel component is the label of the OptionGroup.\n * @definition [Select docs](https://cerberus.digitalu.design/react/select)\n * @definition [ARK docs](https://ark-ui.com/react/docs/components/select)\n * @example\n * ```tsx\n * <OptionGroupLabel>Greek gods</OptionGroupLabel>\n * ```\n */\nexport function OptionGroupLabel(props: SelectItemGroupLabelProps) {\n return <SelectItemGroupLabel {...props} />\n}\n"],"mappings":";;;;;;AAmBS;AADF,SAAS,YAAY,OAA6B;AACvD,SAAO,oBAAC,mBAAiB,GAAG,OAAO;AACrC;AAWO,SAAS,iBAAiB,OAAkC;AACjE,SAAO,oBAAC,wBAAsB,GAAG,OAAO;AAC1C;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useToggle.ts"],"sourcesContent":["'use client'\n\nimport { useCallback, useMemo, useState, type ChangeEvent } from 'react'\n\n/**\n * This module provides a hook for using a toggle.\n * @module useToggle\n */\n\nexport interface UseToggleOptions {\n /**\n * The initial checked state.\n */\n checked?: string\n /**\n * Called when the checked state changes.\n */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void\n}\nexport interface ToggleHookReturn {\n /**\n * The checked state.\n */\n checked: string\n /**\n * A custom handler to be called when the checked state changes.\n */\n handleChange: (e: ChangeEvent<HTMLInputElement>) => void\n}\n\n/**\n * @deprecated Will be removed in v1. Use ToggleParts instead.\n */\nexport function useToggle(options?: UseToggleOptions): ToggleHookReturn {\n const [checked, setChecked] = useState<string>(options?.checked ?? '')\n const onChange = options?.onChange\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n const target = e.currentTarget as HTMLInputElement\n setChecked((prev) => {\n return prev === target.value ? '' : target.value\n })\n onChange?.(e)\n },\n [onChange],\n )\n\n return useMemo(() => ({ checked, handleChange }), [checked, handleChange])\n}\n"],"mappings":";AAEA,SAAS,aAAa,SAAS,gBAAkC;AA+B1D,SAAS,UAAU,SAA8C;AACtE,QAAM,CAAC,SAAS,UAAU,IAAI,SAAiB,SAAS,WAAW,EAAE;AACrE,QAAM,WAAW,SAAS;AAE1B,QAAM,eAAe;AAAA,IACnB,CAAC,MAAqC;AACpC,YAAM,SAAS,EAAE;AACjB,iBAAW,CAAC,SAAS;AACnB,eAAO,SAAS,OAAO,QAAQ,KAAK,OAAO;AAAA,MAC7C,CAAC;AACD,iBAAW,CAAC;AAAA,IACd;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO,QAAQ,OAAO,EAAE,SAAS,aAAa,IAAI,CAAC,SAAS,YAAY,CAAC;AAC3E;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/for.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nexport interface ForProps<T> {\n /**\n * The array to iterate over\n */\n each: T[]\n /**\n * The fallback content to render when the array is empty\n */\n fallback?: ReactNode\n /**\n * The render function to render each item in the array\n */\n children: (item: Exclude<T, undefined>, index: number) => ReactNode\n}\n\n/**\n * The For component is used to iterate over an array and render a list of\n * components or display a fallback when the array is empty.\n * Inspired by the `<For>` component from SolidJS.\n *\n * @example\n * ```tsx\n * <For each={['a', 'b', 'c']}>\n * {(item, index) => <div key={index}>{item}</div>}\n * </For>\n * ```\n */\nexport function For<\n T extends string | number | Record<string, unknown> | undefined,\n>(props: ForProps<T>) {\n const mappableChildren = props.children as unknown as (\n item: T,\n index: number,\n ) => ReactNode\n\n if (props.each?.length === 0) {\n return props.fallback || null\n }\n\n return props.each?.map(mappableChildren) as ReactNode\n}\n"],"mappings":";AA6BO,SAAS,IAEd,OAAoB;AACpB,QAAM,mBAAmB,MAAM;AAK/B,MAAI,MAAM,MAAM,WAAW,GAAG;AAC5B,WAAO,MAAM,YAAY;AAAA,EAC3B;AAEA,SAAO,MAAM,MAAM,IAAI,gBAAgB;AACzC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/for.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nexport interface ForProps<T> {\n /**\n * The array to iterate over\n */\n each: T[]\n /**\n * The fallback content to render when the array is empty\n */\n fallback?: ReactNode\n /**\n * The render function to render each item in the array\n */\n children: (item: Exclude<T, undefined>, index: number) => ReactNode\n}\n\n/**\n * The For component is used to iterate over an array and render a list of\n * components or display a fallback when the array is empty.\n * Inspired by the `<For>` component from SolidJS.\n *\n * @example\n * ```tsx\n * <For each={['a', 'b', 'c']}>\n * {(item, index) => <div key={index}>{item}</div>}\n * </For>\n * ```\n */\nexport function For<\n T extends string | number | Record<string, unknown> | object | undefined,\n>(props: ForProps<T>) {\n const mappableChildren = props.children as unknown as (\n item: T,\n index: number,\n ) => ReactNode\n\n if (props.each?.length === 0) {\n return props.fallback || null\n }\n\n return props.each?.map(mappableChildren) as ReactNode\n}\n"],"mappings":";AA6BO,SAAS,IAEd,OAAoB;AACpB,QAAM,mBAAmB,MAAM;AAK/B,MAAI,MAAM,MAAM,WAAW,GAAG;AAC5B,WAAO,MAAM,YAAY;AAAA,EAC3B;AAEA,SAAO,MAAM,MAAM,IAAI,gBAAgB;AACzC;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SwitchControl,
|
|
3
|
+
SwitchHiddenInput,
|
|
4
|
+
SwitchLabel,
|
|
5
|
+
SwitchRoot,
|
|
6
|
+
SwitchThumb
|
|
7
|
+
} from "./chunk-LZWNHXRP.js";
|
|
8
|
+
|
|
9
|
+
// src/components/switch/parts.ts
|
|
10
|
+
var SwitchParts = {
|
|
11
|
+
Root: SwitchRoot,
|
|
12
|
+
Label: SwitchLabel,
|
|
13
|
+
Control: SwitchControl,
|
|
14
|
+
Thumb: SwitchThumb,
|
|
15
|
+
HiddenInput: SwitchHiddenInput
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
SwitchParts
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-KQQPZJEI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/switch/parts.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport {\n SwitchControl,\n SwitchLabel,\n SwitchRoot,\n SwitchThumb,\n SwitchHiddenInput,\n} from './primitives'\n\n/**\n * This module contains the parts of the Radio parts.\n * @module 'radio/parts'\n */\n\ninterface SwitchPartsValue {\n /**\n * The container of the field.\n */\n Root: ElementType\n /**\n * The label of the field.\n */\n Label: ElementType\n /**\n * The visual input of the switch.\n */\n Control: ElementType\n /**\n * The thumb item of the switch.\n */\n Thumb: ElementType\n /**\n * The native input for the switch.\n */\n HiddenInput: ElementType\n}\n\n/**\n * An Object containing the parts of the Radio component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the SwitchParts object and\n * the entire family of components vs. only what you use.\n */\nexport const SwitchParts: SwitchPartsValue = {\n Root: SwitchRoot,\n Label: SwitchLabel,\n Control: SwitchControl,\n Thumb: SwitchThumb,\n HiddenInput: SwitchHiddenInput,\n}\n"],"mappings":";;;;;;;;;AA8CO,IAAM,cAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AACf;","names":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/components/switch/primitives.tsx
|
|
2
|
+
import {
|
|
3
|
+
Switch
|
|
4
|
+
} from "@ark-ui/react";
|
|
5
|
+
import { cx } from "@cerberus/styled-system/css";
|
|
6
|
+
import {
|
|
7
|
+
switchRecipe
|
|
8
|
+
} from "@cerberus/styled-system/recipes";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
function SwitchRoot(props) {
|
|
11
|
+
const { size, ...rootProps } = props;
|
|
12
|
+
const styles = switchRecipe({ size });
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
Switch.Root,
|
|
15
|
+
{
|
|
16
|
+
...rootProps,
|
|
17
|
+
className: cx(styles.root, rootProps.className)
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function SwitchLabel(props) {
|
|
22
|
+
const styles = switchRecipe();
|
|
23
|
+
return /* @__PURE__ */ jsx(Switch.Label, { ...props, className: cx(styles.label, props.className) });
|
|
24
|
+
}
|
|
25
|
+
function SwitchControl(props) {
|
|
26
|
+
const styles = switchRecipe();
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
Switch.Control,
|
|
29
|
+
{
|
|
30
|
+
...props,
|
|
31
|
+
className: cx(styles.control, props.className)
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function SwitchThumb(props) {
|
|
36
|
+
const styles = switchRecipe();
|
|
37
|
+
return /* @__PURE__ */ jsx(Switch.Thumb, { ...props, className: cx(styles.thumb, props.className) });
|
|
38
|
+
}
|
|
39
|
+
var SwitchHiddenInput = Switch.HiddenInput;
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
SwitchRoot,
|
|
43
|
+
SwitchLabel,
|
|
44
|
+
SwitchControl,
|
|
45
|
+
SwitchThumb,
|
|
46
|
+
SwitchHiddenInput
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=chunk-LZWNHXRP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/switch/primitives.tsx"],"sourcesContent":["import {\n Switch,\n type SwitchControlProps,\n type SwitchLabelProps,\n type SwitchRootProps,\n type SwitchThumbProps,\n} from '@ark-ui/react'\nimport { cx } from '@cerberus/styled-system/css'\nimport {\n switchRecipe,\n type SwitchRecipeVariantProps,\n} from '@cerberus/styled-system/recipes'\n\n/**\n * This module contains the Switch primitives\n * @module 'react/switch'\n */\n\n/**\n * The SwitchRoot component is the context provider for the Switch components.\n */\nexport function SwitchRoot(props: SwitchRootProps & SwitchRecipeVariantProps) {\n const { size, ...rootProps } = props\n const styles = switchRecipe({ size })\n return (\n <Switch.Root\n {...rootProps}\n className={cx(styles.root, rootProps.className)}\n />\n )\n}\n\n/**\n * The SwitchLabel component is the label for the Switch.\n */\nexport function SwitchLabel(props: SwitchLabelProps) {\n const styles = switchRecipe()\n return (\n <Switch.Label {...props} className={cx(styles.label, props.className)} />\n )\n}\n\n/**\n * The SwitchControl component is the visual input for the Switch.\n */\nexport function SwitchControl(props: SwitchControlProps) {\n const styles = switchRecipe()\n return (\n <Switch.Control\n {...props}\n className={cx(styles.control, props.className)}\n />\n )\n}\n\n/**\n * The SwitchThumb component is the thumb for the Switch.\n */\nexport function SwitchThumb(props: SwitchThumbProps) {\n const styles = switchRecipe()\n return (\n <Switch.Thumb {...props} className={cx(styles.thumb, props.className)} />\n )\n}\n\n/**\n * The SwitchHiddenInput component is the native input for the Switch.\n */\nexport const SwitchHiddenInput = Switch.HiddenInput\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAKK;AACP,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,OAEK;AAcH;AAJG,SAAS,WAAW,OAAmD;AAC5E,QAAM,EAAE,MAAM,GAAG,UAAU,IAAI;AAC/B,QAAM,SAAS,aAAa,EAAE,KAAK,CAAC;AACpC,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,MAAM,UAAU,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,YAAY,OAAyB;AACnD,QAAM,SAAS,aAAa;AAC5B,SACE,oBAAC,OAAO,OAAP,EAAc,GAAG,OAAO,WAAW,GAAG,OAAO,OAAO,MAAM,SAAS,GAAG;AAE3E;AAKO,SAAS,cAAc,OAA2B;AACvD,QAAM,SAAS,aAAa;AAC5B,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,SAAS,MAAM,SAAS;AAAA;AAAA,EAC/C;AAEJ;AAKO,SAAS,YAAY,OAAyB;AACnD,QAAM,SAAS,aAAa;AAC5B,SACE,oBAAC,OAAO,OAAP,EAAc,GAAG,OAAO,WAAW,GAAG,OAAO,OAAO,MAAM,SAAS,GAAG;AAE3E;AAKO,IAAM,oBAAoB,OAAO;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SwitchIndicator
|
|
3
|
+
} from "./chunk-CAZ3EICD.js";
|
|
4
|
+
import {
|
|
5
|
+
SwitchParts
|
|
6
|
+
} from "./chunk-KQQPZJEI.js";
|
|
7
|
+
|
|
8
|
+
// src/components/switch/switch.tsx
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function Switch(props) {
|
|
11
|
+
const { children, ...rootProps } = props;
|
|
12
|
+
return /* @__PURE__ */ jsxs(SwitchParts.Root, { ...rootProps, children: [
|
|
13
|
+
/* @__PURE__ */ jsx(SwitchParts.Control, { children: /* @__PURE__ */ jsx(SwitchParts.Thumb, { children: /* @__PURE__ */ jsx(SwitchIndicator, {}) }) }),
|
|
14
|
+
/* @__PURE__ */ jsx(SwitchParts.Label, { children }),
|
|
15
|
+
/* @__PURE__ */ jsx(SwitchParts.HiddenInput, {})
|
|
16
|
+
] });
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
Switch
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-OVHCXBBI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/switch/switch.tsx"],"sourcesContent":["import type { SwitchRootProps } from '@ark-ui/react'\nimport type { SwitchRecipeVariantProps } from '@cerberus/styled-system/recipes'\nimport { SwitchParts } from './parts'\nimport { SwitchIndicator } from './switch-indicator'\n\nexport type SwitchProps = SwitchRootProps & SwitchRecipeVariantProps\n\n/**\n * The Switch component is a and abstraction of the primitives that displays a\n * controlled Switch with a label.\n * @description [Cerberus Docs] https://cerberus.digitalu.design/react/switch\n * @description [Ark Docs] https://ark-ui.com/docs/components/switch\n */\nexport function Switch(props: SwitchProps) {\n const { children, ...rootProps } = props\n\n return (\n <SwitchParts.Root {...rootProps}>\n <SwitchParts.Control>\n <SwitchParts.Thumb>\n <SwitchIndicator />\n </SwitchParts.Thumb>\n </SwitchParts.Control>\n\n <SwitchParts.Label>{children}</SwitchParts.Label>\n\n <SwitchParts.HiddenInput />\n </SwitchParts.Root>\n )\n}\n"],"mappings":";;;;;;;;AAiBI,SAGM,KAHN;AAJG,SAAS,OAAO,OAAoB;AACzC,QAAM,EAAE,UAAU,GAAG,UAAU,IAAI;AAEnC,SACE,qBAAC,YAAY,MAAZ,EAAkB,GAAG,WACpB;AAAA,wBAAC,YAAY,SAAZ,EACC,8BAAC,YAAY,OAAZ,EACC,8BAAC,mBAAgB,GACnB,GACF;AAAA,IAEA,oBAAC,YAAY,OAAZ,EAAmB,UAAS;AAAA,IAE7B,oBAAC,YAAY,aAAZ,EAAwB;AAAA,KAC3B;AAEJ;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Portal
|
|
3
|
+
} from "./chunk-IQJDVFPP.js";
|
|
4
|
+
import {
|
|
5
|
+
SelectParts
|
|
6
|
+
} from "./chunk-XTNGF4D6.js";
|
|
7
|
+
import {
|
|
8
|
+
useCerberusContext
|
|
9
|
+
} from "./chunk-GITT5645.js";
|
|
10
|
+
import {
|
|
11
|
+
Show
|
|
12
|
+
} from "./chunk-BUVVRQLZ.js";
|
|
13
|
+
|
|
14
|
+
// src/components/select/select.tsx
|
|
15
|
+
import { HStack } from "@cerberus/styled-system/jsx";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
function Select(props) {
|
|
18
|
+
const { collection, placeholder, ...rootProps } = props;
|
|
19
|
+
const { icons } = useCerberusContext();
|
|
20
|
+
const { selectArrow: SelectArrow, invalid: InvalidIcon } = icons;
|
|
21
|
+
return /* @__PURE__ */ jsxs(SelectParts.Root, { collection, ...rootProps, children: [
|
|
22
|
+
/* @__PURE__ */ jsx(SelectParts.Control, { children: /* @__PURE__ */ jsxs(SelectParts.Trigger, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(SelectParts.ValueText, { placeholder }),
|
|
24
|
+
/* @__PURE__ */ jsxs(HStack, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Show, { when: props.invalid, children: /* @__PURE__ */ jsx(InvalidIcon, { "data-part": "invalid-icon" }) }),
|
|
26
|
+
/* @__PURE__ */ jsx(SelectParts.Indicator, { children: /* @__PURE__ */ jsx(SelectArrow, {}) })
|
|
27
|
+
] })
|
|
28
|
+
] }) }),
|
|
29
|
+
/* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(SelectParts.Positioner, { children: /* @__PURE__ */ jsx(SelectParts.Content, { size: rootProps.size, children: props.children }) }) }),
|
|
30
|
+
/* @__PURE__ */ jsx(SelectParts.HiddenSelect, {})
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
function Option(props) {
|
|
34
|
+
const { item, ...itemProps } = props;
|
|
35
|
+
const { icons } = useCerberusContext();
|
|
36
|
+
const { selectChecked: CheckedIcon } = icons;
|
|
37
|
+
return /* @__PURE__ */ jsxs(SelectParts.Item, { ...itemProps, item, children: [
|
|
38
|
+
/* @__PURE__ */ jsx(SelectParts.ItemText, { children: item?.label }),
|
|
39
|
+
/* @__PURE__ */ jsx(SelectParts.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckedIcon, {}) })
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
Select,
|
|
45
|
+
Option
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=chunk-P3SF56LT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/select/select.tsx"],"sourcesContent":["'use client'\n\nimport type { SelectItemProps, SelectRootProps } from '@ark-ui/react/select'\nimport { type SelectVariantProps } from '@cerberus/styled-system/recipes'\nimport { HStack } from '@cerberus/styled-system/jsx'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { Portal } from '../Portal'\nimport { Show } from '../Show'\nimport { SelectParts } from './parts'\n\n/**\n * This module contains the Select components.\n * @module 'react/select'\n */\n\nexport interface SelectCollectionItem {\n /**\n * What is displayed in the dropdown list.\n */\n label: string\n /**\n * The value of the selected item used in the form.\n */\n value: string\n /**\n * If the item is disabled.\n */\n disabled?: boolean\n}\n\nexport interface SelectCollection {\n /**\n * The items to be displayed in the dropdown list.\n */\n items: SelectCollectionItem[]\n}\n\nexport interface BaseSelectProps {\n /**\n * The placeholder text when no option is selected.\n */\n placeholder?: string\n}\n\nexport type SelectProps = SelectRootProps<SelectCollectionItem> &\n BaseSelectProps &\n SelectVariantProps\n\n/**\n * The Select component is a dropdown list that allows users to select an\n * option from a list.\n * @definition [Select docs](https://cerberus.digitalu.design/react/select)\n * @definition [ARK docs](https://ark-ui.com/react/docs/components/select)\n * @example\n * ```tsx\n * import { Select, Option, createListCollection } from '@cerberus-design/react'\n *\n * export function SelectBasicPreview() {\n * const collection = createListCollection({\n * items: [\n * { label: 'Hades', value: 'hades' },\n * { label: 'Persephone', value: 'persephone' },\n * { label: 'Zeus', value: 'zeus', disabled: true },\n * ]\n * })\n *\n * return (\n * <Select\n * collection={collection}\n * label=\"Select Relative\"\n * placeholder=\"Choose option\"\n * >\n * {collection.items.map((item) => (\n * <Option key={item.value} item={item} />\n * ))}\n * </Select>\n * )\n * }\n */\nexport function Select(props: SelectProps) {\n const { collection, placeholder, ...rootProps } = props\n const { icons } = useCerberusContext()\n const { selectArrow: SelectArrow, invalid: InvalidIcon } = icons\n\n return (\n <SelectParts.Root collection={collection} {...rootProps}>\n <SelectParts.Control>\n <SelectParts.Trigger>\n <SelectParts.ValueText placeholder={placeholder} />\n\n <HStack>\n <Show when={props.invalid}>\n <InvalidIcon data-part=\"invalid-icon\" />\n </Show>\n <SelectParts.Indicator>\n <SelectArrow />\n </SelectParts.Indicator>\n </HStack>\n </SelectParts.Trigger>\n </SelectParts.Control>\n\n <Portal>\n <SelectParts.Positioner>\n <SelectParts.Content size={rootProps.size}>\n {props.children}\n </SelectParts.Content>\n </SelectParts.Positioner>\n </Portal>\n\n <SelectParts.HiddenSelect />\n </SelectParts.Root>\n )\n}\n\nexport interface OptionProps extends SelectItemProps {\n /**\n * The CollectionListItem to be displayed in the dropdown list.\n */\n item: SelectCollectionItem\n}\n\nexport function Option(props: OptionProps) {\n const { item, ...itemProps } = props\n const { icons } = useCerberusContext()\n const { selectChecked: CheckedIcon } = icons\n\n return (\n <SelectParts.Item {...itemProps} item={item}>\n <SelectParts.ItemText>{item?.label}</SelectParts.ItemText>\n <SelectParts.ItemIndicator>\n <CheckedIcon />\n </SelectParts.ItemIndicator>\n </SelectParts.Item>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAIA,SAAS,cAAc;AAoFb,cAEA,YAFA;AATH,SAAS,OAAO,OAAoB;AACzC,QAAM,EAAE,YAAY,aAAa,GAAG,UAAU,IAAI;AAClD,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,aAAa,aAAa,SAAS,YAAY,IAAI;AAE3D,SACE,qBAAC,YAAY,MAAZ,EAAiB,YAAyB,GAAG,WAC5C;AAAA,wBAAC,YAAY,SAAZ,EACC,+BAAC,YAAY,SAAZ,EACC;AAAA,0BAAC,YAAY,WAAZ,EAAsB,aAA0B;AAAA,MAEjD,qBAAC,UACC;AAAA,4BAAC,QAAK,MAAM,MAAM,SAChB,8BAAC,eAAY,aAAU,gBAAe,GACxC;AAAA,QACA,oBAAC,YAAY,WAAZ,EACC,8BAAC,eAAY,GACf;AAAA,SACF;AAAA,OACF,GACF;AAAA,IAEA,oBAAC,UACC,8BAAC,YAAY,YAAZ,EACC,8BAAC,YAAY,SAAZ,EAAoB,MAAM,UAAU,MAClC,gBAAM,UACT,GACF,GACF;AAAA,IAEA,oBAAC,YAAY,cAAZ,EAAyB;AAAA,KAC5B;AAEJ;AASO,SAAS,OAAO,OAAoB;AACzC,QAAM,EAAE,MAAM,GAAG,UAAU,IAAI;AAC/B,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,eAAe,YAAY,IAAI;AAEvC,SACE,qBAAC,YAAY,MAAZ,EAAkB,GAAG,WAAW,MAC/B;AAAA,wBAAC,YAAY,UAAZ,EAAsB,gBAAM,OAAM;AAAA,IACnC,oBAAC,YAAY,eAAZ,EACC,8BAAC,eAAY,GACf;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// src/components/select/primitives.tsx
|
|
2
|
+
import {
|
|
3
|
+
createListCollection,
|
|
4
|
+
Select
|
|
5
|
+
} from "@ark-ui/react/select";
|
|
6
|
+
import {
|
|
7
|
+
select
|
|
8
|
+
} from "@cerberus/styled-system/recipes";
|
|
9
|
+
import { cx } from "@cerberus/styled-system/css";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function SelectRoot(props) {
|
|
12
|
+
const { size, ...rootProps } = props;
|
|
13
|
+
const styles = select({ size });
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
Select.Root,
|
|
16
|
+
{
|
|
17
|
+
...rootProps,
|
|
18
|
+
className: cx(styles.root, rootProps.className)
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function SelectLabel(props) {
|
|
23
|
+
const styles = select();
|
|
24
|
+
return /* @__PURE__ */ jsx(Select.Label, { ...props, className: cx(styles.label, props.className) });
|
|
25
|
+
}
|
|
26
|
+
function SelectControl(props) {
|
|
27
|
+
return /* @__PURE__ */ jsx(Select.Control, { ...props });
|
|
28
|
+
}
|
|
29
|
+
function SelectTrigger(props) {
|
|
30
|
+
const styles = select();
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
Select.Trigger,
|
|
33
|
+
{
|
|
34
|
+
...props,
|
|
35
|
+
className: cx(styles.trigger, props.className)
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function SelectValueText(props) {
|
|
40
|
+
return /* @__PURE__ */ jsx(Select.ValueText, { ...props });
|
|
41
|
+
}
|
|
42
|
+
function SelectIndicator(props) {
|
|
43
|
+
const styles = select();
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Select.Indicator,
|
|
46
|
+
{
|
|
47
|
+
...props,
|
|
48
|
+
className: cx(styles.indicator, props.className)
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function SelectClearTrigger(props) {
|
|
53
|
+
return /* @__PURE__ */ jsx(Select.ClearTrigger, { ...props });
|
|
54
|
+
}
|
|
55
|
+
function SelectPositioner(props) {
|
|
56
|
+
const styles = select();
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
58
|
+
Select.Positioner,
|
|
59
|
+
{
|
|
60
|
+
...props,
|
|
61
|
+
className: cx(styles.positioner, props.className)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
function SelectContent(props) {
|
|
66
|
+
const { size, ...contentProps } = props;
|
|
67
|
+
const styles = select({ size });
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
Select.Content,
|
|
70
|
+
{
|
|
71
|
+
...contentProps,
|
|
72
|
+
className: cx(styles.content, contentProps.className)
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function SelectItemGroup(props) {
|
|
77
|
+
return /* @__PURE__ */ jsx(Select.ItemGroup, { ...props });
|
|
78
|
+
}
|
|
79
|
+
function SelectItemGroupLabel(props) {
|
|
80
|
+
const styles = select();
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
Select.ItemGroupLabel,
|
|
83
|
+
{
|
|
84
|
+
...props,
|
|
85
|
+
className: cx(styles.itemGroupLabel, props.className)
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function SelectItem(props) {
|
|
90
|
+
const styles = select();
|
|
91
|
+
return /* @__PURE__ */ jsx(Select.Item, { ...props, className: cx(styles.item, props.className) });
|
|
92
|
+
}
|
|
93
|
+
function SelectItemText(props) {
|
|
94
|
+
return /* @__PURE__ */ jsx(Select.ItemText, { ...props });
|
|
95
|
+
}
|
|
96
|
+
function SelectItemIndicator(props) {
|
|
97
|
+
const styles = select();
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
Select.ItemIndicator,
|
|
100
|
+
{
|
|
101
|
+
...props,
|
|
102
|
+
className: cx(styles.itemIndicator, props.className)
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function SelectHiddenSelect(props) {
|
|
107
|
+
return /* @__PURE__ */ jsx(Select.HiddenSelect, { ...props });
|
|
108
|
+
}
|
|
109
|
+
function createSelectCollection(collection) {
|
|
110
|
+
return createListCollection({
|
|
111
|
+
items: collection
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
SelectRoot,
|
|
117
|
+
SelectLabel,
|
|
118
|
+
SelectControl,
|
|
119
|
+
SelectTrigger,
|
|
120
|
+
SelectValueText,
|
|
121
|
+
SelectIndicator,
|
|
122
|
+
SelectClearTrigger,
|
|
123
|
+
SelectPositioner,
|
|
124
|
+
SelectContent,
|
|
125
|
+
SelectItemGroup,
|
|
126
|
+
SelectItemGroupLabel,
|
|
127
|
+
SelectItem,
|
|
128
|
+
SelectItemText,
|
|
129
|
+
SelectItemIndicator,
|
|
130
|
+
SelectHiddenSelect,
|
|
131
|
+
createSelectCollection
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=chunk-QCBLRACK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/select/primitives.tsx"],"sourcesContent":["import {\n createListCollection,\n Select,\n type ListCollection,\n type SelectClearTriggerProps,\n type SelectContentProps,\n type SelectControlProps,\n type SelectHiddenSelectProps,\n type SelectIndicatorProps,\n type SelectItemGroupLabelProps,\n type SelectItemGroupProps,\n type SelectItemIndicatorProps,\n type SelectItemProps,\n type SelectItemTextProps,\n type SelectLabelProps,\n type SelectPositionerProps,\n type SelectRootProps,\n type SelectTriggerProps,\n type SelectValueChangeDetails,\n type SelectValueTextProps,\n} from '@ark-ui/react/select'\nimport {\n select,\n type SelectVariantProps,\n} from '@cerberus/styled-system/recipes'\nimport { cx } from '@cerberus/styled-system/css'\nimport type { SelectCollectionItem } from './select'\n\n/**\n * This module contains the Select primitives\n * @module 'react/select'\n */\n\n/**\n * The SelectRoot component is the context provider for the Select component.\n */\nexport function SelectRoot(\n props: SelectRootProps<SelectCollectionItem> & SelectVariantProps,\n) {\n const { size, ...rootProps } = props\n const styles = select({ size })\n return (\n <Select.Root\n {...rootProps}\n className={cx(styles.root, rootProps.className)}\n />\n )\n}\n\n/**\n * The label that appears above the select input.\n */\nexport function SelectLabel(props: SelectLabelProps) {\n const styles = select()\n return (\n <Select.Label {...props} className={cx(styles.label, props.className)} />\n )\n}\n\n/**\n * The control that wraps the select trigger.\n */\nexport function SelectControl(props: SelectControlProps) {\n return <Select.Control {...props} />\n}\n\n/**\n * The trigger that opens the dropdown.\n */\nexport function SelectTrigger(props: SelectTriggerProps) {\n const styles = select()\n return (\n <Select.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The text that appears in the trigger.\n */\nexport function SelectValueText(props: SelectValueTextProps) {\n return <Select.ValueText {...props} />\n}\n\n/**\n * The indicator that appears in the trigger.\n */\nexport function SelectIndicator(props: SelectIndicatorProps) {\n const styles = select()\n return (\n <Select.Indicator\n {...props}\n className={cx(styles.indicator, props.className)}\n />\n )\n}\n\n/**\n * The trigger that clears the selected value.\n */\nexport function SelectClearTrigger(props: SelectClearTriggerProps) {\n return <Select.ClearTrigger {...props} />\n}\n\n/**\n * The positioner that contains the dropdown.\n */\nexport function SelectPositioner(props: SelectPositionerProps) {\n const styles = select()\n return (\n <Select.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The content of the dropdown (i.e. the container itself).\n */\nexport function SelectContent(props: SelectContentProps & SelectVariantProps) {\n const { size, ...contentProps } = props\n const styles = select({ size })\n return (\n <Select.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The container for a group of item options.\n */\nexport function SelectItemGroup(props: SelectItemGroupProps) {\n return <Select.ItemGroup {...props} />\n}\n\n/**\n * The label for a group of item options.\n */\nexport function SelectItemGroupLabel(props: SelectItemGroupLabelProps) {\n const styles = select()\n return (\n <Select.ItemGroupLabel\n {...props}\n className={cx(styles.itemGroupLabel, props.className)}\n />\n )\n}\n\n/**\n * The container for an item in the select content.\n */\nexport function SelectItem(props: SelectItemProps) {\n const styles = select()\n return <Select.Item {...props} className={cx(styles.item, props.className)} />\n}\n\n/**\n * The text for an item option.\n */\nexport function SelectItemText(props: SelectItemTextProps) {\n return <Select.ItemText {...props} />\n}\n\n/**\n * The indicator for an item option shown when it is selected.\n */\nexport function SelectItemIndicator(props: SelectItemIndicatorProps) {\n const styles = select()\n return (\n <Select.ItemIndicator\n {...props}\n className={cx(styles.itemIndicator, props.className)}\n />\n )\n}\n\n/**\n * The native input for a select item.\n */\nexport function SelectHiddenSelect(props: SelectHiddenSelectProps) {\n return <Select.HiddenSelect {...props} />\n}\n\n/**\n * A helper function to create a SelectCollection object.\n * @param collection - An array of SelectCollectionItem objects that matches\n * the following shape:\n * ```ts\n * [{ label: 'Hades', value: 'hades', disabled?: true }]\n * ```\n */\nexport function createSelectCollection(\n collection: SelectCollectionItem[],\n): ListCollection<SelectCollectionItem> {\n return createListCollection({\n items: collection,\n })\n}\n\nexport type { SelectValueChangeDetails, ListCollection }\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAkBK;AACP;AAAA,EACE;AAAA,OAEK;AACP,SAAS,UAAU;AAiBf;AANG,SAAS,WACd,OACA;AACA,QAAM,EAAE,MAAM,GAAG,UAAU,IAAI;AAC/B,QAAM,SAAS,OAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,MAAM,UAAU,SAAS;AAAA;AAAA,EAChD;AAEJ;AAKO,SAAS,YAAY,OAAyB;AACnD,QAAM,SAAS,OAAO;AACtB,SACE,oBAAC,OAAO,OAAP,EAAc,GAAG,OAAO,WAAW,GAAG,OAAO,OAAO,MAAM,SAAS,GAAG;AAE3E;AAKO,SAAS,cAAc,OAA2B;AACvD,SAAO,oBAAC,OAAO,SAAP,EAAgB,GAAG,OAAO;AACpC;AAKO,SAAS,cAAc,OAA2B;AACvD,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,SAAS,MAAM,SAAS;AAAA;AAAA,EAC/C;AAEJ;AAKO,SAAS,gBAAgB,OAA6B;AAC3D,SAAO,oBAAC,OAAO,WAAP,EAAkB,GAAG,OAAO;AACtC;AAKO,SAAS,gBAAgB,OAA6B;AAC3D,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,WAAW,MAAM,SAAS;AAAA;AAAA,EACjD;AAEJ;AAKO,SAAS,mBAAmB,OAAgC;AACjE,SAAO,oBAAC,OAAO,cAAP,EAAqB,GAAG,OAAO;AACzC;AAKO,SAAS,iBAAiB,OAA8B;AAC7D,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,YAAY,MAAM,SAAS;AAAA;AAAA,EAClD;AAEJ;AAKO,SAAS,cAAc,OAAgD;AAC5E,QAAM,EAAE,MAAM,GAAG,aAAa,IAAI;AAClC,QAAM,SAAS,OAAO,EAAE,KAAK,CAAC;AAC9B,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,SAAS,aAAa,SAAS;AAAA;AAAA,EACtD;AAEJ;AAKO,SAAS,gBAAgB,OAA6B;AAC3D,SAAO,oBAAC,OAAO,WAAP,EAAkB,GAAG,OAAO;AACtC;AAKO,SAAS,qBAAqB,OAAkC;AACrE,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,gBAAgB,MAAM,SAAS;AAAA;AAAA,EACtD;AAEJ;AAKO,SAAS,WAAW,OAAwB;AACjD,QAAM,SAAS,OAAO;AACtB,SAAO,oBAAC,OAAO,MAAP,EAAa,GAAG,OAAO,WAAW,GAAG,OAAO,MAAM,MAAM,SAAS,GAAG;AAC9E;AAKO,SAAS,eAAe,OAA4B;AACzD,SAAO,oBAAC,OAAO,UAAP,EAAiB,GAAG,OAAO;AACrC;AAKO,SAAS,oBAAoB,OAAiC;AACnE,QAAM,SAAS,OAAO;AACtB,SACE;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,eAAe,MAAM,SAAS;AAAA;AAAA,EACrD;AAEJ;AAKO,SAAS,mBAAmB,OAAgC;AACjE,SAAO,oBAAC,OAAO,cAAP,EAAqB,GAAG,OAAO;AACzC;AAUO,SAAS,uBACd,YACsC;AACtC,SAAO,qBAAqB;AAAA,IAC1B,OAAO;AAAA,EACT,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-UDY6USHW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-V4YYGGMH.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SelectClearTrigger,
|
|
3
|
+
SelectContent,
|
|
4
|
+
SelectControl,
|
|
5
|
+
SelectHiddenSelect,
|
|
6
|
+
SelectIndicator,
|
|
7
|
+
SelectItem,
|
|
8
|
+
SelectItemGroup,
|
|
9
|
+
SelectItemGroupLabel,
|
|
10
|
+
SelectItemIndicator,
|
|
11
|
+
SelectItemText,
|
|
12
|
+
SelectLabel,
|
|
13
|
+
SelectPositioner,
|
|
14
|
+
SelectRoot,
|
|
15
|
+
SelectTrigger,
|
|
16
|
+
SelectValueText
|
|
17
|
+
} from "./chunk-QCBLRACK.js";
|
|
18
|
+
|
|
19
|
+
// src/components/select/parts.ts
|
|
20
|
+
var SelectParts = {
|
|
21
|
+
Root: SelectRoot,
|
|
22
|
+
Label: SelectLabel,
|
|
23
|
+
Control: SelectControl,
|
|
24
|
+
Trigger: SelectTrigger,
|
|
25
|
+
ClearTrigger: SelectClearTrigger,
|
|
26
|
+
ValueText: SelectValueText,
|
|
27
|
+
Indicator: SelectIndicator,
|
|
28
|
+
Positioner: SelectPositioner,
|
|
29
|
+
Content: SelectContent,
|
|
30
|
+
ItemGroup: SelectItemGroup,
|
|
31
|
+
ItemGroupLabel: SelectItemGroupLabel,
|
|
32
|
+
Item: SelectItem,
|
|
33
|
+
ItemText: SelectItemText,
|
|
34
|
+
ItemIndicator: SelectItemIndicator,
|
|
35
|
+
HiddenSelect: SelectHiddenSelect
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
SelectParts
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=chunk-XTNGF4D6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/select/parts.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport {\n SelectClearTrigger,\n SelectContent,\n SelectControl,\n SelectHiddenSelect,\n SelectIndicator,\n SelectItem,\n SelectItemGroup,\n SelectItemGroupLabel,\n SelectItemIndicator,\n SelectItemText,\n SelectLabel,\n SelectPositioner,\n SelectRoot,\n SelectTrigger,\n SelectValueText,\n} from './primitives'\n\n/**\n * This module contains the parts of the Select parts.\n * @module 'select/parts'\n */\n\ninterface SelectPartsValue {\n /**\n * The context provider for the Select component.\n */\n Root: ElementType\n /**\n * The label that appears above the select input.\n */\n Label: ElementType\n /**\n * The control that wraps the select trigger.\n */\n Control: ElementType\n /**\n * The trigger that opens the dropdown.\n */\n Trigger: ElementType\n /**\n * The trigger to clear the select input.\n */\n ClearTrigger: ElementType\n /**\n * The text that appears in the trigger.\n */\n ValueText: ElementType\n /**\n * The indicator that appears in the trigger.\n */\n Indicator: ElementType\n /**\n * The positioner that wraps the content.\n */\n Positioner: ElementType\n /**\n * The content of the select component.\n */\n Content: ElementType\n /**\n * A group of items in the select component.\n */\n ItemGroup: ElementType\n /**\n * The label for a group of items in the select component.\n */\n ItemGroupLabel: ElementType\n /**\n * An individual item in the select component.\n */\n Item: ElementType\n /**\n * The text that labels a single radio of the field.\n */\n ItemText: ElementType\n /**\n * The indicator that appears when the item has been selected.\n */\n ItemIndicator: ElementType\n /**\n * The native select for use within a field.\n */\n HiddenSelect: ElementType\n}\n\n/**\n * An Object containing the parts of the Radio component. For users that\n * prefer Object component syntax.\n *\n * @remarks\n *\n * When using object component syntax, you import the SelectParts object and\n * the entire family of components vs. only what you use.\n */\nexport const SelectParts: SelectPartsValue = {\n Root: SelectRoot,\n Label: SelectLabel,\n Control: SelectControl,\n Trigger: SelectTrigger,\n ClearTrigger: SelectClearTrigger,\n ValueText: SelectValueText,\n Indicator: SelectIndicator,\n Positioner: SelectPositioner,\n Content: SelectContent,\n ItemGroup: SelectItemGroup,\n ItemGroupLabel: SelectItemGroupLabel,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n HiddenSelect: SelectHiddenSelect,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgGO,IAAM,cAAgC;AAAA,EAC3C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,eAAe;AAAA,EACf,cAAc;AAChB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import type { CheckboxRootProps } from '@ark-ui/react'\nimport { type CheckboxVariantProps } from '@cerberus/styled-system/recipes'\nimport { Show } from '../Show'\nimport { Text } from '../Text'\nimport { CheckboxParts } from './parts'\nimport { CheckboxIcon } from './checkbox-icon'\n\n/**\n * This module contains the Checkbox component.\n * @module\n */\n\nexport type CheckboxProps = CheckboxVariantProps & CheckboxRootProps\n\n/**\n * Checkbox component is an abstraction of the primitives that displays a\n * controlled checkbox with a label.\n * @description [Cerberus Docs] https://cerberus.digitalu.design/react/checkbox\n * @description [Ark Docs] https://ark-ui.com/docs/components/checkbox\n */\nexport function Checkbox(props: CheckboxProps) {\n const { size, children, ...rootProps } = props\n\n return (\n <CheckboxParts.Root {...rootProps}>\n <CheckboxParts.Control size={size}>\n <CheckboxIcon indeterminate={rootProps.checked === 'indeterminate'} />\n </CheckboxParts.Control>\n\n <CheckboxParts.Label size={size}>\n {children}\n <Show when={props.required}>\n <Text as=\"span\" data-part=\"required-indicator\">\n (required)\n </Text>\n </Show>\n </CheckboxParts.Label>\n\n <CheckboxParts.HiddenInput />\n </CheckboxParts.Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AA0BQ,cAGF,YAHE;AAND,SAAS,SAAS,OAAsB;AAC7C,QAAM,EAAE,MAAM,UAAU,GAAG,UAAU,IAAI;AAEzC,SACE,qBAAC,cAAc,MAAd,EAAoB,GAAG,WACtB;AAAA,wBAAC,cAAc,SAAd,EAAsB,MACrB,8BAAC,gBAAa,eAAe,UAAU,YAAY,iBAAiB,GACtE;AAAA,IAEA,qBAAC,cAAc,OAAd,EAAoB,MAClB;AAAA;AAAA,MACD,oBAAC,QAAK,MAAM,MAAM,UAChB,8BAAC,QAAK,IAAG,QAAO,aAAU,sBAAqB,wBAE/C,GACF;AAAA,OACF;AAAA,IAEA,oBAAC,cAAc,aAAd,EAA0B;AAAA,KAC7B;AAEJ;","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "../../chunk-2LF3HPNA.js";
|
|
2
|
+
import {
|
|
3
|
+
OptionGroup,
|
|
4
|
+
OptionGroupLabel
|
|
5
|
+
} from "../../chunk-IASVL7CW.js";
|
|
6
|
+
import {
|
|
7
|
+
Option,
|
|
8
|
+
Select
|
|
9
|
+
} from "../../chunk-P3SF56LT.js";
|
|
10
|
+
import "../../chunk-IQJDVFPP.js";
|
|
11
|
+
import {
|
|
12
|
+
SelectParts
|
|
13
|
+
} from "../../chunk-XTNGF4D6.js";
|
|
14
|
+
import {
|
|
15
|
+
SelectClearTrigger,
|
|
16
|
+
SelectContent,
|
|
17
|
+
SelectControl,
|
|
18
|
+
SelectHiddenSelect,
|
|
19
|
+
SelectIndicator,
|
|
20
|
+
SelectItem,
|
|
21
|
+
SelectItemGroup,
|
|
22
|
+
SelectItemGroupLabel,
|
|
23
|
+
SelectItemIndicator,
|
|
24
|
+
SelectItemText,
|
|
25
|
+
SelectLabel,
|
|
26
|
+
SelectPositioner,
|
|
27
|
+
SelectRoot,
|
|
28
|
+
SelectTrigger,
|
|
29
|
+
SelectValueText,
|
|
30
|
+
createSelectCollection
|
|
31
|
+
} from "../../chunk-QCBLRACK.js";
|
|
32
|
+
import "../../chunk-GITT5645.js";
|
|
33
|
+
import "../../chunk-BUVVRQLZ.js";
|
|
34
|
+
export {
|
|
35
|
+
Option,
|
|
36
|
+
OptionGroup,
|
|
37
|
+
OptionGroupLabel,
|
|
38
|
+
Select,
|
|
39
|
+
SelectClearTrigger,
|
|
40
|
+
SelectContent,
|
|
41
|
+
SelectControl,
|
|
42
|
+
SelectHiddenSelect,
|
|
43
|
+
SelectIndicator,
|
|
44
|
+
SelectItem,
|
|
45
|
+
SelectItemGroup,
|
|
46
|
+
SelectItemGroupLabel,
|
|
47
|
+
SelectItemIndicator,
|
|
48
|
+
SelectItemText,
|
|
49
|
+
SelectLabel,
|
|
50
|
+
SelectParts,
|
|
51
|
+
SelectPositioner,
|
|
52
|
+
SelectRoot,
|
|
53
|
+
SelectTrigger,
|
|
54
|
+
SelectValueText,
|
|
55
|
+
createSelectCollection
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
SelectClearTrigger,
|
|
3
3
|
SelectContent,
|
|
4
4
|
SelectControl,
|
|
5
|
+
SelectHiddenSelect,
|
|
5
6
|
SelectIndicator,
|
|
6
7
|
SelectItem,
|
|
7
8
|
SelectItemGroup,
|
|
@@ -12,12 +13,14 @@ import {
|
|
|
12
13
|
SelectPositioner,
|
|
13
14
|
SelectRoot,
|
|
14
15
|
SelectTrigger,
|
|
15
|
-
SelectValueText
|
|
16
|
-
|
|
16
|
+
SelectValueText,
|
|
17
|
+
createSelectCollection
|
|
18
|
+
} from "../../chunk-QCBLRACK.js";
|
|
17
19
|
export {
|
|
18
20
|
SelectClearTrigger,
|
|
19
21
|
SelectContent,
|
|
20
22
|
SelectControl,
|
|
23
|
+
SelectHiddenSelect,
|
|
21
24
|
SelectIndicator,
|
|
22
25
|
SelectItem,
|
|
23
26
|
SelectItemGroup,
|
|
@@ -28,6 +31,7 @@ export {
|
|
|
28
31
|
SelectPositioner,
|
|
29
32
|
SelectRoot,
|
|
30
33
|
SelectTrigger,
|
|
31
|
-
SelectValueText
|
|
34
|
+
SelectValueText,
|
|
35
|
+
createSelectCollection
|
|
32
36
|
};
|
|
33
|
-
//# sourceMappingURL=
|
|
37
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Option,
|
|
4
|
+
Select
|
|
5
|
+
} from "../../chunk-P3SF56LT.js";
|
|
6
|
+
import "../../chunk-IQJDVFPP.js";
|
|
7
|
+
import "../../chunk-XTNGF4D6.js";
|
|
8
|
+
import "../../chunk-QCBLRACK.js";
|
|
9
|
+
import "../../chunk-GITT5645.js";
|
|
10
|
+
import "../../chunk-BUVVRQLZ.js";
|
|
11
|
+
export {
|
|
12
|
+
Option,
|
|
13
|
+
Select
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|