@oneplatformdev/ui 0.1.10-52 → 0.1.10-53

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.1.10-53 (2025-10-06)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated @oneplatformdev/utils to 0.1.1-102
6
+ - Updated @oneplatformdev/hooks to 0.1.0-88
7
+ - Updated @oneplatformdev/tokens to 0.0.1-75
8
+
1
9
  ## 0.1.10-52 (2025-10-04)
2
10
 
3
11
  ### 🧱 Updated Dependencies
@@ -1,9 +1,11 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { FormControl as g } from "../Form/Form.js";
3
3
  import { FormRenderControl as C } from "../Form/FormRenderControl.js";
4
- import "../Select/SelectRoot.js";
4
+ import "@radix-ui/react-select";
5
+ import "lucide-react";
6
+ import "@oneplatformdev/utils";
5
7
  import { Select as f } from "../Select/Select.js";
6
- const S = (n) => {
8
+ const j = (n) => {
7
9
  const {
8
10
  form: t,
9
11
  label: m,
@@ -36,6 +38,6 @@ const S = (n) => {
36
38
  );
37
39
  };
38
40
  export {
39
- S as FormSelect
41
+ j as FormSelect
40
42
  };
41
43
  //# sourceMappingURL=FormSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormSelect.js","sources":["../../src/FormSelect/FormSelect.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Select } from '../Select';\nimport { FormSelectProps } from './FormSelect.types';\nimport { FieldValues } from 'react-hook-form';\n\n// TODO: add description\nexport const FormSelect = <Data extends FieldValues, ExtendOptionData>(\n props: FormSelectProps<Data, ExtendOptionData>\n) => {\n const {\n form,\n label,\n name,\n options = [],\n onChange,\n containerProps,\n ...rest\n } = props;\n\n return (\n <FormRenderControl\n form={form}\n name={name}\n label={label}\n containerProps={containerProps}\n render={({ field }) => (\n <Select<ExtendOptionData>\n value={field.value}\n options={options}\n onChange={(value) => {\n field.onChange(value);\n onChange?.(value);\n }}\n renderTrigger={(_, defaultComponent) => (\n <FormControl>\n {defaultComponent}\n </FormControl>\n )}\n {...rest}\n />\n )}\n />\n );\n};\n"],"names":["FormSelect","props","form","label","name","options","onChange","containerProps","rest","jsx","FormRenderControl","field","Select","value","_","defaultComponent","FormControl"],"mappings":";;;;;AAMO,MAAMA,IAAa,CACxBC,MACG;AACH,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC,IAAU,CAAA;AAAA,IACV,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDP;AAEJ,SACE,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAR;AAAA,MACA,MAAAE;AAAA,MACA,OAAAD;AAAA,MACA,gBAAAI;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAI,EAAA,MACT,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,OAAOD,EAAM;AAAA,UACb,SAAAN;AAAA,UACA,UAAU,CAACQ,MAAU;AACnB,YAAAF,EAAM,SAASE,CAAK,GACpBP,IAAWO,CAAK;AAAA,UAClB;AAAA,UACA,eAAe,CAACC,GAAGC,MACjB,gBAAAN,EAACO,KACE,UAAAD,GACH;AAAA,UAED,GAAGP;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"FormSelect.js","sources":["../../src/FormSelect/FormSelect.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Select } from '../Select';\nimport { FormSelectProps } from './FormSelect.types';\nimport { FieldValues } from 'react-hook-form';\n\n// TODO: add description\nexport const FormSelect = <Data extends FieldValues, ExtendOptionData>(\n props: FormSelectProps<Data, ExtendOptionData>\n) => {\n const {\n form,\n label,\n name,\n options = [],\n onChange,\n containerProps,\n ...rest\n } = props;\n\n return (\n <FormRenderControl\n form={form}\n name={name}\n label={label}\n containerProps={containerProps}\n render={({ field }) => (\n <Select<ExtendOptionData>\n value={field.value}\n options={options}\n onChange={(value) => {\n field.onChange(value);\n onChange?.(value);\n }}\n renderTrigger={(_, defaultComponent) => (\n <FormControl>\n {defaultComponent}\n </FormControl>\n )}\n {...rest}\n />\n )}\n />\n );\n};\n"],"names":["FormSelect","props","form","label","name","options","onChange","containerProps","rest","jsx","FormRenderControl","field","Select","value","_","defaultComponent","FormControl"],"mappings":";;;;;;;AAMO,MAAMA,IAAa,CACxBC,MACG;AACH,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,SAAAC,IAAU,CAAA;AAAA,IACV,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDP;AAEJ,SACE,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAR;AAAA,MACA,MAAAE;AAAA,MACA,OAAAD;AAAA,MACA,gBAAAI;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAI,EAAA,MACT,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,OAAOD,EAAM;AAAA,UACb,SAAAN;AAAA,UACA,UAAU,CAACQ,MAAU;AACnB,YAAAF,EAAM,SAASE,CAAK,GACpBP,IAAWO,CAAK;AAAA,UAClB;AAAA,UACA,eAAe,CAACC,GAAGC,MACjB,gBAAAN,EAACO,KACE,UAAAD,GACH;AAAA,UAED,GAAGP;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAIR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,WAAW,EAIZ,MAAM,WAAW,CAAC;AAsHnB,eAAO,MAAM,MAAM,GAAI,gBAAgB,EACrC,OAAO,WAAW,CAAC,gBAAgB,CAAC,4CAuCrC,CAAC"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAIL,WAAW,EAIZ,MAAM,WAAW,CAAC;AAsHnB,eAAO,MAAM,MAAM,GAAI,gBAAgB,EACrC,OAAO,WAAW,CAAC,gBAAgB,CAAC,4CAuCrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import * as React from 'react';\nimport { isValidElement, ReactNode } from 'react';\n\nimport { Button } from '../Button';\nimport {\n SelectContent,\n SelectItem,\n SelectOption,\n SelectProps,\n SelectRoot,\n SelectTrigger,\n SelectValue,\n} from '../Select';\nimport { isValidReactElement } from '@oneplatformdev/utils';\n\nconst RenderSelectTrigger = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData>\n) => {\n const { placeholder, renderTrigger, slotProps } = props;\n const defaultComponent = (\n <SelectTrigger {...(slotProps?.triggerProps || {})}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n );\n\n if (\n Boolean(renderTrigger) &&\n typeof renderTrigger === 'function' &&\n isValidReactElement(renderTrigger(props, defaultComponent))\n ) {\n return renderTrigger(props, defaultComponent);\n }\n\n return defaultComponent;\n};\n\nconst DefaultRenderSelectOption = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n deep?: number;\n children?: ((params: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n }) => ReactNode) | ReactNode;\n }\n) => {\n const { children, option, deep = 0 } = props;\n\n return (\n <SelectItem\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n className='cursor-pointer'\n style={{ paddingLeft: `calc(8px + ${(deep || 0) * 8}px)` }}\n >\n {!children && option.label}\n {children && (\n <>\n {typeof children === 'function'\n ? children({ ...props })\n : children\n }\n </>\n )}\n </SelectItem>\n )\n};\n\nconst RenderSelectOption = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n deep?: number;\n }\n) => {\n const { renderOption, option, index, options, deep = 0, ...rest } = props;\n\n if (\n Boolean(renderOption) &&\n typeof renderOption === 'function' &&\n isValidElement(\n renderOption(\n option,\n index,\n options,\n { ...rest, options },\n <DefaultRenderSelectOption {...props} />\n )\n )\n ) {\n return (\n <SelectItem key={option.value} value={option.value}>\n {renderOption(\n option,\n index,\n options,\n { ...rest, options },\n <DefaultRenderSelectOption {...props} />\n )}\n </SelectItem>\n );\n }\n\n if(!option.children?.length) {\n return <DefaultRenderSelectOption {...props} />;\n }\n\n return (\n <div\n key={option.value}\n className=\"flex flex-col gap-1 truncate line-clamp-2\"\n >\n <DefaultRenderSelectOption {...props} />\n {option.children?.map((child, idx, arr) => (\n <RenderSelectOption\n {...props}\n key={child.value}\n option={child}\n options={arr}\n index={idx}\n deep={(deep || 0) + 1}\n />\n ))}\n </div>\n )\n};\n\n// TODO: add description\nexport const Select = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData>\n) => {\n const {\n value,\n options,\n onChange,\n nullable = false,\n clearLabel = 'Clear',\n disabled,\n } = props;\n\n return (\n <SelectRoot value={value} onValueChange={onChange} disabled={disabled}>\n <RenderSelectTrigger {...props} />\n <SelectContent>\n {nullable && (\n <Button\n className=\"w-full px-2\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={() => {\n onChange?.('');\n }}\n >\n {clearLabel}\n </Button>\n )}\n {options.map((option, index) => (\n <RenderSelectOption\n {...props}\n key={option.value}\n option={option}\n index={index}\n deep={0}\n />\n ))}\n </SelectContent>\n </SelectRoot>\n );\n};\n"],"names":["RenderSelectTrigger","props","placeholder","renderTrigger","slotProps","defaultComponent","jsx","SelectTrigger","SelectValue","isValidReactElement","DefaultRenderSelectOption","children","option","deep","jsxs","SelectItem","Fragment","RenderSelectOption","renderOption","index","options","rest","isValidElement","child","idx","arr","createElement","Select","value","onChange","nullable","clearLabel","disabled","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SAAS,MAAM;AACb,YAAAN,IAAW,EAAE;AAAA,UACf;AAAA,UAEC,UAAAE;AAAA,QAAA;AAAA,MAAA;AAAA,MAGJX,EAAQ,IAAI,CAACR,GAAQO,MACpB,gBAAAO;AAAA,QAACT;AAAA,QAAA;AAAA,UACE,GAAGhB;AAAA,UACJ,KAAKW,EAAO;AAAA,UACZ,QAAAA;AAAA,UACA,OAAAO;AAAA,UACA,MAAM;AAAA,QAAA;AAAA,MAAA,CAET;AAAA,IAAA,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Select.js","sources":["../../src/Select/Select.tsx"],"sourcesContent":["import { isValidElement, ReactNode } from 'react';\n\nimport { Button } from '../Button';\nimport {\n SelectContent,\n SelectItem,\n SelectOption,\n SelectProps,\n SelectRoot,\n SelectTrigger,\n SelectValue,\n} from '../Select';\nimport { isValidReactElement } from '@oneplatformdev/utils';\n\nconst RenderSelectTrigger = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData>\n) => {\n const { placeholder, renderTrigger, slotProps } = props;\n const defaultComponent = (\n <SelectTrigger {...(slotProps?.triggerProps || {})}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n );\n\n if (\n Boolean(renderTrigger) &&\n typeof renderTrigger === 'function' &&\n isValidReactElement(renderTrigger(props, defaultComponent))\n ) {\n return renderTrigger(props, defaultComponent);\n }\n\n return defaultComponent;\n};\n\nconst DefaultRenderSelectOption = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n deep?: number;\n children?: ((params: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n }) => ReactNode) | ReactNode;\n }\n) => {\n const { children, option, deep = 0 } = props;\n\n return (\n <SelectItem\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n className='cursor-pointer'\n style={{ paddingLeft: `calc(8px + ${(deep || 0) * 8}px)` }}\n >\n {!children && option.label}\n {children && (\n <>\n {typeof children === 'function'\n ? children({ ...props })\n : children\n }\n </>\n )}\n </SelectItem>\n )\n};\n\nconst RenderSelectOption = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData> & {\n option: SelectOption<ExtendOptionData>;\n index: number;\n deep?: number;\n }\n) => {\n const { renderOption, option, index, options, deep = 0, ...rest } = props;\n\n if (\n Boolean(renderOption) &&\n typeof renderOption === 'function' &&\n isValidElement(\n renderOption(\n option,\n index,\n options,\n { ...rest, options },\n <DefaultRenderSelectOption {...props} />\n )\n )\n ) {\n return (\n <SelectItem key={option.value} value={option.value}>\n {renderOption(\n option,\n index,\n options,\n { ...rest, options },\n <DefaultRenderSelectOption {...props} />\n )}\n </SelectItem>\n );\n }\n\n if(!option.children?.length) {\n return <DefaultRenderSelectOption {...props} />;\n }\n\n return (\n <div\n key={option.value}\n className=\"flex flex-col gap-1 truncate line-clamp-2\"\n >\n <DefaultRenderSelectOption {...props} />\n {option.children?.map((child, idx, arr) => (\n <RenderSelectOption\n {...props}\n key={child.value}\n option={child}\n options={arr}\n index={idx}\n deep={(deep || 0) + 1}\n />\n ))}\n </div>\n )\n};\n\n// TODO: add description\nexport const Select = <ExtendOptionData,>(\n props: SelectProps<ExtendOptionData>\n) => {\n const {\n value,\n options,\n onChange,\n nullable = false,\n clearLabel = 'Clear',\n disabled,\n } = props;\n\n return (\n <SelectRoot value={value} onValueChange={onChange} disabled={disabled}>\n <RenderSelectTrigger {...props} />\n <SelectContent>\n {nullable && (\n <Button\n className=\"w-full px-2\"\n variant=\"secondary\"\n size=\"sm\"\n onClick={() => {\n onChange?.('');\n }}\n >\n {clearLabel}\n </Button>\n )}\n {options.map((option, index) => (\n <RenderSelectOption\n {...props}\n key={option.value}\n option={option}\n index={index}\n deep={0}\n />\n ))}\n </SelectContent>\n </SelectRoot>\n );\n};\n"],"names":["RenderSelectTrigger","props","placeholder","renderTrigger","slotProps","defaultComponent","jsx","SelectTrigger","SelectValue","isValidReactElement","DefaultRenderSelectOption","children","option","deep","jsxs","SelectItem","Fragment","RenderSelectOption","renderOption","index","options","rest","isValidElement","child","idx","arr","createElement","Select","value","onChange","nullable","clearLabel","disabled","SelectRoot","SelectContent","Button"],"mappings":";;;;;;AAcA,MAAMA,IAAsB,CAC1BC,MACG;AACH,QAAM,EAAE,aAAAC,GAAa,eAAAC,GAAe,WAAAC,EAAA,IAAcH,GAC5CI,IACJ,gBAAAC,EAACC,GAAA,EAAe,GAAIH,GAAW,gBAAgB,IAC7C,UAAA,gBAAAE,EAACE,GAAA,EAAY,aAAAN,EAAA,CAA0B,EAAA,CACzC;AAGF,SACUC,KACR,OAAOA,KAAkB,cACzBM,EAAoBN,EAAcF,GAAOI,CAAgB,CAAC,IAEnDF,EAAcF,GAAOI,CAAgB,IAGvCA;AACT,GAEMK,IAA4B,CAChCT,MASG;AACH,QAAM,EAAE,UAAAU,GAAU,QAAAC,GAAQ,MAAAC,IAAO,MAAMZ;AAEvC,SACE,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MAEC,OAAOH,EAAO;AAAA,MACd,UAAUA,EAAO;AAAA,MACjB,WAAU;AAAA,MACV,OAAO,EAAE,aAAa,eAAeC,KAAQ,KAAK,CAAC,MAAA;AAAA,MAElD,UAAA;AAAA,QAAA,CAACF,KAAYC,EAAO;AAAA,QACpBD,KACC,gBAAAL,EAAAU,GAAA,EACG,UAAA,OAAOL,KAAa,aACjBA,EAAS,EAAE,GAAGV,EAAA,CAAO,IACrBU,EAAA,CAEN;AAAA,MAAA;AAAA,IAAA;AAAA,IAbGC,EAAO;AAAA,EAAA;AAiBlB,GAEMK,IAAqB,CACzBhB,MAKG;AACH,QAAM,EAAE,cAAAiB,GAAc,QAAAN,GAAQ,OAAAO,GAAO,SAAAC,GAAS,MAAAP,IAAO,GAAG,GAAGQ,EAAA,IAASpB;AAEpE,SACUiB,KACR,OAAOA,KAAiB,cACxBI;AAAA,IACEJ;AAAA,MACEN;AAAA,MACAO;AAAA,MACAC;AAAA,MACA,EAAE,G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BAAAxB;AAAA,QAAC6B;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,SAAS,MAAM;AACb,YAAAN,IAAW,EAAE;AAAA,UACf;AAAA,UAEC,UAAAE;AAAA,QAAA;AAAA,MAAA;AAAA,MAGJX,EAAQ,IAAI,CAACR,GAAQO,MACpB,gBAAAO;AAAA,QAACT;AAAA,QAAA;AAAA,UACE,GAAGhB;AAAA,UACJ,KAAKW,EAAO;AAAA,UACZ,QAAAA;AAAA,UACA,OAAAO;AAAA,UACA,MAAM;AAAA,QAAA;AAAA,MAAA,CAET;AAAA,IAAA,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,14 +1,16 @@
1
- import * as React from 'react';
2
- import * as SelectPrimitive from '@radix-ui/react-select';
3
- declare const SelectRoot: React.FC<SelectPrimitive.SelectProps>;
4
- declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
- declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
- declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
- declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
- declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
- declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
- declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
- declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
- declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
- export { SelectRoot, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ declare function SelectRoot({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
5
+ declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
6
+ declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
+ size?: "sm" | "default";
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
10
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
11
+ declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
12
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
13
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
14
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
15
+ export { SelectRoot, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectPrimitive, };
14
16
  //# sourceMappingURL=SelectRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectRoot.d.ts","sourceRoot":"","sources":["../../src/Select/SelectRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,UAAU,uCAAuB,CAAC;AAExC,QAAA,MAAM,WAAW,yGAAwB,CAAA;AAEzC,QAAA,MAAM,WAAW,0GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,oKAkBjB,CAAA;AAGF,QAAA,MAAM,oBAAoB,qKAcxB,CAAA;AAGF,QAAA,MAAM,sBAAsB,uKAc1B,CAAA;AAIF,QAAA,MAAM,aAAa,8JAiCjB,CAAA;AAGF,QAAA,MAAM,WAAW,4JASf,CAAA;AAGF,QAAA,MAAM,UAAU,2JAmBd,CAAA;AAGF,QAAA,MAAM,eAAe,gKASnB,CAAA;AAGF,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAA"}
1
+ {"version":3,"file":"SelectRoot.d.ts","sourceRoot":"","sources":["../../src/Select/SelectRoot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,iBAAS,UAAU,CAAC,EACF,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,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AAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAa/F;AAED,OAAO,EACL,UAAU,EACV,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,EACX,eAAe,GAChB,CAAA"}
@@ -1,127 +1,173 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import * as e from "@radix-ui/react-select";
4
- import { ChevronDown as n, ChevronUp as u, Check as h } from "lucide-react";
1
+ import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
+ import * as a from "@radix-ui/react-select";
3
+ import { CheckIcon as c, ChevronDownIcon as i, ChevronUpIcon as u } from "lucide-react";
5
4
  import { cn as s } from "@oneplatformdev/utils";
6
- const R = e.Root, C = e.Group, I = e.Value, w = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ i(
7
- e.Trigger,
8
- {
9
- ref: d,
10
- className: s(
11
- "flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
12
- "disabled:[&>svg]:hidden",
13
- o
14
- ),
15
- ...a,
16
- children: [
17
- r,
18
- /* @__PURE__ */ t(e.Icon, { asChild: !0, children: /* @__PURE__ */ t(n, { className: "h-4 w-4 opacity-50" }) })
19
- ]
20
- }
21
- ));
22
- w.displayName = e.Trigger.displayName;
23
- const c = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
24
- e.ScrollUpButton,
25
- {
26
- ref: a,
27
- className: s(
28
- "flex cursor-default items-center justify-center py-1",
29
- o
30
- ),
31
- ...r,
32
- children: /* @__PURE__ */ t(u, { className: "h-4 w-4" })
33
- }
34
- ));
35
- c.displayName = e.ScrollUpButton.displayName;
36
- const m = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
37
- e.ScrollDownButton,
38
- {
39
- ref: a,
40
- className: s(
41
- "flex cursor-default items-center justify-center py-1",
42
- o
43
- ),
44
- ...r,
45
- children: /* @__PURE__ */ t(n, { className: "h-4 w-4" })
46
- }
47
- ));
48
- m.displayName = e.ScrollDownButton.displayName;
49
- const y = l.forwardRef(({ className: o, children: r, position: a = "popper", style: d, ...p }, f) => /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ i(
50
- e.Content,
51
- {
52
- ref: f,
53
- className: s(
54
- "relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
55
- a === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
56
- o
57
- ),
58
- position: a,
59
- style: {
60
- pointerEvents: "auto",
61
- ...d
62
- },
63
- ...p,
64
- children: [
65
- /* @__PURE__ */ t(c, {}),
66
- /* @__PURE__ */ t(
67
- e.Viewport,
68
- {
69
- className: s(
70
- "p-1",
71
- a === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
72
- ),
73
- children: r
74
- }
5
+ function x({
6
+ ...e
7
+ }) {
8
+ return /* @__PURE__ */ t(a.Root, { "data-slot": "select", ...e });
9
+ }
10
+ function h({
11
+ ...e
12
+ }) {
13
+ return /* @__PURE__ */ t(a.Group, { "data-slot": "select-group", ...e });
14
+ }
15
+ function b({
16
+ ...e
17
+ }) {
18
+ return /* @__PURE__ */ t(a.Value, { "data-slot": "select-value", ...e });
19
+ }
20
+ function w({
21
+ className: e,
22
+ size: r = "default",
23
+ children: o,
24
+ ...n
25
+ }) {
26
+ return /* @__PURE__ */ l(
27
+ a.Trigger,
28
+ {
29
+ "data-slot": "select-trigger",
30
+ "data-size": r,
31
+ className: s(
32
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
33
+ e
75
34
  ),
76
- /* @__PURE__ */ t(m, {})
77
- ]
78
- }
79
- ) }));
80
- y.displayName = e.Content.displayName;
81
- const g = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
82
- e.Label,
83
- {
84
- ref: a,
85
- className: s("px-2 py-1.5 text-sm font-semibold", o),
86
- ...r
87
- }
88
- ));
89
- g.displayName = e.Label.displayName;
90
- const N = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ i(
91
- e.Item,
92
- {
93
- ref: d,
94
- className: s(
95
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
96
- o
97
- ),
98
- ...a,
99
- children: [
100
- /* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(h, { className: "h-4 w-4" }) }) }),
101
- /* @__PURE__ */ t(e.ItemText, { children: r })
102
- ]
103
- }
104
- ));
105
- N.displayName = e.Item.displayName;
106
- const x = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
107
- e.Separator,
108
- {
109
- ref: a,
110
- className: s("-mx-1 my-1 h-px bg-muted", o),
111
- ...r
112
- }
113
- ));
114
- x.displayName = e.Separator.displayName;
35
+ ...n,
36
+ children: [
37
+ o,
38
+ /* @__PURE__ */ t(a.Icon, { asChild: !0, children: /* @__PURE__ */ t(i, { className: "size-4 opacity-50" }) })
39
+ ]
40
+ }
41
+ );
42
+ }
43
+ function y({
44
+ className: e,
45
+ children: r,
46
+ position: o = "popper",
47
+ align: n = "center",
48
+ ...d
49
+ }) {
50
+ return /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ l(
51
+ a.Content,
52
+ {
53
+ "data-slot": "select-content",
54
+ className: s(
55
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
56
+ o === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
57
+ e
58
+ ),
59
+ position: o,
60
+ align: n,
61
+ ...d,
62
+ children: [
63
+ /* @__PURE__ */ t(p, {}),
64
+ /* @__PURE__ */ t(
65
+ a.Viewport,
66
+ {
67
+ className: s(
68
+ "p-1",
69
+ o === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
70
+ ),
71
+ children: r
72
+ }
73
+ ),
74
+ /* @__PURE__ */ t(m, {})
75
+ ]
76
+ }
77
+ ) });
78
+ }
79
+ function S({
80
+ className: e,
81
+ ...r
82
+ }) {
83
+ return /* @__PURE__ */ t(
84
+ a.Label,
85
+ {
86
+ "data-slot": "select-label",
87
+ className: s("text-muted-foreground px-2 py-1.5 text-xs", e),
88
+ ...r
89
+ }
90
+ );
91
+ }
92
+ function z({
93
+ className: e,
94
+ children: r,
95
+ ...o
96
+ }) {
97
+ return /* @__PURE__ */ l(
98
+ a.Item,
99
+ {
100
+ "data-slot": "select-item",
101
+ className: s(
102
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
103
+ e
104
+ ),
105
+ ...o,
106
+ children: [
107
+ /* @__PURE__ */ t("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(a.ItemIndicator, { children: /* @__PURE__ */ t(c, { className: "size-4" }) }) }),
108
+ /* @__PURE__ */ t(a.ItemText, { children: r })
109
+ ]
110
+ }
111
+ );
112
+ }
113
+ function N({
114
+ className: e,
115
+ ...r
116
+ }) {
117
+ return /* @__PURE__ */ t(
118
+ a.Separator,
119
+ {
120
+ "data-slot": "select-separator",
121
+ className: s("bg-border pointer-events-none -mx-1 my-1 h-px", e),
122
+ ...r
123
+ }
124
+ );
125
+ }
126
+ function p({
127
+ className: e,
128
+ ...r
129
+ }) {
130
+ return /* @__PURE__ */ t(
131
+ a.ScrollUpButton,
132
+ {
133
+ "data-slot": "select-scroll-up-button",
134
+ className: s(
135
+ "flex cursor-default items-center justify-center py-1",
136
+ e
137
+ ),
138
+ ...r,
139
+ children: /* @__PURE__ */ t(u, { className: "size-4" })
140
+ }
141
+ );
142
+ }
143
+ function m({
144
+ className: e,
145
+ ...r
146
+ }) {
147
+ return /* @__PURE__ */ t(
148
+ a.ScrollDownButton,
149
+ {
150
+ "data-slot": "select-scroll-down-button",
151
+ className: s(
152
+ "flex cursor-default items-center justify-center py-1",
153
+ e
154
+ ),
155
+ ...r,
156
+ children: /* @__PURE__ */ t(i, { className: "size-4" })
157
+ }
158
+ );
159
+ }
115
160
  export {
116
161
  y as SelectContent,
117
- C as SelectGroup,
118
- N as SelectItem,
119
- g as SelectLabel,
120
- R as SelectRoot,
162
+ h as SelectGroup,
163
+ z as SelectItem,
164
+ S as SelectLabel,
165
+ a as SelectPrimitive,
166
+ x as SelectRoot,
121
167
  m as SelectScrollDownButton,
122
- c as SelectScrollUpButton,
123
- x as SelectSeparator,
168
+ p as SelectScrollUpButton,
169
+ N as SelectSeparator,
124
170
  w as SelectTrigger,
125
- I as SelectValue
171
+ b as SelectValue
126
172
  };
127
173
  //# sourceMappingURL=SelectRoot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectRoot.js","sources":["../../src/Select/SelectRoot.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\n\nimport { cn } from '@oneplatformdev/utils';\n\nconst SelectRoot = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group\n\nconst SelectValue = SelectPrimitive.Value\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n 'disabled:[&>svg]:hidden',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", style, ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n style={{\n pointerEvents: 'auto',\n ...style,\n }}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n SelectRoot,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n}\n"],"names":["SelectRoot","SelectPrimitive","SelectGroup","SelectValue","SelectTrigger","React","className","children","props","ref","jsxs","cn","jsx","ChevronDown","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","SelectContent","position","style","SelectLabel","SelectItem","Check","SelectSeparator"],"mappings":";;;;;AAQA,MAAMA,IAAaC,EAAgB,MAE7BC,IAAcD,EAAgB,OAE9BE,IAAcF,EAAgB,OAE9BG,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAASC,MACpC,gBAAAC;AAAA,EAACT,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACA;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,MACD,gBAAAK,EAACX,EAAgB,MAAhB,EAAqB,SAAO,IAC3B,UAAA,gBAAAW,EAACC,GAAA,EAAY,WAAU,qBAAA,CAAqB,EAAA,CAC9C;AAAA,IAAA;AAAA,EAAA;AACF,CACD;AACDT,EAAc,cAAcH,EAAgB,QAAQ;AAEpD,MAAMa,IAAuBT,EAAM,WAGjC,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAG;AAAA,EAACX,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WA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,EAAc,cAAchB,EAAgB,QAAQ;AAEpD,MAAMmB,IAAcf,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAG;AAAA,EAACX,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WAAWE,EAAG,qCAAqCL,CAAS;AAAA,IAC3D,GAAGE;AAAA,EAAA;AACN,CACD;AACDY,EAAY,cAAcnB,EAAgB,MAAM;AAEhD,MAAMoB,IAAahB,EAAM,WAGvB,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAASC,MACpC,gBAAAC;AAAA,EAACT,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAI,EAAC,QAAA,EAAK,WAAU,iEACd,UAAA,gBAAAA,EAACX,EAAgB,eAAhB,EACC,UAAA,gBAAAW,EAACU,GAAA,EAAM,WAAU,UAAA,CAAU,EAAA,CAC7B,GACF;AAAA,MACA,gBAAAV,EAACX,EAAgB,UAAhB,EAA0B,UAAAM,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AACtC,CACD;AACDc,EAAW,cAAcpB,EAAgB,KAAK;AAE9C,MAAMsB,IAAkBlB,EAAM,WAG5B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1B,gBAAAG;AAAA,EAACX,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WAAWE,EAAG,4BAA4BL,CAAS;AAAA,IAClD,GAAGE;AAAA,EAAA;AACN,CACD;AACDe,EAAgB,cAActB,EAAgB,UAAU;"}
1
+ {"version":3,"file":"SelectRoot.js","sources":["../../src/Select/SelectRoot.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\n\nimport { cn } from \"@oneplatformdev/utils\"\n\nfunction SelectRoot({\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\nfunction SelectValue({\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"popper\",\n align = \"center\",\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n )\n}\n\nexport {\n SelectRoot,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n SelectPrimitive,\n}\n"],"names":["SelectRoot","props","SelectPrimitive","SelectGroup","SelectValue","SelectTrigger","className","size","children","jsxs","cn","jsx","ChevronDownIcon","SelectContent","position","align","SelectScrollUpButton","SelectScrollDownButton","SelectLabel","SelectItem","CheckIcon","SelectSeparator","ChevronUpI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,IAAA;AAAA,EAAA;AAGV;AAEA,SAASe,EAAqB;AAAA,EACE,WAAAV;AAAA,EACA,GAAGL;AACL,GAAgE;AAC5F,SACE,gBAAAU;AAAA,IAACT,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWQ;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGL;AAAA,MAEJ,UAAA,gBAAAU,EAACW,GAAA,EAAc,WAAU,SAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGxC;AAEA,SAASL,EAAuB;AAAA,EACE,WAAAX;AAAA,EACA,GAAGL;AACL,GAAkE;AAChG,SACE,gBAAAU;AAAA,IAACT,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWQ;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGL;AAAA,MAEJ,UAAA,gBAAAU,EAACC,GAAA,EAAgB,WAAU,SAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAG1C;"}
package/Select/index.js CHANGED
@@ -1,16 +1,18 @@
1
- import { SelectContent as l, SelectGroup as o, SelectItem as S, SelectLabel as c, SelectRoot as r, SelectScrollDownButton as n, SelectScrollUpButton as p, SelectSeparator as a, SelectTrigger as u, SelectValue as m } from "./SelectRoot.js";
2
- import { Select as g } from "./Select.js";
1
+ import { SelectContent as o, SelectGroup as r, SelectItem as S, SelectLabel as c, SelectRoot as p, SelectScrollDownButton as m, SelectScrollUpButton as a, SelectSeparator as i, SelectTrigger as n, SelectValue as u } from "./SelectRoot.js";
2
+ import { Select as x } from "./Select.js";
3
+ import * as e from "@radix-ui/react-select";
3
4
  export {
4
- g as Select,
5
- l as SelectContent,
6
- o as SelectGroup,
5
+ x as Select,
6
+ o as SelectContent,
7
+ r as SelectGroup,
7
8
  S as SelectItem,
8
9
  c as SelectLabel,
9
- r as SelectRoot,
10
- n as SelectScrollDownButton,
11
- p as SelectScrollUpButton,
12
- a as SelectSeparator,
13
- u as SelectTrigger,
14
- m as SelectValue
10
+ e as SelectPrimitive,
11
+ p as SelectRoot,
12
+ m as SelectScrollDownButton,
13
+ a as SelectScrollUpButton,
14
+ i as SelectSeparator,
15
+ n as SelectTrigger,
16
+ u as SelectValue
15
17
  };
16
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,21 +1,23 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
2
  import { Button as o } from "../Button/Button.js";
3
3
  import "../Button/buttonVariants.js";
4
- import "../Select/SelectRoot.js";
4
+ import "@radix-ui/react-select";
5
+ import "lucide-react";
6
+ import "@oneplatformdev/utils";
5
7
  import { Select as P } from "../Select/Select.js";
6
- const y = ({
8
+ const L = ({
7
9
  offset: l,
8
10
  limit: a,
9
11
  totalRows: s,
10
12
  setLimit: p,
11
13
  setOffset: t,
12
- tRowsPerPage: d = "Rows per page",
13
- tPrevious: m = "Previous",
14
+ tRowsPerPage: m = "Rows per page",
15
+ tPrevious: d = "Previous",
14
16
  tPage: u = "Page",
15
17
  tNext: x = "Next",
16
18
  tOf: v = "Of"
17
19
  }) => {
18
- const i = Math.ceil(l / a) + 1, r = Math.ceil(s / a), h = i === r, b = (e) => {
20
+ const r = Math.ceil(l / a) + 1, c = Math.ceil(s / a), h = r === c, b = (e) => {
19
21
  t(0), p(parseInt(e));
20
22
  }, g = () => {
21
23
  let e = l - a;
@@ -24,9 +26,9 @@ const y = ({
24
26
  let e = l + a;
25
27
  e > s && (e = s - a), t(e);
26
28
  };
27
- return /* @__PURE__ */ c("div", { className: "flex items-center justify-end space-x-2 py-4", children: [
28
- /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
29
- /* @__PURE__ */ n("span", { className: "text-sm text-nowrap", children: d }),
29
+ return /* @__PURE__ */ i("div", { className: "flex items-center justify-end space-x-2 py-4", children: [
30
+ /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
31
+ /* @__PURE__ */ n("span", { className: "text-sm text-nowrap", children: m }),
30
32
  /* @__PURE__ */ n(
31
33
  P,
32
34
  {
@@ -44,7 +46,7 @@ const y = ({
44
46
  }
45
47
  )
46
48
  ] }),
47
- /* @__PURE__ */ c("div", { className: "space-x-2", children: [
49
+ /* @__PURE__ */ i("div", { className: "space-x-2", children: [
48
50
  /* @__PURE__ */ n(
49
51
  o,
50
52
  {
@@ -52,10 +54,10 @@ const y = ({
52
54
  size: "sm",
53
55
  disabled: !l,
54
56
  onClick: g,
55
- children: m
57
+ children: d
56
58
  }
57
59
  ),
58
- /* @__PURE__ */ n("span", { className: "text-sm", children: `${u} ${i} ${v} ${r}` }),
60
+ /* @__PURE__ */ n("span", { className: "text-sm", children: `${u} ${r} ${v} ${c}` }),
59
61
  /* @__PURE__ */ n(
60
62
  o,
61
63
  {
@@ -70,6 +72,6 @@ const y = ({
70
72
  ] });
71
73
  };
72
74
  export {
73
- y as TablePagination
75
+ L as TablePagination
74
76
  };
75
77
  //# sourceMappingURL=TablePagination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TablePagination.js","sources":["../../src/TablePagination/TablePagination.tsx"],"sourcesContent":["'use client';\n\nimport { Button } from '../Button';\nimport { Select } from '../Select';\nimport { FC } from 'react';\n\ninterface IProps {\n limit: number;\n offset: number;\n totalRows: number;\n setLimit: (limit: number) => void;\n setOffset: (offset: number) => void;\n tRowsPerPage?: string;\n tPrevious?: string;\n tPage?:string;\n tNext?:string;\n tOf?:string\n}\n\nexport const TablePagination: FC<IProps> = ({\n offset,\n limit,\n totalRows,\n setLimit,\n setOffset,\n tRowsPerPage= \"Rows per page\",\n tPrevious= \"Previous\",\n tPage= \"Page\",\n tNext= \"Next\",\n tOf= \"Of\",\n}) => {\n const currentPage = Math.ceil(offset / limit) + 1;\n const totalPages = Math.ceil(totalRows / limit);\n const isLastPage = currentPage === totalPages;\n\n const onChangeLimit = (value: string) => {\n setOffset(0);\n setLimit(parseInt(value));\n };\n\n const onPrevious = () => {\n let nextOffset = offset - limit;\n if (nextOffset < 0) {\n nextOffset = 0;\n }\n setOffset(nextOffset);\n };\n\n const onNext = () => {\n let nextOffset = offset + limit;\n if (nextOffset > totalRows) {\n nextOffset = totalRows - limit;\n }\n setOffset(nextOffset);\n };\n\n return (\n <div className=\"flex items-center justify-end space-x-2 py-4\">\n <div className=\"flex items-center space-x-2\">\n <span className=\"text-sm text-nowrap\">{tRowsPerPage}</span>\n <Select\n value={limit?.toString()}\n options={[\n { value: '5', label: '5' },\n { value: '10', label: '10' },\n { value: '20', label: '20' },\n { value: '30', label: '30' },\n { value: '50', label: '50' },\n ]}\n onChange={onChangeLimit}\n placeholder=\"6\"\n nullable={false}\n />\n </div>\n <div className=\"space-x-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!offset}\n onClick={onPrevious}\n >\n {tPrevious}\n </Button>\n <span className=\"text-sm\">{`${tPage} ${currentPage} ${tOf} ${totalPages}`}</span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={isLastPage}\n onClick={onNext}\n >\n {tNext}\n </Button>\n </div>\n </div>\n );\n};\n"],"names":["TablePagination","offset","limit","totalRows","setLimit","setOffset","tRowsPerPage","tPrevious","tPage","tNext","tOf","currentPage","totalPages","isLastPage","onChangeLimit","value","onPrevious","nextOffset","onNext","jsxs","jsx","Select","Button"],"mappings":";;;;;AAmBO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC,IAAc;AAAA,EACd,WAAAC,IAAW;AAAA,EACX,OAAAC,IAAO;AAAA,EACP,OAAAC,IAAO;AAAA,EACP,KAAAC,IAAK;AACP,MAAM;AACJ,QAAMC,I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AAAA,MAEH,gBAAAa,EAAC,QAAA,EAAK,WAAU,WAAW,UAAA,GAAGZ,CAAK,IAAIG,CAAW,IAAID,CAAG,IAAIE,CAAU,IAAG;AAAA,MAC1E,gBAAAQ;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,UAAUT;AAAA,UACV,SAASK;AAAA,UAER,UAAAT;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"TablePagination.js","sources":["../../src/TablePagination/TablePagination.tsx"],"sourcesContent":["'use client';\n\nimport { Button } from '../Button';\nimport { Select } from '../Select';\nimport { FC } from 'react';\n\ninterface IProps {\n limit: number;\n offset: number;\n totalRows: number;\n setLimit: (limit: number) => void;\n setOffset: (offset: number) => void;\n tRowsPerPage?: string;\n tPrevious?: string;\n tPage?:string;\n tNext?:string;\n tOf?:string\n}\n\nexport const TablePagination: FC<IProps> = ({\n offset,\n limit,\n totalRows,\n setLimit,\n setOffset,\n tRowsPerPage= \"Rows per page\",\n tPrevious= \"Previous\",\n tPage= \"Page\",\n tNext= \"Next\",\n tOf= \"Of\",\n}) => {\n const currentPage = Math.ceil(offset / limit) + 1;\n const totalPages = Math.ceil(totalRows / limit);\n const isLastPage = currentPage === totalPages;\n\n const onChangeLimit = (value: string) => {\n setOffset(0);\n setLimit(parseInt(value));\n };\n\n const onPrevious = () => {\n let nextOffset = offset - limit;\n if (nextOffset < 0) {\n nextOffset = 0;\n }\n setOffset(nextOffset);\n };\n\n const onNext = () => {\n let nextOffset = offset + limit;\n if (nextOffset > totalRows) {\n nextOffset = totalRows - limit;\n }\n setOffset(nextOffset);\n };\n\n return (\n <div className=\"flex items-center justify-end space-x-2 py-4\">\n <div className=\"flex items-center space-x-2\">\n <span className=\"text-sm text-nowrap\">{tRowsPerPage}</span>\n <Select\n value={limit?.toString()}\n options={[\n { value: '5', label: '5' },\n { value: '10', label: '10' },\n { value: '20', label: '20' },\n { value: '30', label: '30' },\n { value: '50', label: '50' },\n ]}\n onChange={onChangeLimit}\n placeholder=\"6\"\n nullable={false}\n />\n </div>\n <div className=\"space-x-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={!offset}\n onClick={onPrevious}\n >\n {tPrevious}\n </Button>\n <span className=\"text-sm\">{`${tPage} ${currentPage} ${tOf} ${totalPages}`}</span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled={isLastPage}\n onClick={onNext}\n >\n {tNext}\n </Button>\n </div>\n </div>\n );\n};\n"],"names":["TablePagination","offset","limit","totalRows","setLimit","setOffset","tRowsPerPage","tPrevious","tPage","tNext","tOf","currentPage","totalPages","isLastPage","onChangeLimit","value","onPrevious","nextOffset","onNext","jsxs","jsx","Select","Button"],"mappings":";;;;;;;AAmBO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC,IAAc;AAAA,EACd,WAAAC,IAAW;AAAA,EACX,OAAAC,IAAO;AAAA,EACP,OAAAC,IAAO;AAAA,EACP,KAAAC,IAAK;AACP,MAAM;AACJ,QAAMC,IAAc,KAAK,KAAKV,IAASC,CAAK,IAAI,GAC1CU,IAAa,KAAK,KAAKT,IAAYD,CAAK,GACxCW,IAAaF,MAAgBC,GAE7BE,IAAgB,CAACC,MAAkB;AACvC,IAAAV,EAAU,CAAC,GACXD,EAAS,SAASW,CAAK,CAAC;AAAA,EAC1B,GAEMC,IAAa,MAAM;AACvB,QAAIC,IAAahB,IAASC;AAC1B,IAAIe,IAAa,MACfA,IAAa,IAEfZ,EAAUY,CAAU;AAAA,EACtB,GAEMC,IAAS,MAAM;AACnB,QAAID,IAAahB,IAASC;AAC1B,IAAIe,IAAad,MACfc,IAAad,IAAYD,IAE3BG,EAAUY,CAAU;AAAA,EACtB;AAEA,SACE,gBAAAE,EAAC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