@apipass/design-system 4.3.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/lib/embedded-styles.d.ts +4 -0
  2. package/dist/lib/embedded-styles.js +3 -1
  3. package/dist/lib/style.css +1 -1
  4. package/dist/lib/ui/components/Breadcrumb/Breadcrumb.cjs +1 -1
  5. package/dist/lib/ui/components/Breadcrumb/Breadcrumb.cjs.map +1 -1
  6. package/dist/lib/ui/components/Breadcrumb/Breadcrumb.js +1 -1
  7. package/dist/lib/ui/components/Breadcrumb/Breadcrumb.js.map +1 -1
  8. package/dist/lib/ui/components/PageHeader/PageHeader.cjs +1 -1
  9. package/dist/lib/ui/components/PageHeader/PageHeader.cjs.map +1 -1
  10. package/dist/lib/ui/components/PageHeader/PageHeader.js +32 -31
  11. package/dist/lib/ui/components/PageHeader/PageHeader.js.map +1 -1
  12. package/dist/lib/ui/components/WidgetGrid/WidgetGrid.cjs +1 -1
  13. package/dist/lib/ui/components/WidgetGrid/WidgetGrid.cjs.map +1 -1
  14. package/dist/lib/ui/components/WidgetGrid/WidgetGrid.js +25 -25
  15. package/dist/lib/ui/components/WidgetGrid/WidgetGrid.js.map +1 -1
  16. package/dist/lib/ui/primitives/Accordion/Accordion.cjs +1 -1
  17. package/dist/lib/ui/primitives/Accordion/Accordion.cjs.map +1 -1
  18. package/dist/lib/ui/primitives/Accordion/Accordion.js +5 -5
  19. package/dist/lib/ui/primitives/Accordion/Accordion.js.map +1 -1
  20. package/dist/lib/ui/primitives/Alert/Alert.cjs +1 -1
  21. package/dist/lib/ui/primitives/Alert/Alert.cjs.map +1 -1
  22. package/dist/lib/ui/primitives/Alert/Alert.js +1 -1
  23. package/dist/lib/ui/primitives/Alert/Alert.js.map +1 -1
  24. package/dist/lib/ui/primitives/Checkbox/Checkbox.cjs +1 -1
  25. package/dist/lib/ui/primitives/Checkbox/Checkbox.cjs.map +1 -1
  26. package/dist/lib/ui/primitives/Checkbox/Checkbox.js +9 -9
  27. package/dist/lib/ui/primitives/Checkbox/Checkbox.js.map +1 -1
  28. package/dist/lib/ui/primitives/Fieldset/Fieldset.cjs +1 -1
  29. package/dist/lib/ui/primitives/Fieldset/Fieldset.cjs.map +1 -1
  30. package/dist/lib/ui/primitives/Fieldset/Fieldset.js +1 -1
  31. package/dist/lib/ui/primitives/Fieldset/Fieldset.js.map +1 -1
  32. package/dist/lib/ui/primitives/Pagination/Pagination.cjs +1 -1
  33. package/dist/lib/ui/primitives/Pagination/Pagination.cjs.map +1 -1
  34. package/dist/lib/ui/primitives/Pagination/Pagination.js +6 -6
  35. package/dist/lib/ui/primitives/Pagination/Pagination.js.map +1 -1
  36. package/dist/lib/ui/primitives/Radio/Radio.cjs +1 -1
  37. package/dist/lib/ui/primitives/Radio/Radio.cjs.map +1 -1
  38. package/dist/lib/ui/primitives/Radio/Radio.js +8 -8
  39. package/dist/lib/ui/primitives/Radio/Radio.js.map +1 -1
  40. package/dist/lib/ui/primitives/Switch/Switch.cjs +1 -1
  41. package/dist/lib/ui/primitives/Switch/Switch.cjs.map +1 -1
  42. package/dist/lib/ui/primitives/Switch/Switch.js +1 -1
  43. package/dist/lib/ui/primitives/Switch/Switch.js.map +1 -1
  44. package/dist/lib/ui/primitives/Table/Table.cjs +1 -1
  45. package/dist/lib/ui/primitives/Table/Table.cjs.map +1 -1
  46. package/dist/lib/ui/primitives/Table/Table.js +2 -2
  47. package/dist/lib/ui/primitives/Table/Table.js.map +1 -1
  48. package/dist/lib/ui/primitives/Text/Text.cjs +1 -1
  49. package/dist/lib/ui/primitives/Text/Text.cjs.map +1 -1
  50. package/dist/lib/ui/primitives/Text/Text.js +16 -16
  51. package/dist/lib/ui/primitives/Text/Text.js.map +1 -1
  52. package/dist/lib/ui/primitives/Tooltip/Tooltip.cjs +1 -1
  53. package/dist/lib/ui/primitives/Tooltip/Tooltip.cjs.map +1 -1
  54. package/dist/lib/ui/primitives/Tooltip/Tooltip.js +9 -9
  55. package/dist/lib/ui/primitives/Tooltip/Tooltip.js.map +1 -1
  56. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.cjs","sources":["../../../../../src/ui/primitives/Fieldset/Fieldset.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { ComponentPropsWithoutRef } from \"react\";\nimport {\n FieldError as RACFieldError,\n Form as RACForm,\n Keyboard as RACKeyboard,\n Label as RACLabel,\n Text as RACText,\n type FieldErrorProps as RACFieldErrorProps,\n type FormProps as RACFormProps,\n type LabelProps as RACLabelProps,\n type TextProps as RACTextProps,\n type ValidationResult as RACValidationResult,\n} from \"react-aria-components\";\nimport \"./fieldset.css\";\n\nexport type FieldsetProps = ComponentPropsWithoutRef<\"fieldset\">;\nexport function Fieldset({ ...props }: FieldsetProps) {\n const classNames = clsx(\"fieldset\");\n return <fieldset {...props} className={classNames} />;\n}\n\nexport type LegendProps = ComponentPropsWithoutRef<\"legend\">;\nexport function Legend({ ...props }: LegendProps) {\n const classNames = clsx(\"legend\");\n return <legend {...props} className={classNames} />;\n}\n\nexport type FieldGroupProps = ComponentPropsWithoutRef<\"div\">;\nexport function FieldGroup({ ...props }: FieldGroupProps) {\n const classNames = clsx(\"field-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type FormProps = RACFormProps & { singleLine?: boolean };\nexport function Form({ className, singleLine, ...props }: FormProps) {\n const classNames = clsx(className, \"form\", singleLine && \"form-single-line\");\n return <RACForm className={classNames} {...props} />;\n}\n\nexport type FormDataValue = FormDataEntryValue | FormDataEntryValue[];\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function formEventTargetToFormData(target: HTMLFormElement) {\n const dataIsArray = (data: FormDataValue): data is FormDataEntryValue[] =>\n Array.isArray(data);\n\n const formData = new FormData(target);\n const data: {\n [k: string]: FormDataValue;\n } = {};\n\n formData.forEach((value, key) => {\n if (!Reflect.has(data, key)) {\n data[key] = value;\n return;\n }\n // convert to array from single value\n const currentItem = data[key];\n if (dataIsArray(currentItem)) {\n currentItem.push(value);\n } else {\n data[key] = [currentItem, value];\n }\n });\n return data;\n}\n\n/**\n * Used by TextField, SelectField, TextareaField, SliderField, etc.\n */\nexport type SharedFieldProps = {\n label?: string;\n description?: string;\n placeholder?: string;\n errorMessage?: string | ((validation: RACValidationResult) => string);\n};\n\nexport type FieldProps = ComponentPropsWithoutRef<\"div\">;\nexport function Field({ className, ...props }: FieldProps) {\n const classNames = clsx(className, \"field\");\n return <div className={classNames} {...props} />;\n}\nexport type LabelProps = RACLabelProps;\nexport function Label({ className, ...props }: LabelProps) {\n const classNames = clsx(className, \"label\");\n return <RACLabel className={classNames} slot=\"label\" {...props} />;\n}\nexport type DescriptionProps = RACTextProps;\nexport function Description({ className, ...props }: DescriptionProps) {\n const classNames = clsx(className, \"description\");\n return <RACText className={classNames} slot=\"description\" {...props} />;\n}\nexport type FieldErrorProps = RACFieldErrorProps;\nexport function FieldError({ className, ...props }: FieldErrorProps) {\n const classNames = clsx(className, \"error-message\");\n return <RACFieldError {...props} className={classNames} />;\n}\nexport type KeyboardProps = RACTextProps;\nexport function Keyboard({ className, children, ...props }: KeyboardProps) {\n const classNames = clsx(className, \"keyboard\");\n const items =\n typeof children === \"string\"\n ? children.split(\"\").map((k) => <kbd key={k}>{k}</kbd>)\n : children;\n return (\n <RACKeyboard {...props} className={classNames}>\n {items}\n </RACKeyboard>\n );\n}\n"],"names":["Fieldset","props","classNames","clsx","jsx","Legend","FieldGroup","Form","className","singleLine","RACForm","formEventTargetToFormData","target","dataIsArray","data","formData","value","key","currentItem","Field","Label","RACLabel","Description","RACText","FieldError","RACFieldError","Keyboard","children","items","k","RACKeyboard"],"mappings":"sOAiBO,SAASA,EAAS,CAAE,GAAGC,GAAwB,CACpD,MAAMC,EAAaC,EAAAA,KAAK,UAAU,EAClC,OAAOC,EAAAA,IAAC,WAAA,CAAU,GAAGH,EAAO,UAAWC,EAAY,CACrD,CA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UAAWnB,EAAY,KAAK,QAAS,GAAGD,EAAO,CAClE,CAEO,SAASqB,EAAY,CAAE,UAAAd,EAAW,GAAGP,GAA2B,CACrE,MAAMC,EAAaC,EAAAA,KAAKK,EAAW,aAAa,EAChD,aAAQe,EAAAA,KAAA,CAAQ,UAAWrB,EAAY,KAAK,cAAe,GAAGD,EAAO,CACvE,CAEO,SAASuB,EAAW,CAAE,UAAAhB,EAAW,GAAGP,GAA0B,CACnE,MAAMC,EAAaC,EAAAA,KAAKK,EAAW,eAAe,EAClD,OAAOJ,EAAAA,IAACqB,EAAAA,WAAA,CAAe,GAAGxB,EAAO,UAAWC,EAAY,CAC1D,CAEO,SAASwB,EAAS,CAAE,UAAAlB,EAAW,SAAAmB,EAAU,GAAG1B,GAAwB,CACzE,MAAMC,EAAaC,EAAAA,KAAKK,EAAW,UAAU,EACvCoB,EACJ,OAAOD,GAAa,SAChBA,EAAS,MAAM,EAAE,EAAE,IAAKE,GAAMzB,EAAAA,IAAC,MAAA,CAAa,SAAAyB,GAAJA,CAAM,CAAM,EACpDF,EACN,aACGG,EAAAA,SAAA,CAAa,GAAG7B,EAAO,UAAWC,EAChC,SAAA0B,EACH,CAEJ"}
1
+ {"version":3,"file":"Fieldset.cjs","sources":["../../../../../src/ui/primitives/Fieldset/Fieldset.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { ComponentPropsWithoutRef } from \"react\";\nimport {\n FieldError as RACFieldError,\n Form as RACForm,\n Keyboard as RACKeyboard,\n Label as RACLabel,\n Text as RACText,\n type FieldErrorProps as RACFieldErrorProps,\n type FormProps as RACFormProps,\n type LabelProps as RACLabelProps,\n type TextProps as RACTextProps,\n type ValidationResult as RACValidationResult,\n} from \"react-aria-components\";\nimport \"./fieldset.css\";\n\nexport type FieldsetProps = ComponentPropsWithoutRef<\"fieldset\">;\nexport function Fieldset({ ...props }: FieldsetProps) {\n const classNames = clsx(\"fieldset\");\n return <fieldset {...props} className={classNames} />;\n}\n\nexport type LegendProps = ComponentPropsWithoutRef<\"legend\">;\nexport function Legend({ ...props }: LegendProps) {\n const classNames = clsx(\"legend\");\n return <legend {...props} className={classNames} />;\n}\n\nexport type FieldGroupProps = ComponentPropsWithoutRef<\"div\">;\nexport function FieldGroup({ ...props }: FieldGroupProps) {\n const classNames = clsx(\"field-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type FormProps = RACFormProps & { singleLine?: boolean };\nexport function Form({ className, singleLine, ...props }: FormProps) {\n const classNames = clsx(className, \"form\", singleLine && \"form-single-line\");\n return <RACForm className={classNames} {...props} />;\n}\n\nexport type FormDataValue = FormDataEntryValue | FormDataEntryValue[];\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function formEventTargetToFormData(target: HTMLFormElement) {\n const dataIsArray = (data: FormDataValue): data is FormDataEntryValue[] =>\n Array.isArray(data);\n\n const formData = new FormData(target);\n const data: {\n [k: string]: FormDataValue;\n } = {};\n\n formData.forEach((value, key) => {\n if (!Reflect.has(data, key)) {\n data[key] = value;\n return;\n }\n // convert to array from single value\n const currentItem = data[key];\n if (dataIsArray(currentItem)) {\n currentItem.push(value);\n } else {\n data[key] = [currentItem, value];\n }\n });\n return data;\n}\n\n/**\n * Used by TextField, SelectField, TextareaField, SliderField, etc.\n */\nexport type SharedFieldProps = {\n label?: string;\n description?: string;\n placeholder?: string;\n errorMessage?: string | ((validation: RACValidationResult) => string);\n};\n\nexport type FieldProps = ComponentPropsWithoutRef<\"div\">;\nexport function Field({ className, ...props }: FieldProps) {\n const classNames = clsx(className, \"field\");\n return <div className={classNames} {...props} />;\n}\nexport type LabelProps = RACLabelProps;\nexport function Label({ className, ...props }: LabelProps) {\n const classNames = clsx(className, \"sds-label\");\n return <RACLabel className={classNames} slot=\"label\" {...props} />;\n}\nexport type DescriptionProps = RACTextProps;\nexport function Description({ className, ...props }: DescriptionProps) {\n const classNames = clsx(className, \"description\");\n return <RACText className={classNames} slot=\"description\" {...props} />;\n}\nexport type FieldErrorProps = RACFieldErrorProps;\nexport function FieldError({ className, ...props }: FieldErrorProps) {\n const classNames = clsx(className, \"error-message\");\n return <RACFieldError {...props} className={classNames} />;\n}\nexport type KeyboardProps = RACTextProps;\nexport function Keyboard({ className, children, ...props }: KeyboardProps) {\n const classNames = clsx(className, \"keyboard\");\n const items =\n typeof children === \"string\"\n ? children.split(\"\").map((k) => <kbd key={k}>{k}</kbd>)\n : children;\n return (\n <RACKeyboard {...props} className={classNames}>\n {items}\n </RACKeyboard>\n );\n}\n"],"names":["Fieldset","props","classNames","clsx","jsx","Legend","FieldGroup","Form","className","singleLine","RACForm","formEventTargetToFormData","target","dataIsArray","data","formData","value","key","currentItem","Field","Label","RACLabel","Description","RACText","FieldError","RACFieldError","Keyboard","children","items","k","RACKeyboard"],"mappings":"sOAiBO,SAASA,EAAS,CAAE,GAAGC,GAAwB,CACpD,MAAMC,EAAaC,EAAAA,KAAK,UAAU,EAClC,OAAOC,EAAAA,IAAC,WAAA,CAAU,GAAGH,EAAO,UAAWC,EAAY,CACrD,CAGO,SAASG,EAAO,CAAE,GAAGJ,GAAsB,CAChD,MAAMC,EAAaC,EAAAA,KAAK,QAAQ,EAChC,OAAOC,EAAAA,IAAC,SAAA,CAAQ,GAAGH,EAAO,UAAWC,EAAY,CACnD,CAGO,SAASI,EAAW,CAAE,GAAGL,GAA0B,CACxD,MAAMC,EAAaC,EAAAA,KAAK,aAAa,EACrC,OAAOC,EAAAA,IAAC,MAAA,CAAK,GAAGH,EAAO,UAAWC,EAAY,CAChD,CAGO,SAASK,EAAK,CAAE,UAAAC,EAAW,WAAAC,EAAY,GAAGR,GAAoB,CACnE,MAAMC,EAAaC,EAAAA,KAAKK,EAAW,OAAQC,GAAc,kBAAkB,EAC3E,OAAOL,EAAAA,IAACM,EAAAA,KAAA,CAAQ,UAAWR,EAAa,GAAGD,EAAO,CACpD,CAIO,SAASU,EAA0BC,EAAyB,CACjE,MAAMC,EAAeC,GACnB,MAAM,QAAQA,CAAI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AAE,IAAKE,GAAMzB,EAAAA,IAAC,MAAA,CAAa,SAAAyB,GAAJA,CAAM,CAAM,EACpDF,EACN,aACGG,EAAAA,SAAA,CAAa,GAAG7B,EAAO,UAAWC,EAChC,SAAA0B,EACH,CAEJ"}
@@ -34,7 +34,7 @@ function L({ className: e, ...s }) {
34
34
  return /* @__PURE__ */ a("div", { className: r, ...s });
35
35
  }
36
36
  function $({ className: e, ...s }) {
37
- const r = o(e, "label");
37
+ const r = o(e, "sds-label");
38
38
  return /* @__PURE__ */ a(m, { className: r, slot: "label", ...s });
39
39
  }
40
40
  function h({ className: e, ...s }) {
@@ -1 +1 @@
1
- {"version":3,"file":"Fieldset.js","sources":["../../../../../src/ui/primitives/Fieldset/Fieldset.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { ComponentPropsWithoutRef } from \"react\";\nimport {\n FieldError as RACFieldError,\n Form as RACForm,\n Keyboard as RACKeyboard,\n Label as RACLabel,\n Text as RACText,\n type FieldErrorProps as RACFieldErrorProps,\n type FormProps as RACFormProps,\n type LabelProps as RACLabelProps,\n type TextProps as RACTextProps,\n type ValidationResult as RACValidationResult,\n} from \"react-aria-components\";\nimport \"./fieldset.css\";\n\nexport type FieldsetProps = ComponentPropsWithoutRef<\"fieldset\">;\nexport function Fieldset({ ...props }: FieldsetProps) {\n const classNames = clsx(\"fieldset\");\n return <fieldset {...props} className={classNames} />;\n}\n\nexport type LegendProps = ComponentPropsWithoutRef<\"legend\">;\nexport function Legend({ ...props }: LegendProps) {\n const classNames = clsx(\"legend\");\n return <legend {...props} className={classNames} />;\n}\n\nexport type FieldGroupProps = ComponentPropsWithoutRef<\"div\">;\nexport function FieldGroup({ ...props }: FieldGroupProps) {\n const classNames = clsx(\"field-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type FormProps = RACFormProps & { singleLine?: boolean };\nexport function Form({ className, singleLine, ...props }: FormProps) {\n const classNames = clsx(className, \"form\", singleLine && \"form-single-line\");\n return <RACForm className={classNames} {...props} />;\n}\n\nexport type FormDataValue = FormDataEntryValue | FormDataEntryValue[];\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function formEventTargetToFormData(target: HTMLFormElement) {\n const dataIsArray = (data: FormDataValue): data is FormDataEntryValue[] =>\n Array.isArray(data);\n\n const formData = new FormData(target);\n const data: {\n [k: string]: FormDataValue;\n } = {};\n\n formData.forEach((value, key) => {\n if (!Reflect.has(data, key)) {\n data[key] = value;\n return;\n }\n // convert to array from single value\n const currentItem = data[key];\n if (dataIsArray(currentItem)) {\n currentItem.push(value);\n } else {\n data[key] = [currentItem, value];\n }\n });\n return data;\n}\n\n/**\n * Used by TextField, SelectField, TextareaField, SliderField, etc.\n */\nexport type SharedFieldProps = {\n label?: string;\n description?: string;\n placeholder?: string;\n errorMessage?: string | ((validation: RACValidationResult) => string);\n};\n\nexport type FieldProps = ComponentPropsWithoutRef<\"div\">;\nexport function Field({ className, ...props }: FieldProps) {\n const classNames = clsx(className, \"field\");\n return <div className={classNames} {...props} />;\n}\nexport type LabelProps = RACLabelProps;\nexport function Label({ className, ...props }: LabelProps) {\n const classNames = clsx(className, \"label\");\n return <RACLabel className={classNames} slot=\"label\" {...props} />;\n}\nexport type DescriptionProps = RACTextProps;\nexport function Description({ className, ...props }: DescriptionProps) {\n const classNames = clsx(className, \"description\");\n return <RACText className={classNames} slot=\"description\" {...props} />;\n}\nexport type FieldErrorProps = RACFieldErrorProps;\nexport function FieldError({ className, ...props }: FieldErrorProps) {\n const classNames = clsx(className, \"error-message\");\n return <RACFieldError {...props} className={classNames} />;\n}\nexport type KeyboardProps = RACTextProps;\nexport function Keyboard({ className, children, ...props }: KeyboardProps) {\n const classNames = clsx(className, \"keyboard\");\n const items =\n typeof children === \"string\"\n ? children.split(\"\").map((k) => <kbd key={k}>{k}</kbd>)\n : children;\n return (\n <RACKeyboard {...props} className={classNames}>\n {items}\n </RACKeyboard>\n );\n}\n"],"names":["Fieldset","props","classNames","clsx","jsx","Legend","FieldGroup","Form","className","singleLine","RACForm","formEventTargetToFormData","target","dataIsArray","data","formData","value","key","currentItem","Field","Label","RACLabel","Description","RACText","FieldError","RACFieldError","Keyboard","children","items","k","RACKeyboard"],"mappings":";;;;AAiBO,SAASA,EAAS,EAAE,GAAGC,KAAwB;AACpD,QAAMC,IAAaC,EAAK,UAAU;AAClC,SAAO,gBAAAC,EAAC,YAAA,EAAU,GAAGH,GAAO,WAAWC,GAAY;AACrD;AAGO,SAASG,EAAO,EAAE,GAAGJ,KAAsB;AAChD,QAAMC,IAAaC,EAAK,QAAQ;AAChC,SAAO,gBAAAC,EAAC,UAAA,EAAQ,GAAGH,GAAO,WAAWC,GAAY;AACnD;AAGO,SAASI,EAAW,EAAE,GAAGL,KAA0B;AACxD,QAAMC,IAAaC,EAAK,aAAa;AACrC,SAAO,gBAAAC,EAAC,OAAA,EAAK,GAAGH,GAAO,WAAWC,GAAY;AAChD;AAGO,SAASK,EAAK,EAAE,WAAAC,GAAW,YAAAC,GAAY,GAAGR,KAAoB;AACnE,QAAMC,IAAaC,EAAKK,GAAW,QAAQC,KAAc,kBAAkB;AAC3E,SAAO,gBAAAL,EAACM,GAAA,EAAQ,WAAWR,GAAa,GAAGD,GAAO;AACpD;AAIO,SAASU,EAA0BC,GAAyB;AACjE,QAAMC,IAAc,CAACC,MACnB,MAAM,QAAQA,CAAI,GAEdC,IAAW,IAAI,SAASH,CAAM,GAC9BE,IAEF,CAAA;AAEJ,SAAAC,EAAS,QAAQ,CAACC,GAAOC,MAAQ;AAC/B,QAAI,CAAC,QAAQ,IAAIH,GAAMG,CAAG,GAAG;AAC3B,MAAAH,EAAKG,CAAG,IAAID;AACZ;AAAA,IACF;AAEA,UAAME,IAAcJ,EAAKG,CAAG;AAC5B,IAAIJ,EAAYK,CAAW,IACzBA,EAAY,KAAKF,CAAK,IAEtBF,EAAKG,CAAG,IAAI,CAACC,GAAaF,CAAK;AAAA,EAEnC,CAAC,GACMF;AACT;AAaO,SAASK,EAAM,EAAE,WAAAX,GAAW,GAAGP,KAAqB;AACzD,QAAMC,IAAaC,EAAKK,GAAW,OAAO;AAC1C,SAAO,gBAAAJ,EAAC,OAAA,EAAI,WAAWF,GAAa,GAAGD,GAAO;AAChD;AAEO,SAASmB,EAAM,EAAE,WAAAZ,GAAW,GAAGP,KAAqB;AACzD,QAAMC,IAAaC,EAAKK,GAAW,OAAO;AAC1C,2BAAQa,GAAA,EAAS,WAAWnB,GAAY,MAAK,SAAS,GAAGD,GAAO;AAClE;AAEO,SAASqB,EAAY,EAAE,WAAAd,GAAW,GAAGP,KAA2B;AACrE,QAAMC,IAAaC,EAAKK,GAAW,aAAa;AAChD,2BAAQe,GAAA,EAAQ,WAAWrB,GAAY,MAAK,eAAe,GAAGD,GAAO;AACvE;AAEO,SAASuB,EAAW,EAAE,WAAAhB,GAAW,GAAGP,KAA0B;AACnE,QAAMC,IAAaC,EAAKK,GAAW,eAAe;AAClD,SAAO,gBAAAJ,EAACqB,GAAA,EAAe,GAAGxB,GAAO,WAAWC,GAAY;AAC1D;AAEO,SAASwB,EAAS,EAAE,WAAAlB,GAAW,UAAAmB,GAAU,GAAG1B,KAAwB;AACzE,QAAMC,IAAaC,EAAKK,GAAW,UAAU,GACvCoB,IACJ,OAAOD,KAAa,WAChBA,EAAS,MAAM,EAAE,EAAE,IAAI,CAACE,MAAM,gBAAAzB,EAAC,OAAA,EAAa,UAAAyB,KAAJA,CAAM,CAAM,IACpDF;AACN,2BACGG,GAAA,EAAa,GAAG7B,GAAO,WAAWC,GAChC,UAAA0B,GACH;AAEJ;"}
1
+ {"version":3,"file":"Fieldset.js","sources":["../../../../../src/ui/primitives/Fieldset/Fieldset.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { ComponentPropsWithoutRef } from \"react\";\nimport {\n FieldError as RACFieldError,\n Form as RACForm,\n Keyboard as RACKeyboard,\n Label as RACLabel,\n Text as RACText,\n type FieldErrorProps as RACFieldErrorProps,\n type FormProps as RACFormProps,\n type LabelProps as RACLabelProps,\n type TextProps as RACTextProps,\n type ValidationResult as RACValidationResult,\n} from \"react-aria-components\";\nimport \"./fieldset.css\";\n\nexport type FieldsetProps = ComponentPropsWithoutRef<\"fieldset\">;\nexport function Fieldset({ ...props }: FieldsetProps) {\n const classNames = clsx(\"fieldset\");\n return <fieldset {...props} className={classNames} />;\n}\n\nexport type LegendProps = ComponentPropsWithoutRef<\"legend\">;\nexport function Legend({ ...props }: LegendProps) {\n const classNames = clsx(\"legend\");\n return <legend {...props} className={classNames} />;\n}\n\nexport type FieldGroupProps = ComponentPropsWithoutRef<\"div\">;\nexport function FieldGroup({ ...props }: FieldGroupProps) {\n const classNames = clsx(\"field-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type FormProps = RACFormProps & { singleLine?: boolean };\nexport function Form({ className, singleLine, ...props }: FormProps) {\n const classNames = clsx(className, \"form\", singleLine && \"form-single-line\");\n return <RACForm className={classNames} {...props} />;\n}\n\nexport type FormDataValue = FormDataEntryValue | FormDataEntryValue[];\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function formEventTargetToFormData(target: HTMLFormElement) {\n const dataIsArray = (data: FormDataValue): data is FormDataEntryValue[] =>\n Array.isArray(data);\n\n const formData = new FormData(target);\n const data: {\n [k: string]: FormDataValue;\n } = {};\n\n formData.forEach((value, key) => {\n if (!Reflect.has(data, key)) {\n data[key] = value;\n return;\n }\n // convert to array from single value\n const currentItem = data[key];\n if (dataIsArray(currentItem)) {\n currentItem.push(value);\n } else {\n data[key] = [currentItem, value];\n }\n });\n return data;\n}\n\n/**\n * Used by TextField, SelectField, TextareaField, SliderField, etc.\n */\nexport type SharedFieldProps = {\n label?: string;\n description?: string;\n placeholder?: string;\n errorMessage?: string | ((validation: RACValidationResult) => string);\n};\n\nexport type FieldProps = ComponentPropsWithoutRef<\"div\">;\nexport function Field({ className, ...props }: FieldProps) {\n const classNames = clsx(className, \"field\");\n return <div className={classNames} {...props} />;\n}\nexport type LabelProps = RACLabelProps;\nexport function Label({ className, ...props }: LabelProps) {\n const classNames = clsx(className, \"sds-label\");\n return <RACLabel className={classNames} slot=\"label\" {...props} />;\n}\nexport type DescriptionProps = RACTextProps;\nexport function Description({ className, ...props }: DescriptionProps) {\n const classNames = clsx(className, \"description\");\n return <RACText className={classNames} slot=\"description\" {...props} />;\n}\nexport type FieldErrorProps = RACFieldErrorProps;\nexport function FieldError({ className, ...props }: FieldErrorProps) {\n const classNames = clsx(className, \"error-message\");\n return <RACFieldError {...props} className={classNames} />;\n}\nexport type KeyboardProps = RACTextProps;\nexport function Keyboard({ className, children, ...props }: KeyboardProps) {\n const classNames = clsx(className, \"keyboard\");\n const items =\n typeof children === \"string\"\n ? children.split(\"\").map((k) => <kbd key={k}>{k}</kbd>)\n : children;\n return (\n <RACKeyboard {...props} className={classNames}>\n {items}\n </RACKeyboard>\n );\n}\n"],"names":["Fieldset","props","classNames","clsx","jsx","Legend","FieldGroup","Form","className","singleLine","RACForm","formEventTargetToFormData","target","dataIsArray","data","formData","value","key","currentItem","Field","Label","RACLabel","Description","RACText","FieldError","RACFieldError","Keyboard","children","items","k","RACKeyboard"],"mappings":";;;;AAiBO,SAASA,EAAS,EAAE,GAAGC,KAAwB;AACpD,QAAMC,IAAaC,EAAK,UAAU;AAClC,SAAO,gBAAAC,EAAC,YAAA,EAAU,GAAGH,GAAO,WAAWC,GAAY;AACrD;AAGO,SAASG,EAAO,EAAE,GAAGJ,KAAsB;AAChD,QAAMC,IAAaC,EAAK,QAAQ;AAChC,SAAO,gBAAAC,EAAC,UAAA,EAAQ,GAAGH,GAAO,WAAWC,GAAY;AACnD;AAGO,SAASI,EAAW,EAAE,GAAGL,KAA0B;AACxD,QAAMC,IAAaC,EAAK,aAAa;AACrC,SAAO,gBAAAC,EAAC,OAAA,EAAK,GAAGH,GAAO,WAAWC,GAAY;AAChD;AAGO,SAASK,EAAK,EAAE,WAAAC,GAAW,YAAAC,GAAY,GAAGR,K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AWC,GAAY;AAC1D;AAEO,SAASwB,EAAS,EAAE,WAAAlB,GAAW,UAAAmB,GAAU,GAAG1B,KAAwB;AACzE,QAAMC,IAAaC,EAAKK,GAAW,UAAU,GACvCoB,IACJ,OAAOD,KAAa,WAChBA,EAAS,MAAM,EAAE,EAAE,IAAI,CAACE,MAAM,gBAAAzB,EAAC,OAAA,EAAa,UAAAyB,KAAJA,CAAM,CAAM,IACpDF;AACN,2BACGG,GAAA,EAAa,GAAG7B,GAAO,WAAWC,GAChC,UAAA0B,GACH;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("../../../vendor/clsx/dist/clsx.cjs");;/* empty css */const h=require("../../icons/IconArrowLeft.cjs"),N=require("../../icons/IconArrowRight.cjs"),A=require("../../hooks/useMediaQuery.cjs"),c=require("../../utils/AnchorOrButton.cjs");function q(a){return"totalPages"in a}function L(a){if(q(a)){const{page:t,totalPages:r,onPageChange:u,previousLabel:m,nextLabel:p,className:f}=a;return r<=1?null:i.jsxs("nav",{"aria-label":"Page navigation",className:l.clsx(f,"pagination"),children:[i.jsx(g,{isDisabled:t<=1,onPress:()=>u(Math.max(1,t-1)),children:m}),i.jsx(x,{children:j(t,r).map((o,v)=>o==="..."?i.jsx(b,{},`gap-${v}`):i.jsx(d,{current:o===t,onPress:()=>u(o),children:String(o)},o))}),i.jsx(P,{isDisabled:t>=r,onPress:()=>u(Math.min(r,t+1)),children:p})]})}const{"aria-label":n="Page navigation",className:e,...s}=a;return i.jsx("nav",{"aria-label":n,...s,className:l.clsx(e,"pagination")})}function g({href:a=null,onPress:n,isDisabled:e=!1,children:s="Previous"}){return i.jsxs(c.AnchorOrButton,{...a!==null?{href:a}:{},onPress:n,isDisabled:e||a===null&&!n,className:l.clsx("pagination-btn","pagination-nav"),"aria-label":"Previous page",children:[i.jsx(h.IconArrowLeft,{size:"16"}),s]})}function P({href:a=null,onPress:n,isDisabled:e=!1,children:s="Next"}){return i.jsxs(c.AnchorOrButton,{...a!==null?{href:a}:{},onPress:n,isDisabled:e||a===null&&!n,className:l.clsx("pagination-btn","pagination-nav"),"aria-label":"Next page",children:[s,i.jsx(N.IconArrowRight,{size:"16"})]})}function x({children:a}){const{isTabletUp:n}=A.useMediaQuery();return n&&i.jsx("span",{className:"pagination-list",children:a})}function d({href:a,onPress:n,children:e,current:s=!1}){return i.jsx(c.AnchorOrButton,{...a?{href:a}:{},onPress:n,"aria-label":`Page ${e}`,"aria-current":s?"page":void 0,className:l.clsx("pagination-btn",s&&"pagination-btn-active"),children:e})}function b(){return i.jsx("div",{"aria-hidden":"true",className:"pagination-gap",children:"…"})}function j(a,n){if(n<=6)return Array.from({length:n},(t,r)=>r+1);const e=[1,2,3],s=[n-1,n];return a<=4?[...e,"...",...s]:a>=n-3?[1,2,"...",n-2,n-1,n]:[1,"...",a-1,a,a+1,"...",n]}exports.Pagination=L;exports.PaginationGap=b;exports.PaginationList=x;exports.PaginationNext=P;exports.PaginationPage=d;exports.PaginationPrevious=g;exports.buildPaginationPages=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("../../../vendor/clsx/dist/clsx.cjs");;/* empty css */const h=require("../../icons/IconArrowLeft.cjs"),N=require("../../icons/IconArrowRight.cjs"),A=require("../../hooks/useMediaQuery.cjs"),c=require("../../utils/AnchorOrButton.cjs");function q(a){return"totalPages"in a}function L(a){if(q(a)){const{page:t,totalPages:r,onPageChange:u,previousLabel:m,nextLabel:p,className:f}=a;return r<=1?null:i.jsxs("nav",{"aria-label":"Page navigation",className:l.clsx(f,"sds-pagination"),children:[i.jsx(g,{isDisabled:t<=1,onPress:()=>u(Math.max(1,t-1)),children:m}),i.jsx(x,{children:j(t,r).map((o,v)=>o==="..."?i.jsx(b,{},`gap-${v}`):i.jsx(d,{current:o===t,onPress:()=>u(o),children:String(o)},o))}),i.jsx(P,{isDisabled:t>=r,onPress:()=>u(Math.min(r,t+1)),children:p})]})}const{"aria-label":n="Page navigation",className:e,...s}=a;return i.jsx("nav",{"aria-label":n,...s,className:l.clsx(e,"sds-pagination")})}function g({href:a=null,onPress:n,isDisabled:e=!1,children:s="Previous"}){return i.jsxs(c.AnchorOrButton,{...a!==null?{href:a}:{},onPress:n,isDisabled:e||a===null&&!n,className:l.clsx("pagination-btn","pagination-nav"),"aria-label":"Previous page",children:[i.jsx(h.IconArrowLeft,{size:"16"}),s]})}function P({href:a=null,onPress:n,isDisabled:e=!1,children:s="Next"}){return i.jsxs(c.AnchorOrButton,{...a!==null?{href:a}:{},onPress:n,isDisabled:e||a===null&&!n,className:l.clsx("pagination-btn","pagination-nav"),"aria-label":"Next page",children:[s,i.jsx(N.IconArrowRight,{size:"16"})]})}function x({children:a}){const{isTabletUp:n}=A.useMediaQuery();return n&&i.jsx("span",{className:"pagination-list",children:a})}function d({href:a,onPress:n,children:e,current:s=!1}){return i.jsx(c.AnchorOrButton,{...a?{href:a}:{},onPress:n,"aria-label":`Page ${e}`,"aria-current":s?"page":void 0,className:l.clsx("pagination-btn",s&&"pagination-btn-active"),children:e})}function b(){return i.jsx("div",{"aria-hidden":"true",className:"pagination-gap",children:"…"})}function j(a,n){if(n<=6)return Array.from({length:n},(t,r)=>r+1);const e=[1,2,3],s=[n-1,n];return a<=4?[...e,"...",...s]:a>=n-3?[1,2,"...",n-2,n-1,n]:[1,"...",a-1,a,a+1,"...",n]}exports.Pagination=L;exports.PaginationGap=b;exports.PaginationList=x;exports.PaginationNext=P;exports.PaginationPage=d;exports.PaginationPrevious=g;exports.buildPaginationPages=j;
2
2
  //# sourceMappingURL=Pagination.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.cjs","sources":["../../../../../src/ui/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useMediaQuery } from \"hooks\";\nimport { IconArrowLeft, IconArrowRight } from \"icons\";\nimport type React from \"react\";\nimport { AnchorOrButton } from \"utils\";\nimport \"./pagination.css\";\n\nexport type PaginationManualProps = React.ComponentPropsWithoutRef<\"nav\">;\n\nexport type PaginationControlledProps = {\n page: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n previousLabel: string;\n nextLabel: string;\n className?: string;\n};\n\nexport type PaginationProps = PaginationManualProps | PaginationControlledProps;\n\nfunction isControlledProps(\n props: PaginationProps,\n): props is PaginationControlledProps {\n return \"totalPages\" in props;\n}\n\nexport function Pagination(props: PaginationProps) {\n if (isControlledProps(props)) {\n const { page, totalPages, onPageChange, previousLabel, nextLabel, className } = props;\n if (totalPages <= 1) return null;\n return (\n <nav aria-label=\"Page navigation\" className={clsx(className, \"pagination\")}>\n <PaginationPrevious isDisabled={page <= 1} onPress={() => onPageChange(Math.max(1, page - 1))}>\n {previousLabel}\n </PaginationPrevious>\n <PaginationList>\n {buildPaginationPages(page, totalPages).map((p, i) =>\n p === \"...\" ? (\n <PaginationGap key={`gap-${i}`} />\n ) : (\n <PaginationPage key={p} current={p === page} onPress={() => onPageChange(p)}>\n {String(p)}\n </PaginationPage>\n ),\n )}\n </PaginationList>\n <PaginationNext isDisabled={page >= totalPages} onPress={() => onPageChange(Math.min(totalPages, page + 1))}>\n {nextLabel}\n </PaginationNext>\n </nav>\n );\n }\n const { \"aria-label\": ariaLabel = \"Page navigation\", className, ...rest } = props;\n return <nav aria-label={ariaLabel} {...rest} className={clsx(className, \"pagination\")} />;\n}\n\nexport function PaginationPrevious({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Previous\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Previous page\"\n >\n <IconArrowLeft size=\"16\" />\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationNext({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Next\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Next page\"\n >\n {children}\n <IconArrowRight size=\"16\" />\n </AnchorOrButton>\n );\n}\n\nexport function PaginationList({ children }: { children: React.ReactNode }) {\n const { isTabletUp } = useMediaQuery();\n return isTabletUp && <span className=\"pagination-list\">{children}</span>;\n}\n\nexport function PaginationPage({\n href,\n onPress,\n children,\n current = false,\n}: {\n href?: string;\n onPress?: () => void;\n children: string;\n current?: boolean;\n}) {\n return (\n <AnchorOrButton\n {...(href ? { href } : {})}\n onPress={onPress}\n aria-label={`Page ${children}`}\n aria-current={current ? \"page\" : undefined}\n className={clsx(\"pagination-btn\", current && \"pagination-btn-active\")}\n >\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationGap() {\n return (\n <div aria-hidden=\"true\" className=\"pagination-gap\">\n &hellip;\n </div>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function buildPaginationPages(current: number, total: number): Array<number | \"...\"> {\n if (total <= 6) return Array.from({ length: total }, (_, i) => i + 1);\n const head = [1, 2, 3];\n const tail = [total - 1, total];\n if (current <= 4) return [...head, \"...\", ...tail];\n if (current >= total - 3) return [1, 2, \"...\", total - 2, total - 1, total];\n return [1, \"...\", current - 1, current, current + 1, \"...\", total];\n}\n"],"names":["isControlledProps","props","Pagination","page","totalPages","onPageChange","previousLabel","nextLabel","className","jsxs","clsx","jsx","PaginationPrevious","PaginationList","buildPaginationPages","p","i","PaginationGap","PaginationPage","PaginationNext","ariaLabel","rest","href","onPress","isDisabled","children","AnchorOrButton","IconArrowLeft","IconArrowRight","isTabletUp","useMediaQuery","current","total","_","head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,EAAqBiB,EAAiBC,EAAsC,CAC1F,GAAIA,GAAS,EAAG,OAAO,MAAM,KAAK,CAAE,OAAQA,CAAA,EAAS,CAACC,EAAGjB,IAAMA,EAAI,CAAC,EACpE,MAAMkB,EAAO,CAAC,EAAG,EAAG,CAAC,EACfC,EAAO,CAACH,EAAQ,EAAGA,CAAK,EAC9B,OAAID,GAAW,EAAU,CAAC,GAAGG,EAAM,MAAO,GAAGC,CAAI,EAC7CJ,GAAWC,EAAQ,EAAU,CAAC,EAAG,EAAG,MAAOA,EAAQ,EAAGA,EAAQ,EAAGA,CAAK,EACnE,CAAC,EAAG,MAAOD,EAAU,EAAGA,EAASA,EAAU,EAAG,MAAOC,CAAK,CACnE"}
1
+ {"version":3,"file":"Pagination.cjs","sources":["../../../../../src/ui/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useMediaQuery } from \"hooks\";\nimport { IconArrowLeft, IconArrowRight } from \"icons\";\nimport type React from \"react\";\nimport { AnchorOrButton } from \"utils\";\nimport \"./pagination.css\";\n\nexport type PaginationManualProps = React.ComponentPropsWithoutRef<\"nav\">;\n\nexport type PaginationControlledProps = {\n page: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n previousLabel: string;\n nextLabel: string;\n className?: string;\n};\n\nexport type PaginationProps = PaginationManualProps | PaginationControlledProps;\n\nfunction isControlledProps(\n props: PaginationProps,\n): props is PaginationControlledProps {\n return \"totalPages\" in props;\n}\n\nexport function Pagination(props: PaginationProps) {\n if (isControlledProps(props)) {\n const { page, totalPages, onPageChange, previousLabel, nextLabel, className } = props;\n if (totalPages <= 1) return null;\n return (\n <nav aria-label=\"Page navigation\" className={clsx(className, \"sds-pagination\")}>\n <PaginationPrevious isDisabled={page <= 1} onPress={() => onPageChange(Math.max(1, page - 1))}>\n {previousLabel}\n </PaginationPrevious>\n <PaginationList>\n {buildPaginationPages(page, totalPages).map((p, i) =>\n p === \"...\" ? (\n <PaginationGap key={`gap-${i}`} />\n ) : (\n <PaginationPage key={p} current={p === page} onPress={() => onPageChange(p)}>\n {String(p)}\n </PaginationPage>\n ),\n )}\n </PaginationList>\n <PaginationNext isDisabled={page >= totalPages} onPress={() => onPageChange(Math.min(totalPages, page + 1))}>\n {nextLabel}\n </PaginationNext>\n </nav>\n );\n }\n const { \"aria-label\": ariaLabel = \"Page navigation\", className, ...rest } = props;\n return <nav aria-label={ariaLabel} {...rest} className={clsx(className, \"sds-pagination\")} />;\n}\n\nexport function PaginationPrevious({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Previous\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Previous page\"\n >\n <IconArrowLeft size=\"16\" />\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationNext({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Next\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Next page\"\n >\n {children}\n <IconArrowRight size=\"16\" />\n </AnchorOrButton>\n );\n}\n\nexport function PaginationList({ children }: { children: React.ReactNode }) {\n const { isTabletUp } = useMediaQuery();\n return isTabletUp && <span className=\"pagination-list\">{children}</span>;\n}\n\nexport function PaginationPage({\n href,\n onPress,\n children,\n current = false,\n}: {\n href?: string;\n onPress?: () => void;\n children: string;\n current?: boolean;\n}) {\n return (\n <AnchorOrButton\n {...(href ? { href } : {})}\n onPress={onPress}\n aria-label={`Page ${children}`}\n aria-current={current ? \"page\" : undefined}\n className={clsx(\"pagination-btn\", current && \"pagination-btn-active\")}\n >\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationGap() {\n return (\n <div aria-hidden=\"true\" className=\"pagination-gap\">\n &hellip;\n </div>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function buildPaginationPages(current: number, total: number): Array<number | \"...\"> {\n if (total <= 6) return Array.from({ length: total }, (_, i) => i + 1);\n const head = [1, 2, 3];\n const tail = [total - 1, total];\n if (current <= 4) return [...head, \"...\", ...tail];\n if (current >= total - 3) return [1, 2, \"...\", total - 2, total - 1, total];\n return [1, \"...\", current - 1, current, current + 1, \"...\", total];\n}\n"],"names":["isControlledProps","props","Pagination","page","totalPages","onPageChange","previousLabel","nextLabel","className","jsxs","clsx","jsx","PaginationPrevious","PaginationList","buildPaginationPages","p","i","PaginationGap","PaginationPage","PaginationNext","ariaLabel","rest","href","onPress","isDisabled","children","AnchorOrButton","IconArrowLeft","IconArrowRight","isTabletUp","useMediaQuery","current","total","_","head","tail"],"mappings":"yXAoBA,SAASA,EACPC,EACoC,CACpC,MAAO,eAAgBA,CACzB,CAEO,SAASC,EAAWD,EAAwB,CACjD,GAAID,EAAkBC,CAAK,EAAG,CAC5B,KAAM,CAAE,KAAAE,EAAM,WAAAC,EAAY,aAAAC,EAAc,cAAAC,EAAe,UAAAC,EAAW,UAAAC,GAAcP,EAChF,OAAIG,GAAc,EAAU,KAE1BK,OAAC,OAAI,aAAW,kBAAkB,UAAWC,EAAAA,KAAKF,EAAW,gBAAgB,EAC3E,SAAA,CAAAG,EAAAA,IAACC,EAAA,CAAmB,WAAYT,GAAQ,EAAG,QAAS,IAAME,EAAa,KAAK,IAAI,EAAGF,EAAO,CAAC,CAAC,EACzF,SAAAG,EACH,EACAK,EAAAA,IAACE,EAAA,CACE,SAAAC,EAAqBX,EAAMC,CAAU,EAAE,IAAI,CAACW,EAAGC,IAC9CD,IAAM,YACHE,EAAA,CAAA,EAAmB,OAAOD,CAAC,EAAI,E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AK,IAAA,CAAK,CAAA,CAAA,CAAA,CAGhC,CAEO,SAASf,EAAe,CAAE,SAAAY,GAA2C,CAC1E,KAAM,CAAE,WAAAI,CAAA,EAAeC,gBAAA,EACvB,OAAOD,GAAclB,EAAAA,IAAC,OAAA,CAAK,UAAU,kBAAmB,SAAAc,EAAS,CACnE,CAEO,SAASP,EAAe,CAC7B,KAAAI,EACA,QAAAC,EACA,SAAAE,EACA,QAAAM,EAAU,EACZ,EAKG,CACD,OACEpB,EAAAA,IAACe,EAAAA,eAAA,CACE,GAAIJ,EAAO,CAAE,KAAAA,CAAA,EAAS,CAAA,EACvB,QAAAC,EACA,aAAY,QAAQE,CAAQ,GAC5B,eAAcM,EAAU,OAAS,OACjC,UAAWrB,EAAAA,KAAK,iBAAkBqB,GAAW,uBAAuB,EAEnE,SAAAN,CAAA,CAAA,CAGP,CAEO,SAASR,GAAgB,CAC9B,aACG,MAAA,CAAI,cAAY,OAAO,UAAU,iBAAiB,SAAA,IAEnD,CAEJ,CAGO,SAASH,EAAqBiB,EAAiBC,EAAsC,CAC1F,GAAIA,GAAS,EAAG,OAAO,MAAM,KAAK,CAAE,OAAQA,CAAA,EAAS,CAACC,EAAGjB,IAAMA,EAAI,CAAC,EACpE,MAAMkB,EAAO,CAAC,EAAG,EAAG,CAAC,EACfC,EAAO,CAACH,EAAQ,EAAGA,CAAK,EAC9B,OAAID,GAAW,EAAU,CAAC,GAAGG,EAAM,MAAO,GAAGC,CAAI,EAC7CJ,GAAWC,EAAQ,EAAU,CAAC,EAAG,EAAG,MAAOA,EAAQ,EAAGA,EAAQ,EAAGA,CAAK,EACnE,CAAC,EAAG,MAAOD,EAAU,EAAGA,EAASA,EAAU,EAAG,MAAOC,CAAK,CACnE"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as u, jsx as i } from "react/jsx-runtime";
2
2
  import { clsx as o } from "../../../vendor/clsx/dist/clsx.js";
3
3
  /* empty css */
4
- import { IconArrowLeft as d } from "../../icons/IconArrowLeft.js";
4
+ import { IconArrowLeft as b } from "../../icons/IconArrowLeft.js";
5
5
  import { IconArrowRight as f } from "../../icons/IconArrowRight.js";
6
6
  import { useMediaQuery as v } from "../../hooks/useMediaQuery.js";
7
7
  import { AnchorOrButton as c } from "../../utils/AnchorOrButton.js";
@@ -10,17 +10,17 @@ function N(a) {
10
10
  }
11
11
  function B(a) {
12
12
  if (N(a)) {
13
- const { page: t, totalPages: s, onPageChange: g, previousLabel: m, nextLabel: p, className: P } = a;
14
- return s <= 1 ? null : /* @__PURE__ */ u("nav", { "aria-label": "Page navigation", className: o(P, "pagination"), children: [
13
+ const { page: t, totalPages: s, onPageChange: g, previousLabel: m, nextLabel: p, className: d } = a;
14
+ return s <= 1 ? null : /* @__PURE__ */ u("nav", { "aria-label": "Page navigation", className: o(d, "sds-pagination"), children: [
15
15
  /* @__PURE__ */ i(h, { isDisabled: t <= 1, onPress: () => g(Math.max(1, t - 1)), children: m }),
16
16
  /* @__PURE__ */ i(L, { children: M(t, s).map(
17
- (l, b) => l === "..." ? /* @__PURE__ */ i(D, {}, `gap-${b}`) : /* @__PURE__ */ i(A, { current: l === t, onPress: () => g(l), children: String(l) }, l)
17
+ (l, P) => l === "..." ? /* @__PURE__ */ i(D, {}, `gap-${P}`) : /* @__PURE__ */ i(A, { current: l === t, onPress: () => g(l), children: String(l) }, l)
18
18
  ) }),
19
19
  /* @__PURE__ */ i(x, { isDisabled: t >= s, onPress: () => g(Math.min(s, t + 1)), children: p })
20
20
  ] });
21
21
  }
22
22
  const { "aria-label": n = "Page navigation", className: e, ...r } = a;
23
- return /* @__PURE__ */ i("nav", { "aria-label": n, ...r, className: o(e, "pagination") });
23
+ return /* @__PURE__ */ i("nav", { "aria-label": n, ...r, className: o(e, "sds-pagination") });
24
24
  }
25
25
  function h({
26
26
  href: a = null,
@@ -37,7 +37,7 @@ function h({
37
37
  className: o("pagination-btn", "pagination-nav"),
38
38
  "aria-label": "Previous page",
39
39
  children: [
40
- /* @__PURE__ */ i(d, { size: "16" }),
40
+ /* @__PURE__ */ i(b, { size: "16" }),
41
41
  r
42
42
  ]
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","sources":["../../../../../src/ui/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useMediaQuery } from \"hooks\";\nimport { IconArrowLeft, IconArrowRight } from \"icons\";\nimport type React from \"react\";\nimport { AnchorOrButton } from \"utils\";\nimport \"./pagination.css\";\n\nexport type PaginationManualProps = React.ComponentPropsWithoutRef<\"nav\">;\n\nexport type PaginationControlledProps = {\n page: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n previousLabel: string;\n nextLabel: string;\n className?: string;\n};\n\nexport type PaginationProps = PaginationManualProps | PaginationControlledProps;\n\nfunction isControlledProps(\n props: PaginationProps,\n): props is PaginationControlledProps {\n return \"totalPages\" in props;\n}\n\nexport function Pagination(props: PaginationProps) {\n if (isControlledProps(props)) {\n const { page, totalPages, onPageChange, previousLabel, nextLabel, className } = props;\n if (totalPages <= 1) return null;\n return (\n <nav aria-label=\"Page navigation\" className={clsx(className, \"pagination\")}>\n <PaginationPrevious isDisabled={page <= 1} onPress={() => onPageChange(Math.max(1, page - 1))}>\n {previousLabel}\n </PaginationPrevious>\n <PaginationList>\n {buildPaginationPages(page, totalPages).map((p, i) =>\n p === \"...\" ? (\n <PaginationGap key={`gap-${i}`} />\n ) : (\n <PaginationPage key={p} current={p === page} onPress={() => onPageChange(p)}>\n {String(p)}\n </PaginationPage>\n ),\n )}\n </PaginationList>\n <PaginationNext isDisabled={page >= totalPages} onPress={() => onPageChange(Math.min(totalPages, page + 1))}>\n {nextLabel}\n </PaginationNext>\n </nav>\n );\n }\n const { \"aria-label\": ariaLabel = \"Page navigation\", className, ...rest } = props;\n return <nav aria-label={ariaLabel} {...rest} className={clsx(className, \"pagination\")} />;\n}\n\nexport function PaginationPrevious({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Previous\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Previous page\"\n >\n <IconArrowLeft size=\"16\" />\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationNext({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Next\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Next page\"\n >\n {children}\n <IconArrowRight size=\"16\" />\n </AnchorOrButton>\n );\n}\n\nexport function PaginationList({ children }: { children: React.ReactNode }) {\n const { isTabletUp } = useMediaQuery();\n return isTabletUp && <span className=\"pagination-list\">{children}</span>;\n}\n\nexport function PaginationPage({\n href,\n onPress,\n children,\n current = false,\n}: {\n href?: string;\n onPress?: () => void;\n children: string;\n current?: boolean;\n}) {\n return (\n <AnchorOrButton\n {...(href ? { href } : {})}\n onPress={onPress}\n aria-label={`Page ${children}`}\n aria-current={current ? \"page\" : undefined}\n className={clsx(\"pagination-btn\", current && \"pagination-btn-active\")}\n >\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationGap() {\n return (\n <div aria-hidden=\"true\" className=\"pagination-gap\">\n &hellip;\n </div>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function buildPaginationPages(current: number, total: number): Array<number | \"...\"> {\n if (total <= 6) return Array.from({ length: total }, (_, i) => i + 1);\n const head = [1, 2, 3];\n const tail = [total - 1, total];\n if (current <= 4) return [...head, \"...\", ...tail];\n if (current >= total - 3) return [1, 2, \"...\", total - 2, total - 1, total];\n return [1, \"...\", current - 1, current, current + 1, \"...\", total];\n}\n"],"names":["isControlledProps","props","Pagination","page","totalPages","onPageChange","previousLabel","nextLabel","className","jsxs","clsx","jsx","PaginationPrevious","PaginationList","buildPaginationPages","p","i","PaginationGap","PaginationPage","PaginationNext","ariaLabel","rest","href","onPress","isDisabled","children","AnchorOrButton","IconArrowLeft","IconArrowRight","isTabletUp","useMediaQuery","current","total","_","head","tail"],"mappings":";;;;;;;AAoBA,SAASA,EACPC,GACoC;AACpC,SAAO,gBAAgBA;AACzB;AAEO,SAASC,EAAWD,GAAwB;AACjD,MAAID,EAAkBC,CAAK,GAAG;AAC5B,UAAM,EAAE,MAAAE,GAAM,YAAAC,GAAY,cAAAC,GAAc,eAAAC,GAAe,WAAAC,GAAW,WAAAC,MAAcP;AAChF,WAAIG,KAAc,IAAU,OAE1B,gBAAAK,EAAC,SAAI,cAAW,mBAAkB,WAAWC,EAAKF,GAAW,YAAY,GACvE,UAAA;AAAA,MAAA,gBAAAG,EAACC,GAAA,EAAmB,YAAYT,KAAQ,GAAG,SAAS,MAAME,EAAa,KAAK,IAAI,GAAGF,IAAO,CAAC,CAAC,GACzF,UAAAG,GACH;AAAA,MACA,gBAAAK,EAACE,GAAA,EACE,UAAAC,EAAqBX,GAAMC,CAAU,EAAE;AAAA,QAAI,CAACW,GAAGC,MAC9CD,MAAM,0BACHE,GAAA,CAAA,GAAmB,OAAOD,CAAC,EAAI,IAEhC,gBAAAL,EAACO,KAAuB,SAASH,MAAMZ,GAAM,SAAS,MAAME,EAAaU,CAAC,GACvE,UAAA,OAAOA,CAAC,EAAA,GADUA,CAErB;AAAA,MAAA,GAGN;AAAA,MACA,gBAAAJ,EAACQ,GAAA,EAAe,YAAYhB,KAAQC,GAAY,SAAS,MAAMC,EAAa,KAAK,IAAID,GAAYD,IAAO,CAAC,CAAC,GACvG,UAAAI,EAAA,CACH;AAAA,IAAA,GACF;AAAA,EAEJ;AACA,QAAM,EAAE,cAAca,IAAY,mBAAmB,WA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EAAK,WAAU,mBAAmB,UAAAc,GAAS;AACnE;AAEO,SAASP,EAAe;AAAA,EAC7B,MAAAI;AAAA,EACA,SAAAC;AAAA,EACA,UAAAE;AAAA,EACA,SAAAM,IAAU;AACZ,GAKG;AACD,SACE,gBAAApB;AAAA,IAACe;AAAA,IAAA;AAAA,MACE,GAAIJ,IAAO,EAAE,MAAAA,EAAA,IAAS,CAAA;AAAA,MACvB,SAAAC;AAAA,MACA,cAAY,QAAQE,CAAQ;AAAA,MAC5B,gBAAcM,IAAU,SAAS;AAAA,MACjC,WAAWrB,EAAK,kBAAkBqB,KAAW,uBAAuB;AAAA,MAEnE,UAAAN;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAASR,IAAgB;AAC9B,2BACG,OAAA,EAAI,eAAY,QAAO,WAAU,kBAAiB,UAAA,KAEnD;AAEJ;AAGO,SAASH,EAAqBiB,GAAiBC,GAAsC;AAC1F,MAAIA,KAAS,EAAG,QAAO,MAAM,KAAK,EAAE,QAAQA,EAAA,GAAS,CAACC,GAAGjB,MAAMA,IAAI,CAAC;AACpE,QAAMkB,IAAO,CAAC,GAAG,GAAG,CAAC,GACfC,IAAO,CAACH,IAAQ,GAAGA,CAAK;AAC9B,SAAID,KAAW,IAAU,CAAC,GAAGG,GAAM,OAAO,GAAGC,CAAI,IAC7CJ,KAAWC,IAAQ,IAAU,CAAC,GAAG,GAAG,OAAOA,IAAQ,GAAGA,IAAQ,GAAGA,CAAK,IACnE,CAAC,GAAG,OAAOD,IAAU,GAAGA,GAASA,IAAU,GAAG,OAAOC,CAAK;AACnE;"}
1
+ {"version":3,"file":"Pagination.js","sources":["../../../../../src/ui/primitives/Pagination/Pagination.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { useMediaQuery } from \"hooks\";\nimport { IconArrowLeft, IconArrowRight } from \"icons\";\nimport type React from \"react\";\nimport { AnchorOrButton } from \"utils\";\nimport \"./pagination.css\";\n\nexport type PaginationManualProps = React.ComponentPropsWithoutRef<\"nav\">;\n\nexport type PaginationControlledProps = {\n page: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n previousLabel: string;\n nextLabel: string;\n className?: string;\n};\n\nexport type PaginationProps = PaginationManualProps | PaginationControlledProps;\n\nfunction isControlledProps(\n props: PaginationProps,\n): props is PaginationControlledProps {\n return \"totalPages\" in props;\n}\n\nexport function Pagination(props: PaginationProps) {\n if (isControlledProps(props)) {\n const { page, totalPages, onPageChange, previousLabel, nextLabel, className } = props;\n if (totalPages <= 1) return null;\n return (\n <nav aria-label=\"Page navigation\" className={clsx(className, \"sds-pagination\")}>\n <PaginationPrevious isDisabled={page <= 1} onPress={() => onPageChange(Math.max(1, page - 1))}>\n {previousLabel}\n </PaginationPrevious>\n <PaginationList>\n {buildPaginationPages(page, totalPages).map((p, i) =>\n p === \"...\" ? (\n <PaginationGap key={`gap-${i}`} />\n ) : (\n <PaginationPage key={p} current={p === page} onPress={() => onPageChange(p)}>\n {String(p)}\n </PaginationPage>\n ),\n )}\n </PaginationList>\n <PaginationNext isDisabled={page >= totalPages} onPress={() => onPageChange(Math.min(totalPages, page + 1))}>\n {nextLabel}\n </PaginationNext>\n </nav>\n );\n }\n const { \"aria-label\": ariaLabel = \"Page navigation\", className, ...rest } = props;\n return <nav aria-label={ariaLabel} {...rest} className={clsx(className, \"sds-pagination\")} />;\n}\n\nexport function PaginationPrevious({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Previous\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Previous page\"\n >\n <IconArrowLeft size=\"16\" />\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationNext({\n href = null,\n onPress,\n isDisabled = false,\n children = \"Next\",\n}: {\n href?: string | null;\n onPress?: () => void;\n isDisabled?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <AnchorOrButton\n {...(href !== null ? { href } : {})}\n onPress={onPress}\n isDisabled={isDisabled || (href === null && !onPress)}\n className={clsx(\"pagination-btn\", \"pagination-nav\")}\n aria-label=\"Next page\"\n >\n {children}\n <IconArrowRight size=\"16\" />\n </AnchorOrButton>\n );\n}\n\nexport function PaginationList({ children }: { children: React.ReactNode }) {\n const { isTabletUp } = useMediaQuery();\n return isTabletUp && <span className=\"pagination-list\">{children}</span>;\n}\n\nexport function PaginationPage({\n href,\n onPress,\n children,\n current = false,\n}: {\n href?: string;\n onPress?: () => void;\n children: string;\n current?: boolean;\n}) {\n return (\n <AnchorOrButton\n {...(href ? { href } : {})}\n onPress={onPress}\n aria-label={`Page ${children}`}\n aria-current={current ? \"page\" : undefined}\n className={clsx(\"pagination-btn\", current && \"pagination-btn-active\")}\n >\n {children}\n </AnchorOrButton>\n );\n}\n\nexport function PaginationGap() {\n return (\n <div aria-hidden=\"true\" className=\"pagination-gap\">\n &hellip;\n </div>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components -- utilitário reaproveitado fora deste arquivo, não é um componente\nexport function buildPaginationPages(current: number, total: number): Array<number | \"...\"> {\n if (total <= 6) return Array.from({ length: total }, (_, i) => i + 1);\n const head = [1, 2, 3];\n const tail = [total - 1, total];\n if (current <= 4) return [...head, \"...\", ...tail];\n if (current >= total - 3) return [1, 2, \"...\", total - 2, total - 1, total];\n return [1, \"...\", current - 1, current, current + 1, \"...\", total];\n}\n"],"names":["isControlledProps","props","Pagination","page","totalPages","onPageChange","previousLabel","nextLabel","className","jsxs","clsx","jsx","PaginationPrevious","PaginationList","buildPaginationPages","p","i","PaginationGap","PaginationPage","PaginationNext","ariaLabel","rest","href","onPress","isDisabled","children","AnchorOrButton","IconArrowLeft","IconArrowRight","isTabletUp","useMediaQuery","current","total","_","head","tail"],"mappings":";;;;;;;AAoBA,SAASA,EACPC,GACoC;AACpC,SAAO,gBAAgBA;AAC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M,IAAU,SAAS;AAAA,MACjC,WAAWrB,EAAK,kBAAkBqB,KAAW,uBAAuB;AAAA,MAEnE,UAAAN;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAASR,IAAgB;AAC9B,2BACG,OAAA,EAAI,eAAY,QAAO,WAAU,kBAAiB,UAAA,KAEnD;AAEJ;AAGO,SAASH,EAAqBiB,GAAiBC,GAAsC;AAC1F,MAAIA,KAAS,EAAG,QAAO,MAAM,KAAK,EAAE,QAAQA,EAAA,GAAS,CAACC,GAAGjB,MAAMA,IAAI,CAAC;AACpE,QAAMkB,IAAO,CAAC,GAAG,GAAG,CAAC,GACfC,IAAO,CAACH,IAAQ,GAAGA,CAAK;AAC9B,SAAID,KAAW,IAAU,CAAC,GAAGG,GAAM,OAAO,GAAGC,CAAI,IAC7CJ,KAAWC,IAAQ,IAAU,CAAC,GAAG,GAAG,OAAOA,IAAQ,GAAGA,IAAQ,GAAGA,CAAK,IACnE,CAAC,GAAG,OAAOD,IAAU,GAAGA,GAASA,IAAU,GAAG,OAAOC,CAAK;AACnE;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../../vendor/clsx/dist/clsx.cjs"),u=require("react-aria-components");;/* empty css */const a=require("../Fieldset/Fieldset.cjs");function m({className:s,label:i,description:r,errorMessage:o,children:n,...c}){const l=d.clsx(s,"radio-group");return e.jsxs(u.RadioGroup,{...c,className:l,children:[i&&e.jsx(a.Label,{children:i}),r&&e.jsx(a.Description,{children:r}),o&&e.jsx(a.FieldError,{children:o}),n]})}function h({children:s,className:i,label:r,description:o,errorMessage:n,inline:c,...l}){const j=d.clsx(i,"radio-field",c&&"radio-field--inline"),t=r||(typeof s=="string"?s:void 0);return e.jsx(u.Radio,{className:j,...l,children:e.jsxs(e.Fragment,{children:[e.jsx(a.Label,{children:t}),e.jsx(x,{}),o&&e.jsx(a.Description,{children:o}),e.jsx(a.FieldError,{children:n}),t!==s&&e.jsx("span",{className:"label",children:s})]})})}function x({className:s,...i}){const r=d.clsx(s,"radio");return e.jsx("div",{className:r,...i,children:e.jsx("span",{"aria-hidden":"true",className:"radio-check"})})}exports.Radio=x;exports.RadioField=h;exports.RadioGroup=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("../../../vendor/clsx/dist/clsx.cjs"),u=require("react-aria-components");;/* empty css */const a=require("../Fieldset/Fieldset.cjs");function m({className:e,label:i,description:r,errorMessage:o,children:n,...c}){const l=d.clsx(e,"radio-group");return s.jsxs(u.RadioGroup,{...c,className:l,children:[i&&s.jsx(a.Label,{children:i}),r&&s.jsx(a.Description,{children:r}),o&&s.jsx(a.FieldError,{children:o}),n]})}function h({children:e,className:i,label:r,description:o,errorMessage:n,inline:c,...l}){const j=d.clsx(i,"radio-field",c&&"radio-field--inline"),t=r||(typeof e=="string"?e:void 0);return s.jsx(u.Radio,{className:j,...l,children:s.jsxs(s.Fragment,{children:[s.jsx(a.Label,{children:t}),s.jsx(x,{}),o&&s.jsx(a.Description,{children:o}),s.jsx(a.FieldError,{children:n}),t!==e&&s.jsx("span",{className:"sds-label",children:e})]})})}function x({className:e,...i}){const r=d.clsx(e,"radio");return s.jsx("div",{className:r,...i,children:s.jsx("span",{"aria-hidden":"true",className:"radio-check"})})}exports.Radio=x;exports.RadioField=h;exports.RadioGroup=m;
2
2
  //# sourceMappingURL=Radio.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.cjs","sources":["../../../../../src/ui/primitives/Radio/Radio.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport {\n Radio as RACRadio,\n RadioGroup as RACRadioGroup,\n type RadioGroupProps as RACRadioGroupProps,\n type RadioProps as RACRadioProps,\n} from \"react-aria-components\";\nimport \"./radio.css\";\n\nexport interface RadioGroupProps\n extends Omit<RACRadioGroupProps, \"children\">,\n SharedFieldProps {\n children?: React.ReactNode;\n}\n\nexport function RadioGroup({\n className,\n label,\n description,\n errorMessage,\n children,\n ...props\n}: RadioGroupProps) {\n const classNames = clsx(className, \"radio-group\");\n return (\n <RACRadioGroup {...props} className={classNames}>\n {label && <Label>{label}</Label>}\n {description && <Description>{description}</Description>}\n {errorMessage && <FieldError>{errorMessage}</FieldError>}\n {children}\n </RACRadioGroup>\n );\n}\n\nexport type RadioFieldProps = RACRadioProps &\n SharedFieldProps & { inline?: boolean };\nexport function RadioField({\n children,\n className,\n label,\n description,\n errorMessage,\n inline,\n ...props\n}: RadioFieldProps) {\n const classNames = clsx(\n className,\n \"radio-field\",\n inline && \"radio-field--inline\",\n );\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACRadio className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Radio />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && (\n <span className=\"label\">{children as React.ReactNode}</span>\n )}\n </>\n </RACRadio>\n );\n}\n\nexport type RadioProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Radio({ className, ...props }: RadioProps) {\n const classNames = clsx(className, \"radio\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"radio-check\" />\n </div>\n );\n}\n"],"names":["RadioGroup","className","label","description","errorMessage","children","props","classNames","clsx","jsxs","RACRadioGroup","jsx","Label","Description","FieldError","RadioField","inline","labelText","RACRadio","Fragment","Radio"],"mappings":"+QAgBO,SAASA,EAAW,CACzB,UAAAC,EACA,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,MAAMC,EAAaC,EAAAA,KAAKP,EAAW,aAAa,EAChD,OACEQ,EAAAA,KAACC,EAAAA,WAAA,CAAe,GAAGJ,EAAO,UAAWC,EAClC,SAAA,CAAAL,GAASS,EAAAA,IAACC,EAAAA,OAAO,SAAAV,CAAA,CAAM,EACvBC,GAAeQ,EAAAA,IAACE,EAAAA,YAAA,CAAa,SAAAV,CAAA,CAAY,EACzCC,GAAgBO,EAAAA,IAACG,EAAAA,WAAA,CAAY,SAAAV,CAAA,CAAa,EAC1CC,CAAA,EACH,CAEJ,CAIO,SAASU,EAAW,CACzB,SAAAV,EACA,UAAAJ,EACA,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,OAAAY,EACA,GAAGV,CACL,EAAoB,CAClB,MAAMC,EAAaC,EAAAA,KACjBP,EACA,cACAe,GAAU,qBAAA,EAENC,EACJf,IAAU,OAAOG,GAAa,SAAWA,EAAW,QACtD,aACGa,EAAAA,MAAA,CAAS,UAAWX,EAAa,GAAGD,EACnC,SAAAG,EAAAA,KAAAU,EAAAA,SAAA,CACE,SAAA,CAAAR,EAAAA,IAACC,EAAAA,OAAO,SAAAK,CAAA,CAAU,QACjBG,EAAA,EAAM,EACNjB,GAAeQ,EAAAA,IAACE,EAAAA,YAAA,CAAa,SAAAV,CAAA,CAAY,EAC1CQ,EAAAA,IAACG,EAAAA,YAAY,SAAAV,CAAA,CAAa,EACzBa,IAAcZ,GACbM,MAAC,OAAA,CAAK,UAAU,QAAS,SAAAN,CAAA,CAA4B,CAAA,CAAA,CAEzD,CAAA,CACF,CAEJ,CAGO,SAASe,EAAM,CAAE,UAAAnB,EAAW,GAAGK,GAAqB,CACzD,MAAMC,EAAaC,EAAAA,KAAKP,EAAW,OAAO,EAC1C,OACEU,EAAAA,IAAC,MAAA,CAAI,UAAWJ,EAAa,GAAGD,EAC9B,SAAAK,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAO,UAAU,aAAA,CAAc,EACnD,CAEJ"}
1
+ {"version":3,"file":"Radio.cjs","sources":["../../../../../src/ui/primitives/Radio/Radio.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport {\n Radio as RACRadio,\n RadioGroup as RACRadioGroup,\n type RadioGroupProps as RACRadioGroupProps,\n type RadioProps as RACRadioProps,\n} from \"react-aria-components\";\nimport \"./radio.css\";\n\nexport interface RadioGroupProps\n extends Omit<RACRadioGroupProps, \"children\">,\n SharedFieldProps {\n children?: React.ReactNode;\n}\n\nexport function RadioGroup({\n className,\n label,\n description,\n errorMessage,\n children,\n ...props\n}: RadioGroupProps) {\n const classNames = clsx(className, \"radio-group\");\n return (\n <RACRadioGroup {...props} className={classNames}>\n {label && <Label>{label}</Label>}\n {description && <Description>{description}</Description>}\n {errorMessage && <FieldError>{errorMessage}</FieldError>}\n {children}\n </RACRadioGroup>\n );\n}\n\nexport type RadioFieldProps = RACRadioProps &\n SharedFieldProps & { inline?: boolean };\nexport function RadioField({\n children,\n className,\n label,\n description,\n errorMessage,\n inline,\n ...props\n}: RadioFieldProps) {\n const classNames = clsx(\n className,\n \"radio-field\",\n inline && \"radio-field--inline\",\n );\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACRadio className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Radio />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && (\n <span className=\"sds-label\">{children as React.ReactNode}</span>\n )}\n </>\n </RACRadio>\n );\n}\n\nexport type RadioProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Radio({ className, ...props }: RadioProps) {\n const classNames = clsx(className, \"radio\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"radio-check\" />\n </div>\n );\n}\n"],"names":["RadioGroup","className","label","description","errorMessage","children","props","classNames","clsx","jsxs","RACRadioGroup","jsx","Label","Description","FieldError","RadioField","inline","labelText","RACRadio","Fragment","Radio"],"mappings":"+QAgBO,SAASA,EAAW,CACzB,UAAAC,EACA,MAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAoB,CAClB,MAAMC,EAAaC,EAAAA,KAAKP,EAAW,aAAa,EAChD,OACEQ,EAAAA,KAACC,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13
  }) {
14
- const d = c(i, "radio-group");
15
- return /* @__PURE__ */ t(N, { ...n, className: d, children: [
14
+ const n = c(i, "radio-group");
15
+ return /* @__PURE__ */ t(N, { ...d, className: n, children: [
16
16
  r && /* @__PURE__ */ a(m, { children: r }),
17
17
  o && /* @__PURE__ */ a(p, { children: o }),
18
18
  s && /* @__PURE__ */ a(u, { children: s }),
@@ -25,20 +25,20 @@ function $({
25
25
  label: o,
26
26
  description: s,
27
27
  errorMessage: e,
28
- inline: n,
29
- ...d
28
+ inline: d,
29
+ ...n
30
30
  }) {
31
31
  const f = c(
32
32
  r,
33
33
  "radio-field",
34
- n && "radio-field--inline"
34
+ d && "radio-field--inline"
35
35
  ), l = o || (typeof i == "string" ? i : void 0);
36
- return /* @__PURE__ */ a(R, { className: f, ...d, children: /* @__PURE__ */ t(h, { children: [
36
+ return /* @__PURE__ */ a(R, { className: f, ...n, children: /* @__PURE__ */ t(h, { children: [
37
37
  /* @__PURE__ */ a(m, { children: l }),
38
38
  /* @__PURE__ */ a(x, {}),
39
39
  s && /* @__PURE__ */ a(p, { children: s }),
40
40
  /* @__PURE__ */ a(u, { children: e }),
41
- l !== i && /* @__PURE__ */ a("span", { className: "label", children: i })
41
+ l !== i && /* @__PURE__ */ a("span", { className: "sds-label", children: i })
42
42
  ] }) });
43
43
  }
44
44
  function x({ className: i, ...r }) {
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sources":["../../../../../src/ui/primitives/Radio/Radio.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport {\n Radio as RACRadio,\n RadioGroup as RACRadioGroup,\n type RadioGroupProps as RACRadioGroupProps,\n type RadioProps as RACRadioProps,\n} from \"react-aria-components\";\nimport \"./radio.css\";\n\nexport interface RadioGroupProps\n extends Omit<RACRadioGroupProps, \"children\">,\n SharedFieldProps {\n children?: React.ReactNode;\n}\n\nexport function RadioGroup({\n className,\n label,\n description,\n errorMessage,\n children,\n ...props\n}: RadioGroupProps) {\n const classNames = clsx(className, \"radio-group\");\n return (\n <RACRadioGroup {...props} className={classNames}>\n {label && <Label>{label}</Label>}\n {description && <Description>{description}</Description>}\n {errorMessage && <FieldError>{errorMessage}</FieldError>}\n {children}\n </RACRadioGroup>\n );\n}\n\nexport type RadioFieldProps = RACRadioProps &\n SharedFieldProps & { inline?: boolean };\nexport function RadioField({\n children,\n className,\n label,\n description,\n errorMessage,\n inline,\n ...props\n}: RadioFieldProps) {\n const classNames = clsx(\n className,\n \"radio-field\",\n inline && \"radio-field--inline\",\n );\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACRadio className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Radio />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && (\n <span className=\"label\">{children as React.ReactNode}</span>\n )}\n </>\n </RACRadio>\n );\n}\n\nexport type RadioProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Radio({ className, ...props }: RadioProps) {\n const classNames = clsx(className, \"radio\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"radio-check\" />\n </div>\n );\n}\n"],"names":["RadioGroup","className","label","description","errorMessage","children","props","classNames","clsx","jsxs","RACRadioGroup","jsx","Label","Description","FieldError","RadioField","inline","labelText","RACRadio","Fragment","Radio"],"mappings":";;;;;AAgBO,SAASA,EAAW;AAAA,EACzB,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GAAoB;AAClB,QAAMC,IAAaC,EAAKP,GAAW,aAAa;AAChD,SACE,gBAAAQ,EAACC,GAAA,EAAe,GAAGJ,GAAO,WAAWC,GAClC,UAAA;AAAA,IAAAL,KAAS,gBAAAS,EAACC,KAAO,UAAAV,EAAA,CAAM;AAAA,IACvBC,KAAe,gBAAAQ,EAACE,GAAA,EAAa,UAAAV,EAAA,CAAY;AAAA,IACzCC,KAAgB,gBAAAO,EAACG,GAAA,EAAY,UAAAV,EAAA,CAAa;AAAA,IAC1CC;AAAA,EAAA,GACH;AAEJ;AAIO,SAASU,EAAW;AAAA,EACzB,UAAAV;AAAA,EACA,WAAAJ;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,QAAAY;AAAA,EACA,GAAGV;AACL,GAAoB;AAClB,QAAMC,IAAaC;AAAA,IACjBP;AAAA,IACA;AAAA,IACAe,KAAU;AAAA,EAAA,GAENC,IACJf,MAAU,OAAOG,KAAa,WAAWA,IAAW;AACtD,2BACGa,GAAA,EAAS,WAAWX,GAAa,GAAGD,GACnC,UAAA,gBAAAG,EAAAU,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAR,EAACC,KAAO,UAAAK,EAAA,CAAU;AAAA,sBACjBG,GAAA,EAAM;AAAA,IACNjB,KAAe,gBAAAQ,EAACE,GAAA,EAAa,UAAAV,EAAA,CAAY;AAAA,IAC1C,gBAAAQ,EAACG,KAAY,UAAAV,EAAA,CAAa;AAAA,IACzBa,MAAcZ,KACb,gBAAAM,EAAC,QAAA,EAAK,WAAU,SAAS,UAAAN,EAAA,CAA4B;AAAA,EAAA,EAAA,CAEzD,EAAA,CACF;AAEJ;AAGO,SAASe,EAAM,EAAE,WAAAnB,GAAW,GAAGK,KAAqB;AACzD,QAAMC,IAAaC,EAAKP,GAAW,OAAO;AAC1C,SACE,gBAAAU,EAAC,OAAA,EAAI,WAAWJ,GAAa,GAAGD,GAC9B,UAAA,gBAAAK,EAAC,QAAA,EAAK,eAAY,QAAO,WAAU,cAAA,CAAc,GACnD;AAEJ;"}
1
+ {"version":3,"file":"Radio.js","sources":["../../../../../src/ui/primitives/Radio/Radio.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport {\n Radio as RACRadio,\n RadioGroup as RACRadioGroup,\n type RadioGroupProps as RACRadioGroupProps,\n type RadioProps as RACRadioProps,\n} from \"react-aria-components\";\nimport \"./radio.css\";\n\nexport interface RadioGroupProps\n extends Omit<RACRadioGroupProps, \"children\">,\n SharedFieldProps {\n children?: React.ReactNode;\n}\n\nexport function RadioGroup({\n className,\n label,\n description,\n errorMessage,\n children,\n ...props\n}: RadioGroupProps) {\n const classNames = clsx(className, \"radio-group\");\n return (\n <RACRadioGroup {...props} className={classNames}>\n {label && <Label>{label}</Label>}\n {description && <Description>{description}</Description>}\n {errorMessage && <FieldError>{errorMessage}</FieldError>}\n {children}\n </RACRadioGroup>\n );\n}\n\nexport type RadioFieldProps = RACRadioProps &\n SharedFieldProps & { inline?: boolean };\nexport function RadioField({\n children,\n className,\n label,\n description,\n errorMessage,\n inline,\n ...props\n}: RadioFieldProps) {\n const classNames = clsx(\n className,\n \"radio-field\",\n inline && \"radio-field--inline\",\n );\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACRadio className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Radio />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && (\n <span className=\"sds-label\">{children as React.ReactNode}</span>\n )}\n </>\n </RACRadio>\n );\n}\n\nexport type RadioProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Radio({ className, ...props }: RadioProps) {\n const classNames = clsx(className, \"radio\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"radio-check\" />\n </div>\n );\n}\n"],"names":["RadioGroup","className","label","description","errorMessage","children","props","classNames","clsx","jsxs","RACRadioGroup","jsx","Label","Description","FieldError","RadioField","inline","labelText","RACRadio","Fragment","Radio"],"mappings":";;;;;AAgBO,SAASA,EAAW;AAAA,EACzB,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GAAoB;AAClB,QAAMC,IAAa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AA,CAAc,GACnD;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("../../../vendor/clsx/dist/clsx.cjs"),x=require("react-aria-components");;/* empty css */const i=require("../Fieldset/Fieldset.cjs");function d({className:e,...c}){const t=r.clsx(e,"switch-group");return s.jsx("div",{...c,className:t})}function j({children:e,className:c,label:t,description:n,errorMessage:o,...u}){const h=r.clsx(c,"switch-field"),l=t||(typeof e=="string"?e:void 0);return s.jsx(x.Switch,{className:h,...u,children:s.jsxs(s.Fragment,{children:[s.jsx(i.Label,{children:l}),s.jsx(a,{}),n&&s.jsx(i.Description,{children:n}),s.jsx(i.FieldError,{children:o}),l!==e&&e]})})}function a({className:e,...c}){const t=r.clsx(e,"switch");return s.jsx("div",{className:t,...c,children:s.jsx("span",{"aria-hidden":"true",className:"switch-icon"})})}exports.Switch=a;exports.SwitchField=j;exports.SwitchGroup=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("../../../vendor/clsx/dist/clsx.cjs"),h=require("react-aria-components");;/* empty css */const i=require("../Fieldset/Fieldset.cjs");function x({className:e,...c}){const t=r.clsx(e,"switch-group");return s.jsx("div",{...c,className:t})}function j({children:e,className:c,label:t,description:n,errorMessage:o,...u}){const d=r.clsx(c,"switch-field"),l=t||(typeof e=="string"?e:void 0);return s.jsx(h.Switch,{className:d,...u,children:s.jsxs(s.Fragment,{children:[s.jsx(i.Label,{children:l}),s.jsx(a,{}),n&&s.jsx(i.Description,{children:n}),s.jsx(i.FieldError,{children:o}),l!==e&&e]})})}function a({className:e,...c}){const t=r.clsx(e,"sds-switch");return s.jsx("div",{className:t,...c,children:s.jsx("span",{"aria-hidden":"true",className:"switch-icon"})})}exports.Switch=a;exports.SwitchField=j;exports.SwitchGroup=x;
2
2
  //# sourceMappingURL=Switch.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.cjs","sources":["../../../../../src/ui/primitives/Switch/Switch.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport type React from \"react\";\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from \"react-aria-components\";\nimport \"./switch.css\";\n\nexport type SwitchGroupProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function SwitchGroup({ className, ...props }: SwitchGroupProps) {\n const classNames = clsx(className, \"switch-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type SwitchFieldProps = RACSwitchProps & SharedFieldProps;\nexport function SwitchField({\n children,\n className,\n label,\n description,\n errorMessage,\n ...props\n}: SwitchFieldProps) {\n const classNames = clsx(className, \"switch-field\");\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACSwitch className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Switch />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && children}\n </>\n </RACSwitch>\n );\n}\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Switch({ className, ...props }: SwitchProps) {\n const classNames = clsx(className, \"switch\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"switch-icon\" />\n </div>\n );\n}\n"],"names":["SwitchGroup","className","props","classNames","clsx","jsx","SwitchField","children","label","description","errorMessage","labelText","RACSwitch","jsxs","Fragment","Label","Switch","Description","FieldError"],"mappings":"gRAUO,SAASA,EAAY,CAAE,UAAAC,EAAW,GAAGC,GAA2B,CACrE,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,cAAc,EACjD,OAAOI,EAAAA,IAAC,MAAA,CAAK,GAAGH,EAAO,UAAWC,EAAY,CAChD,CAGO,SAASG,EAAY,CAC1B,SAAAC,EACA,UAAAN,EACA,MAAAO,EACA,YAAAC,EACA,aAAAC,EACA,GAAGR,CACL,EAAqB,CACnB,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,cAAc,EAC3CU,EACJH,IAAU,OAAOD,GAAa,SAAWA,EAAW,QACtD,aACGK,EAAAA,OAAA,CAAU,UAAWT,EAAa,GAAGD,EACpC,SAAAW,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAT,EAAAA,IAACU,EAAAA,OAAO,SAAAJ,CAAA,CAAU,QACjBK,EAAA,EAAO,EACPP,GAAeJ,EAAAA,IAACY,EAAAA,YAAA,CAAa,SAAAR,CAAA,CAAY,EAC1CJ,EAAAA,IAACa,EAAAA,YAAY,SAAAR,CAAA,CAAa,EACzBC,IAAcJ,GAAYA,CAAA,CAAA,CAC7B,CAAA,CACF,CAEJ,CAGO,SAASS,EAAO,CAAE,UAAAf,EAAW,GAAGC,GAAsB,CAC3D,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,QAAQ,EAC3C,OACEI,EAAAA,IAAC,MAAA,CAAI,UAAWF,EAAa,GAAGD,EAC9B,SAAAG,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAO,UAAU,aAAA,CAAc,EACnD,CAEJ"}
1
+ {"version":3,"file":"Switch.cjs","sources":["../../../../../src/ui/primitives/Switch/Switch.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport type React from \"react\";\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from \"react-aria-components\";\nimport \"./switch.css\";\n\nexport type SwitchGroupProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function SwitchGroup({ className, ...props }: SwitchGroupProps) {\n const classNames = clsx(className, \"switch-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type SwitchFieldProps = RACSwitchProps & SharedFieldProps;\nexport function SwitchField({\n children,\n className,\n label,\n description,\n errorMessage,\n ...props\n}: SwitchFieldProps) {\n const classNames = clsx(className, \"switch-field\");\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACSwitch className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Switch />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && children}\n </>\n </RACSwitch>\n );\n}\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Switch({ className, ...props }: SwitchProps) {\n const classNames = clsx(className, \"sds-switch\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"switch-icon\" />\n </div>\n );\n}\n"],"names":["SwitchGroup","className","props","classNames","clsx","jsx","SwitchField","children","label","description","errorMessage","labelText","RACSwitch","jsxs","Fragment","Label","Switch","Description","FieldError"],"mappings":"gRAUO,SAASA,EAAY,CAAE,UAAAC,EAAW,GAAGC,GAA2B,CACrE,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,cAAc,EACjD,OAAOI,EAAAA,IAAC,MAAA,CAAK,GAAGH,EAAO,UAAWC,EAAY,CAChD,CAGO,SAASG,EAAY,CAC1B,SAAAC,EACA,UAAAN,EACA,MAAAO,EACA,YAAAC,EACA,aAAAC,EACA,GAAGR,CACL,EAAqB,CACnB,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,cAAc,EAC3CU,EACJH,IAAU,OAAOD,GAAa,SAAWA,EAAW,QACtD,aACGK,EAAAA,OAAA,CAAU,UAAWT,EAAa,GAAGD,EACpC,SAAAW,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAT,EAAAA,IAACU,EAAAA,OAAO,SAAAJ,CAAA,CAAU,QACjBK,EAAA,EAAO,EACPP,GAAeJ,EAAAA,IAACY,EAAAA,YAAA,CAAa,SAAAR,CAAA,CAAY,EAC1CJ,EAAAA,IAACa,EAAAA,YAAY,SAAAR,CAAA,CAAa,EACzBC,IAAcJ,GAAYA,CAAA,CAAA,CAC7B,CAAA,CACF,CAEJ,CAGO,SAASS,EAAO,CAAE,UAAAf,EAAW,GAAGC,GAAsB,CAC3D,MAAMC,EAAaC,EAAAA,KAAKH,EAAW,YAAY,EAC/C,OACEI,EAAAA,IAAC,MAAA,CAAI,UAAWF,EAAa,GAAGD,EAC9B,SAAAG,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAO,UAAU,aAAA,CAAc,EACnD,CAEJ"}
@@ -25,7 +25,7 @@ function b({
25
25
  ] }) });
26
26
  }
27
27
  function w({ className: s, ...t }) {
28
- const c = r(s, "switch");
28
+ const c = r(s, "sds-switch");
29
29
  return /* @__PURE__ */ i("div", { className: c, ...t, children: /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "switch-icon" }) });
30
30
  }
31
31
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../../../src/ui/primitives/Switch/Switch.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport type React from \"react\";\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from \"react-aria-components\";\nimport \"./switch.css\";\n\nexport type SwitchGroupProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function SwitchGroup({ className, ...props }: SwitchGroupProps) {\n const classNames = clsx(className, \"switch-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type SwitchFieldProps = RACSwitchProps & SharedFieldProps;\nexport function SwitchField({\n children,\n className,\n label,\n description,\n errorMessage,\n ...props\n}: SwitchFieldProps) {\n const classNames = clsx(className, \"switch-field\");\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACSwitch className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Switch />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && children}\n </>\n </RACSwitch>\n );\n}\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Switch({ className, ...props }: SwitchProps) {\n const classNames = clsx(className, \"switch\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"switch-icon\" />\n </div>\n );\n}\n"],"names":["SwitchGroup","className","props","classNames","clsx","jsx","SwitchField","children","label","description","errorMessage","labelText","RACSwitch","jsxs","Fragment","Label","Switch","Description","FieldError"],"mappings":";;;;;AAUO,SAASA,EAAY,EAAE,WAAAC,GAAW,GAAGC,KAA2B;AACrE,QAAMC,IAAaC,EAAKH,GAAW,cAAc;AACjD,SAAO,gBAAAI,EAAC,OAAA,EAAK,GAAGH,GAAO,WAAWC,GAAY;AAChD;AAGO,SAASG,EAAY;AAAA,EAC1B,UAAAC;AAAA,EACA,WAAAN;AAAA,EACA,OAAAO;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGR;AACL,GAAqB;AACnB,QAAMC,IAAaC,EAAKH,GAAW,cAAc,GAC3CU,IACJH,MAAU,OAAOD,KAAa,WAAWA,IAAW;AACtD,2BACGK,GAAA,EAAU,WAAWT,GAAa,GAAGD,GACpC,UAAA,gBAAAW,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAT,EAACU,KAAO,UAAAJ,EAAA,CAAU;AAAA,sBACjBK,GAAA,EAAO;AAAA,IACPP,KAAe,gBAAAJ,EAACY,GAAA,EAAa,UAAAR,EAAA,CAAY;AAAA,IAC1C,gBAAAJ,EAACa,KAAY,UAAAR,EAAA,CAAa;AAAA,IACzBC,MAAcJ,KAAYA;AAAA,EAAA,EAAA,CAC7B,EAAA,CACF;AAEJ;AAGO,SAASS,EAAO,EAAE,WAAAf,GAAW,GAAGC,KAAsB;AAC3D,QAAMC,IAAaC,EAAKH,GAAW,QAAQ;AAC3C,SACE,gBAAAI,EAAC,OAAA,EAAI,WAAWF,GAAa,GAAGD,GAC9B,UAAA,gBAAAG,EAAC,QAAA,EAAK,eAAY,QAAO,WAAU,cAAA,CAAc,GACnD;AAEJ;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../../../src/ui/primitives/Switch/Switch.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Description, FieldError, Label, SharedFieldProps } from \"primitives\";\nimport type React from \"react\";\nimport {\n Switch as RACSwitch,\n type SwitchProps as RACSwitchProps,\n} from \"react-aria-components\";\nimport \"./switch.css\";\n\nexport type SwitchGroupProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function SwitchGroup({ className, ...props }: SwitchGroupProps) {\n const classNames = clsx(className, \"switch-group\");\n return <div {...props} className={classNames} />;\n}\n\nexport type SwitchFieldProps = RACSwitchProps & SharedFieldProps;\nexport function SwitchField({\n children,\n className,\n label,\n description,\n errorMessage,\n ...props\n}: SwitchFieldProps) {\n const classNames = clsx(className, \"switch-field\");\n const labelText: string | undefined =\n label || (typeof children === \"string\" ? children : undefined);\n return (\n <RACSwitch className={classNames} {...props}>\n <>\n <Label>{labelText}</Label>\n <Switch />\n {description && <Description>{description}</Description>}\n <FieldError>{errorMessage}</FieldError>\n {labelText !== children && children}\n </>\n </RACSwitch>\n );\n}\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\"div\">;\nexport function Switch({ className, ...props }: SwitchProps) {\n const classNames = clsx(className, \"sds-switch\");\n return (\n <div className={classNames} {...props}>\n <span aria-hidden=\"true\" className=\"switch-icon\" />\n </div>\n );\n}\n"],"names":["SwitchGroup","className","props","classNames","clsx","jsx","SwitchField","children","label","description","errorMessage","labelText","RACSwitch","jsxs","Fragment","Label","Switch","Description","FieldError"],"mappings":";;;;;AAUO,SAASA,EAAY,EAAE,WAAAC,GAAW,GAAGC,KAA2B;AACrE,QAAMC,IAAaC,EAAKH,GAAW,cAAc;AACjD,SAAO,gBAAAI,EAAC,OAAA,EAAK,GAAGH,GAAO,WAAWC,GAAY;AAChD;AAGO,SAASG,EAAY;AAAA,EAC1B,UAAAC;AAAA,EACA,WAAAN;AAAA,EACA,OAAAO;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGR;AACL,GAAqB;AACnB,QAAMC,IAAaC,EAAKH,GAAW,cAAc,GAC3CU,IACJH,MAAU,OAAOD,KAAa,WAAWA,IAAW;AACtD,2BACGK,GAAA,EAAU,WAAWT,GAAa,GAAGD,GACpC,UAAA,gBAAAW,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAT,EAACU,KAAO,UAAAJ,EAAA,CAAU;AAAA,sBACjBK,GAAA,EAAO;AAAA,IACPP,KAAe,gBAAAJ,EAACY,GAAA,EAAa,UAAAR,EAAA,CAAY;AAAA,IAC1C,gBAAAJ,EAACa,KAAY,UAAAR,EAAA,CAAa;AAAA,IACzBC,MAAcJ,KAAYA;AAAA,EAAA,EAAA,CAC7B,EAAA,CACF;AAEJ;AAGO,SAASS,EAAO,EAAE,WAAAf,GAAW,GAAGC,KAAsB;AAC3D,QAAMC,IAAaC,EAAKH,GAAW,YAAY;AAC/C,SACE,gBAAAI,EAAC,OAAA,EAAI,WAAWF,GAAa,GAAGD,GAC9B,UAAA,gBAAAG,EAAC,QAAA,EAAK,eAAY,QAAO,WAAU,cAAA,CAAc,GACnD;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../vendor/clsx/dist/clsx.cjs"),l=require("react-aria-components");;/* empty css */const m=require("../../icons/IconChevronUp.cjs"),h=require("../../icons/IconChevronDown.cjs"),u=require("../Checkbox/Checkbox.cjs");function j({bleed:s=!1,dense:a=!1,grid:n=!1,striped:c=!1,className:t,...o}){const i=r.clsx(t,"table-container",s&&"table-container-bleed"),b=r.clsx("table",s&&"table-bleed",a&&"table-dense",n&&"table-grid",c&&"table-striped");return e.jsx("div",{className:i,children:e.jsx(l.Table,{className:b,...o})})}function x({align:s="start",className:a,...n}){const c=r.clsx(a,"table-column",`table-align-${s}`);return e.jsx(l.Column,{className:c,...n,children:({allowsSorting:t,sortDirection:o})=>e.jsx("div",{className:r.clsx("table-column-inner"),children:e.jsxs(e.Fragment,{children:[n.children,t&&e.jsx("span",{"aria-hidden":"true",className:"sort-indicator",children:o==="ascending"?e.jsx(m.IconChevronUp,{}):e.jsx(h.IconChevronDown,{})})]})})})}function C({className:s,...a}){return e.jsx(l.TableBody,{...a})}function N({className:s,columns:a,children:n,...c}){const{selectionBehavior:t,selectionMode:o,allowsDragging:i}=l.useTableOptions(),b=r.clsx(s,"table-head");return e.jsxs(l.TableHeader,{className:b,...c,children:[i&&e.jsx(x,{}),t==="toggle"&&e.jsx(x,{className:"table-selection-col",children:o==="multiple"&&e.jsx(l.Checkbox,{slot:"selection",className:"table-selection-checkbox",children:e.jsx(u.Checkbox,{})})}),e.jsx(l.Collection,{items:a,children:n})]})}function g({id:s,columns:a,children:n,className:c,...t}){const{selectionBehavior:o,allowsDragging:i}=l.useTableOptions(),b=r.clsx(c,"table-row");return e.jsxs(l.Row,{id:s,...t,className:b,children:[i&&e.jsx(d,{children:e.jsx(l.Button,{slot:"drag",children:"≡"})}),o==="toggle"&&e.jsx(d,{className:"table-selection-cell",children:e.jsx(l.Checkbox,{slot:"selection",className:"table-selection-checkbox",children:e.jsx(u.Checkbox,{})})}),e.jsx(l.Collection,{items:a,children:n})]})}function d({align:s="start",className:a,...n}){const c=r.clsx(a,"table-cell",`table-align-${s}`);return e.jsx(l.Cell,{className:c,...n})}exports.Table=j;exports.TableBody=C;exports.TableCell=d;exports.TableColumn=x;exports.TableHead=N;exports.TableRow=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../vendor/clsx/dist/clsx.cjs"),s=require("react-aria-components");;/* empty css */const m=require("../../icons/IconChevronUp.cjs"),h=require("../../icons/IconChevronDown.cjs"),u=require("../Checkbox/Checkbox.cjs");function j({bleed:l=!1,dense:a=!1,grid:n=!1,striped:c=!1,className:t,...o}){const i=r.clsx(t,"table-container",l&&"table-container-bleed"),b=r.clsx("sds-table",l&&"table-bleed",a&&"table-dense",n&&"table-grid",c&&"sds-table-striped");return e.jsx("div",{className:i,children:e.jsx(s.Table,{className:b,...o})})}function x({align:l="start",className:a,...n}){const c=r.clsx(a,"table-column",`table-align-${l}`);return e.jsx(s.Column,{className:c,...n,children:({allowsSorting:t,sortDirection:o})=>e.jsx("div",{className:r.clsx("table-column-inner"),children:e.jsxs(e.Fragment,{children:[n.children,t&&e.jsx("span",{"aria-hidden":"true",className:"sort-indicator",children:o==="ascending"?e.jsx(m.IconChevronUp,{}):e.jsx(h.IconChevronDown,{})})]})})})}function C({className:l,...a}){return e.jsx(s.TableBody,{...a})}function N({className:l,columns:a,children:n,...c}){const{selectionBehavior:t,selectionMode:o,allowsDragging:i}=s.useTableOptions(),b=r.clsx(l,"table-head");return e.jsxs(s.TableHeader,{className:b,...c,children:[i&&e.jsx(x,{}),t==="toggle"&&e.jsx(x,{className:"table-selection-col",children:o==="multiple"&&e.jsx(s.Checkbox,{slot:"selection",className:"table-selection-checkbox",children:e.jsx(u.Checkbox,{})})}),e.jsx(s.Collection,{items:a,children:n})]})}function g({id:l,columns:a,children:n,className:c,...t}){const{selectionBehavior:o,allowsDragging:i}=s.useTableOptions(),b=r.clsx(c,"table-row");return e.jsxs(s.Row,{id:l,...t,className:b,children:[i&&e.jsx(d,{children:e.jsx(s.Button,{slot:"drag",children:"≡"})}),o==="toggle"&&e.jsx(d,{className:"table-selection-cell",children:e.jsx(s.Checkbox,{slot:"selection",className:"table-selection-checkbox",children:e.jsx(u.Checkbox,{})})}),e.jsx(s.Collection,{items:a,children:n})]})}function d({align:l="start",className:a,...n}){const c=r.clsx(a,"table-cell",`table-align-${l}`);return e.jsx(s.Cell,{className:c,...n})}exports.Table=j;exports.TableBody=C;exports.TableCell=d;exports.TableColumn=x;exports.TableHead=N;exports.TableRow=g;
2
2
  //# sourceMappingURL=Table.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.cjs","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconChevronDown, IconChevronUp } from \"icons\";\nimport { Checkbox } from \"primitives\";\nimport {\n Button as RACButton,\n Cell as RACCell,\n Checkbox as RACSelectionCheckbox,\n Collection as RACCollection,\n Column as RACColumn,\n Row as RACRow,\n Table as RACTable,\n TableBody as RACTableBody,\n TableHeader as RACTableHeader,\n useTableOptions,\n type CellProps as RACCellProps,\n type ColumnProps as RACColumnProps,\n type RowProps as RACRowProps,\n type TableBodyProps as RACTableBodyProps,\n type TableHeaderProps as RACTableHeaderProps,\n type TableProps as RACTableProps,\n} from \"react-aria-components\";\nimport \"./table.css\";\n\ntype TableAlign = \"start\" | \"center\" | \"right\";\n\nexport type TableProps = RACTableProps & {\n bleed?: boolean;\n dense?: boolean;\n grid?: boolean;\n striped?: boolean;\n};\nexport function Table({\n bleed = false,\n dense = false,\n grid = false,\n striped = false,\n className,\n ...props\n}: TableProps) {\n const containerClassNames = clsx(\n className,\n \"table-container\",\n bleed && \"table-container-bleed\",\n );\n const tableClassNames = clsx(\n \"table\",\n bleed && \"table-bleed\",\n dense && \"table-dense\",\n grid && \"table-grid\",\n striped && \"table-striped\",\n );\n return (\n <div className={containerClassNames}>\n <RACTable className={tableClassNames} {...props} />\n </div>\n );\n}\n\nexport type TableColumnProps = RACColumnProps & {\n align?: TableAlign;\n};\nexport function TableColumn({\n align = \"start\",\n className,\n ...props\n}: TableColumnProps) {\n const classNames = clsx(className, \"table-column\", `table-align-${align}`);\n return (\n <RACColumn className={classNames} {...props}>\n {({ allowsSorting, sortDirection }) => (\n <div className={clsx(\"table-column-inner\")}>\n <>\n {props.children}\n {allowsSorting && (\n <span aria-hidden=\"true\" className=\"sort-indicator\">\n {sortDirection === \"ascending\" ? (\n <IconChevronUp />\n ) : (\n <IconChevronDown />\n )}\n </span>\n )}\n </>\n </div>\n )}\n </RACColumn>\n );\n}\n\nexport type TableBodyProps<T> = RACTableBodyProps<T>;\nexport function TableBody<T extends object>({\n className,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody {...props} />;\n}\n\nexport type TableHeadProps<T> = RACTableHeaderProps<T>;\nexport function TableHead<T extends object>({\n className,\n columns,\n children,\n ...props\n}: TableHeadProps<T>) {\n const { selectionBehavior, selectionMode, allowsDragging } =\n useTableOptions();\n const classNames = clsx(className, \"table-head\");\n return (\n <RACTableHeader className={classNames} {...props}>\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <TableColumn />}\n {selectionBehavior === \"toggle\" && (\n <TableColumn className=\"table-selection-col\">\n {selectionMode === \"multiple\" && (\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n )}\n </TableColumn>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACTableHeader>\n );\n}\n\nexport type TableRowProps<T> = RACRowProps<T>;\nexport function TableRow<T extends object>({\n id,\n columns,\n children,\n className,\n ...otherProps\n}: TableRowProps<T>) {\n const { selectionBehavior, allowsDragging } = useTableOptions();\n const classNames = clsx(className, \"table-row\");\n return (\n <RACRow id={id} {...otherProps} className={classNames}>\n {allowsDragging && (\n <TableCell>\n <RACButton slot=\"drag\">≡</RACButton>\n </TableCell>\n )}\n {selectionBehavior === \"toggle\" && (\n <TableCell className=\"table-selection-cell\">\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n </TableCell>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACRow>\n );\n}\n\nexport type TableCellProps = RACCellProps & { align?: TableAlign };\nexport function TableCell({\n align = \"start\",\n className,\n ...props\n}: TableCellProps) {\n const classNames = clsx(className, \"table-cell\", `table-align-${align}`);\n return <RACCell className={classNames} {...props} />;\n}\n"],"names":["Table","bleed","dense","grid","striped","className","props","containerClassNames","clsx","tableClassNames","jsx","RACTable","TableColumn","align","classNames","RACColumn","allowsSorting","sortDirection","jsxs","Fragment","IconChevronUp","IconChevronDown","TableBody","RACTableBody","TableHead","columns","children","selectionBehavior","selectionMode","allowsDragging","useTableOptions","RACTableHeader","RACSelectionCheckbox","Checkbox","RACCollection","TableRow","id","otherProps","RACRow","TableCell","RACButton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AA,KAAKH,EAAW,aAAc,eAAeQ,CAAK,EAAE,EACvE,OAAOH,EAAAA,IAAC+B,EAAAA,KAAA,CAAQ,UAAW3B,EAAa,GAAGR,EAAO,CACpD"}
1
+ {"version":3,"file":"Table.cjs","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconChevronDown, IconChevronUp } from \"icons\";\nimport { Checkbox } from \"primitives\";\nimport {\n Button as RACButton,\n Cell as RACCell,\n Checkbox as RACSelectionCheckbox,\n Collection as RACCollection,\n Column as RACColumn,\n Row as RACRow,\n Table as RACTable,\n TableBody as RACTableBody,\n TableHeader as RACTableHeader,\n useTableOptions,\n type CellProps as RACCellProps,\n type ColumnProps as RACColumnProps,\n type RowProps as RACRowProps,\n type TableBodyProps as RACTableBodyProps,\n type TableHeaderProps as RACTableHeaderProps,\n type TableProps as RACTableProps,\n} from \"react-aria-components\";\nimport \"./table.css\";\n\ntype TableAlign = \"start\" | \"center\" | \"right\";\n\nexport type TableProps = RACTableProps & {\n bleed?: boolean;\n dense?: boolean;\n grid?: boolean;\n striped?: boolean;\n};\nexport function Table({\n bleed = false,\n dense = false,\n grid = false,\n striped = false,\n className,\n ...props\n}: TableProps) {\n const containerClassNames = clsx(\n className,\n \"table-container\",\n bleed && \"table-container-bleed\",\n );\n const tableClassNames = clsx(\n \"sds-table\",\n bleed && \"table-bleed\",\n dense && \"table-dense\",\n grid && \"table-grid\",\n striped && \"sds-table-striped\",\n );\n return (\n <div className={containerClassNames}>\n <RACTable className={tableClassNames} {...props} />\n </div>\n );\n}\n\nexport type TableColumnProps = RACColumnProps & {\n align?: TableAlign;\n};\nexport function TableColumn({\n align = \"start\",\n className,\n ...props\n}: TableColumnProps) {\n const classNames = clsx(className, \"table-column\", `table-align-${align}`);\n return (\n <RACColumn className={classNames} {...props}>\n {({ allowsSorting, sortDirection }) => (\n <div className={clsx(\"table-column-inner\")}>\n <>\n {props.children}\n {allowsSorting && (\n <span aria-hidden=\"true\" className=\"sort-indicator\">\n {sortDirection === \"ascending\" ? (\n <IconChevronUp />\n ) : (\n <IconChevronDown />\n )}\n </span>\n )}\n </>\n </div>\n )}\n </RACColumn>\n );\n}\n\nexport type TableBodyProps<T> = RACTableBodyProps<T>;\nexport function TableBody<T extends object>({\n className,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody {...props} />;\n}\n\nexport type TableHeadProps<T> = RACTableHeaderProps<T>;\nexport function TableHead<T extends object>({\n className,\n columns,\n children,\n ...props\n}: TableHeadProps<T>) {\n const { selectionBehavior, selectionMode, allowsDragging } =\n useTableOptions();\n const classNames = clsx(className, \"table-head\");\n return (\n <RACTableHeader className={classNames} {...props}>\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <TableColumn />}\n {selectionBehavior === \"toggle\" && (\n <TableColumn className=\"table-selection-col\">\n {selectionMode === \"multiple\" && (\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n )}\n </TableColumn>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACTableHeader>\n );\n}\n\nexport type TableRowProps<T> = RACRowProps<T>;\nexport function TableRow<T extends object>({\n id,\n columns,\n children,\n className,\n ...otherProps\n}: TableRowProps<T>) {\n const { selectionBehavior, allowsDragging } = useTableOptions();\n const classNames = clsx(className, \"table-row\");\n return (\n <RACRow id={id} {...otherProps} className={classNames}>\n {allowsDragging && (\n <TableCell>\n <RACButton slot=\"drag\">≡</RACButton>\n </TableCell>\n )}\n {selectionBehavior === \"toggle\" && (\n <TableCell className=\"table-selection-cell\">\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n </TableCell>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACRow>\n );\n}\n\nexport type TableCellProps = RACCellProps & { align?: TableAlign };\nexport function TableCell({\n align = \"start\",\n className,\n ...props\n}: TableCellProps) {\n const classNames = clsx(className, \"table-cell\", `table-align-${align}`);\n return <RACCell className={classNames} {...props} />;\n}\n"],"names":["Table","bleed","dense","grid","striped","className","props","containerClassNames","clsx","tableClassNames","jsx","RACTable","TableColumn","align","classNames","RACColumn","allowsSorting","sortDirection","jsxs","Fragment","IconChevronUp","IconChevronDown","TableBody","RACTableBody","TableHead","columns","children","selectionBehavior","selectionMode","allowsDragging","useTableOptions","RACTableHeader","RACSelectionCheckbox","Checkbox","RACCollection","TableRow","id","otherProps","RACRow","TableCell","RACButton","RACCell"],"mappings":"uWA+BO,SAASA,EAAM,CACpB,MAAAC,EAAQ,GACR,MAAAC,EAAQ,GACR,KAAAC,EAAO,GACP,QAAAC,EAAU,GACV,UAAAC,EACA,GAAGC,CACL,EAAe,CACb,MAAMC,EAAsBC,EAAAA,KAC1BH,EACA,kBACAJ,GAAS,uBAAA,EAELQ,EAAkBD,EAAAA,KACtB,YACAP,GAAS,cACTC,GAAS,cACTC,GAAQ,aACRC,GAAW,mBAAA,EAEb,OACEM,EAAAA,IAAC,MAAA,CAAI,UAAWH,EACd,SAAAG,EAAAA,IAACC,EAAAA,OAAS,UAAWF,EAAkB,GAAGH,CAAA,CAAO,CAAA,CACnD,CAEJ,CAKO,SAASM,EAAY,CAC1B,MAAAC,EAAQ,QACR,UAAAR,EACA,GAAGC,CACL,EAAqB,CACnB,MAAMQ,EAAaN,EAAAA,KAAKH,EAAW,eAAgB,eAAeQ,CAAK,EAAE,EACzE,aACGE,SAAA,CAAU,UAAWD,EAAa,GAAGR,EACnC,SAAA,CAAC,CAAE,cAAAU,EAAe,cAAAC,CAAA,IACjBP,EAAAA,IAAC,MAAA,CAAI,UAAWF,OAAK,oBAAoB,EACvC,SAAAU,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAAb,EAAM,SACNU,GACCN,EAAAA,IAAC,OAAA,CAAK,cAAY,OAAO,UAAU,iBAChC,SAAAO,IAAkB,YACjBP,EAAAA,IAACU,gBAAA,CAAA,CAAc,EAEfV,MAAC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ACnB,SAAA7B,EAAAA,IAACsB,EAAAA,SAAA,CAAqB,KAAK,YAAY,UAAU,2BAC/C,SAAAtB,EAAAA,IAACuB,WAAA,CAAA,CAAS,EACZ,EACF,EAEFvB,EAAAA,IAACwB,EAAAA,WAAA,CAAc,MAAOT,EAAU,SAAAC,CAAA,CAAS,CAAA,EAC3C,CAEJ,CAGO,SAASa,EAAU,CACxB,MAAA1B,EAAQ,QACR,UAAAR,EACA,GAAGC,CACL,EAAmB,CACjB,MAAMQ,EAAaN,EAAAA,KAAKH,EAAW,aAAc,eAAeQ,CAAK,EAAE,EACvE,OAAOH,EAAAA,IAAC+B,EAAAA,KAAA,CAAQ,UAAW3B,EAAa,GAAGR,EAAO,CACpD"}
@@ -18,11 +18,11 @@ function M({
18
18
  "table-container",
19
19
  l && "table-container-bleed"
20
20
  ), i = c(
21
- "table",
21
+ "sds-table",
22
22
  l && "table-bleed",
23
23
  a && "table-dense",
24
24
  s && "table-grid",
25
- n && "table-striped"
25
+ n && "sds-table-striped"
26
26
  );
27
27
  return /* @__PURE__ */ e("div", { className: r, children: /* @__PURE__ */ e(C, { className: i, ...o }) });
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconChevronDown, IconChevronUp } from \"icons\";\nimport { Checkbox } from \"primitives\";\nimport {\n Button as RACButton,\n Cell as RACCell,\n Checkbox as RACSelectionCheckbox,\n Collection as RACCollection,\n Column as RACColumn,\n Row as RACRow,\n Table as RACTable,\n TableBody as RACTableBody,\n TableHeader as RACTableHeader,\n useTableOptions,\n type CellProps as RACCellProps,\n type ColumnProps as RACColumnProps,\n type RowProps as RACRowProps,\n type TableBodyProps as RACTableBodyProps,\n type TableHeaderProps as RACTableHeaderProps,\n type TableProps as RACTableProps,\n} from \"react-aria-components\";\nimport \"./table.css\";\n\ntype TableAlign = \"start\" | \"center\" | \"right\";\n\nexport type TableProps = RACTableProps & {\n bleed?: boolean;\n dense?: boolean;\n grid?: boolean;\n striped?: boolean;\n};\nexport function Table({\n bleed = false,\n dense = false,\n grid = false,\n striped = false,\n className,\n ...props\n}: TableProps) {\n const containerClassNames = clsx(\n className,\n \"table-container\",\n bleed && \"table-container-bleed\",\n );\n const tableClassNames = clsx(\n \"table\",\n bleed && \"table-bleed\",\n dense && \"table-dense\",\n grid && \"table-grid\",\n striped && \"table-striped\",\n );\n return (\n <div className={containerClassNames}>\n <RACTable className={tableClassNames} {...props} />\n </div>\n );\n}\n\nexport type TableColumnProps = RACColumnProps & {\n align?: TableAlign;\n};\nexport function TableColumn({\n align = \"start\",\n className,\n ...props\n}: TableColumnProps) {\n const classNames = clsx(className, \"table-column\", `table-align-${align}`);\n return (\n <RACColumn className={classNames} {...props}>\n {({ allowsSorting, sortDirection }) => (\n <div className={clsx(\"table-column-inner\")}>\n <>\n {props.children}\n {allowsSorting && (\n <span aria-hidden=\"true\" className=\"sort-indicator\">\n {sortDirection === \"ascending\" ? (\n <IconChevronUp />\n ) : (\n <IconChevronDown />\n )}\n </span>\n )}\n </>\n </div>\n )}\n </RACColumn>\n );\n}\n\nexport type TableBodyProps<T> = RACTableBodyProps<T>;\nexport function TableBody<T extends object>({\n className,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody {...props} />;\n}\n\nexport type TableHeadProps<T> = RACTableHeaderProps<T>;\nexport function TableHead<T extends object>({\n className,\n columns,\n children,\n ...props\n}: TableHeadProps<T>) {\n const { selectionBehavior, selectionMode, allowsDragging } =\n useTableOptions();\n const classNames = clsx(className, \"table-head\");\n return (\n <RACTableHeader className={classNames} {...props}>\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <TableColumn />}\n {selectionBehavior === \"toggle\" && (\n <TableColumn className=\"table-selection-col\">\n {selectionMode === \"multiple\" && (\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n )}\n </TableColumn>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACTableHeader>\n );\n}\n\nexport type TableRowProps<T> = RACRowProps<T>;\nexport function TableRow<T extends object>({\n id,\n columns,\n children,\n className,\n ...otherProps\n}: TableRowProps<T>) {\n const { selectionBehavior, allowsDragging } = useTableOptions();\n const classNames = clsx(className, \"table-row\");\n return (\n <RACRow id={id} {...otherProps} className={classNames}>\n {allowsDragging && (\n <TableCell>\n <RACButton slot=\"drag\">≡</RACButton>\n </TableCell>\n )}\n {selectionBehavior === \"toggle\" && (\n <TableCell className=\"table-selection-cell\">\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n </TableCell>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACRow>\n );\n}\n\nexport type TableCellProps = RACCellProps & { align?: TableAlign };\nexport function TableCell({\n align = \"start\",\n className,\n ...props\n}: TableCellProps) {\n const classNames = clsx(className, \"table-cell\", `table-align-${align}`);\n return <RACCell className={classNames} {...props} />;\n}\n"],"names":["Table","bleed","dense","grid","striped","className","props","containerClassNames","clsx","tableClassNames","jsx","RACTable","TableColumn","align","classNames","RACColumn","allowsSorting","sortDirection","jsxs","Fragment","IconChevronUp","IconChevronDown","TableBody","RACTableBody","TableHead","columns","children","selectionBehavior","selectionMode","allowsDragging","useTableOptions","RACTableHeader","RACSelectionCheckbox","Checkbox","RACCollection","TableRow","id","otherProps","RACRow","TableCell","RACButton","RACCell"],"mappings":";;;;;;;AA+BO,SAASA,EAAM;AAAA,EACpB,OAAAC,IAAQ;AAAA,EACR,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,GAAGC;AACL,GAAe;AACb,QAAMC,IAAsBC;AAAA,IAC1BH;AAAA,IACA;AAAA,IACAJ,KAAS;AAAA,EAAA,GAELQ,IAAkBD;AAAA,IACtB;AAAA,IACAP,KAAS;AAAA,IACTC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../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconChevronDown, IconChevronUp } from \"icons\";\nimport { Checkbox } from \"primitives\";\nimport {\n Button as RACButton,\n Cell as RACCell,\n Checkbox as RACSelectionCheckbox,\n Collection as RACCollection,\n Column as RACColumn,\n Row as RACRow,\n Table as RACTable,\n TableBody as RACTableBody,\n TableHeader as RACTableHeader,\n useTableOptions,\n type CellProps as RACCellProps,\n type ColumnProps as RACColumnProps,\n type RowProps as RACRowProps,\n type TableBodyProps as RACTableBodyProps,\n type TableHeaderProps as RACTableHeaderProps,\n type TableProps as RACTableProps,\n} from \"react-aria-components\";\nimport \"./table.css\";\n\ntype TableAlign = \"start\" | \"center\" | \"right\";\n\nexport type TableProps = RACTableProps & {\n bleed?: boolean;\n dense?: boolean;\n grid?: boolean;\n striped?: boolean;\n};\nexport function Table({\n bleed = false,\n dense = false,\n grid = false,\n striped = false,\n className,\n ...props\n}: TableProps) {\n const containerClassNames = clsx(\n className,\n \"table-container\",\n bleed && \"table-container-bleed\",\n );\n const tableClassNames = clsx(\n \"sds-table\",\n bleed && \"table-bleed\",\n dense && \"table-dense\",\n grid && \"table-grid\",\n striped && \"sds-table-striped\",\n );\n return (\n <div className={containerClassNames}>\n <RACTable className={tableClassNames} {...props} />\n </div>\n );\n}\n\nexport type TableColumnProps = RACColumnProps & {\n align?: TableAlign;\n};\nexport function TableColumn({\n align = \"start\",\n className,\n ...props\n}: TableColumnProps) {\n const classNames = clsx(className, \"table-column\", `table-align-${align}`);\n return (\n <RACColumn className={classNames} {...props}>\n {({ allowsSorting, sortDirection }) => (\n <div className={clsx(\"table-column-inner\")}>\n <>\n {props.children}\n {allowsSorting && (\n <span aria-hidden=\"true\" className=\"sort-indicator\">\n {sortDirection === \"ascending\" ? (\n <IconChevronUp />\n ) : (\n <IconChevronDown />\n )}\n </span>\n )}\n </>\n </div>\n )}\n </RACColumn>\n );\n}\n\nexport type TableBodyProps<T> = RACTableBodyProps<T>;\nexport function TableBody<T extends object>({\n className,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody {...props} />;\n}\n\nexport type TableHeadProps<T> = RACTableHeaderProps<T>;\nexport function TableHead<T extends object>({\n className,\n columns,\n children,\n ...props\n}: TableHeadProps<T>) {\n const { selectionBehavior, selectionMode, allowsDragging } =\n useTableOptions();\n const classNames = clsx(className, \"table-head\");\n return (\n <RACTableHeader className={classNames} {...props}>\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <TableColumn />}\n {selectionBehavior === \"toggle\" && (\n <TableColumn className=\"table-selection-col\">\n {selectionMode === \"multiple\" && (\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n )}\n </TableColumn>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACTableHeader>\n );\n}\n\nexport type TableRowProps<T> = RACRowProps<T>;\nexport function TableRow<T extends object>({\n id,\n columns,\n children,\n className,\n ...otherProps\n}: TableRowProps<T>) {\n const { selectionBehavior, allowsDragging } = useTableOptions();\n const classNames = clsx(className, \"table-row\");\n return (\n <RACRow id={id} {...otherProps} className={classNames}>\n {allowsDragging && (\n <TableCell>\n <RACButton slot=\"drag\">≡</RACButton>\n </TableCell>\n )}\n {selectionBehavior === \"toggle\" && (\n <TableCell className=\"table-selection-cell\">\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n </TableCell>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACRow>\n );\n}\n\nexport type TableCellProps = RACCellProps & { align?: TableAlign };\nexport function TableCell({\n align = \"start\",\n className,\n ...props\n}: TableCellProps) {\n const classNames = clsx(className, \"table-cell\", `table-align-${align}`);\n return <RACCell className={classNames} {...props} />;\n}\n"],"names":["Table","bleed","dense","grid","striped","className","props","containerClassNames","clsx","tableClassNames","jsx","RACTable","TableColumn","align","classNames","RACColumn","allowsSorting","sortDirection","jsxs","Fragment","IconChevronUp","IconChevronDown","TableBody","RACTableBody","TableHead","columns","children","selectionBehavior","selectionMode","allowsDragging","useTableOptions","RACTableHeader","RACSelectionCheckbox","Checkbox","RACCollection","TableRow","id","otherProps","RACRow","TableCell","RACButton","RACCell"],"mappings":";;;;;;;AA+BO,SAASA,EAAM;AAAA,EACpB,OAAAC,IAAQ;AAAA,EACR,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,GAAGC;AACL,GAAe;AACb,QAAMC,IAAsBC;AAAA,IAC1BH;AAAA,IACA;AAAA,IACAJ,KAAS;AAAA,EAAA,GAELQ,IAAkBD;AAAA,IACtB;AAAA,IACAP,KAAS;AAAA,IACTC,KAAS;AAAA,IACTC,KAAQ;AAAA,IACRC,KAAW;AAAA,EAAA;AAEb,SACE,gBAAAM,EAAC,OAAA,EAAI,WAAWH,GACd,UAAA,gBAAAG,EAACC,KAAS,WAAWF,GAAkB,GAAGH,EAAA,CAAO,EAAA,CACnD;AAEJ;AAKO,SAASM,EAAY;AAAA,EAC1B,OAAAC,IAAQ;AAAA,EACR,WAAAR;AAAA,EACA,GAAGC;AACL,GAAqB;AACnB,QAAMQ,IAAaN,EAAKH,GAAW,gBAAgB,eAAeQ,CAAK,EAAE;AACzE,2BACGE,GAAA,EAAU,WAAWD,GAAa,GAAGR,GACnC,UAAA,CAAC,EAAE,eAAAU,GAAe,eAAAC,EAAA,MACjB,gBAAAP,EAAC,OAAA,EAAI,WAAWF,EAAK,oBAAoB,GACvC,UAAA,gBAAAU,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAb,EAAM;AAAA,IACNU,KACC,gBAAAN,EAAC,QAAA,EAAK,eAAY,QAAO,WAAU,kBAChC,UAAAO,MAAkB,cACjB,gBAAAP,EAACU,GAAA,CAAA,CAAc,IAEf,gBAAAV,EAACW,KAAgB,EAAA,CAErB;AAAA,EAAA,EAAA,CAEJ,GACF,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BACnB,UAAA,gBAAA7B,EAACsB,GAAA,EAAqB,MAAK,aAAY,WAAU,4BAC/C,UAAA,gBAAAtB,EAACuB,GAAA,CAAA,CAAS,GACZ,GACF;AAAA,IAEF,gBAAAvB,EAACwB,GAAA,EAAc,OAAOT,GAAU,UAAAC,EAAA,CAAS;AAAA,EAAA,GAC3C;AAEJ;AAGO,SAASa,EAAU;AAAA,EACxB,OAAA1B,IAAQ;AAAA,EACR,WAAAR;AAAA,EACA,GAAGC;AACL,GAAmB;AACjB,QAAMQ,IAAaN,EAAKH,GAAW,cAAc,eAAeQ,CAAK,EAAE;AACvE,SAAO,gBAAAH,EAAC+B,GAAA,EAAQ,WAAW3B,GAAa,GAAGR,GAAO;AACpD;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),r=require("../../../vendor/clsx/dist/clsx.cjs"),i=require("react-aria-components");;/* empty css */const y=require("../Link/Link.cjs"),m=require("../../layout/Flex/Flex.cjs"),f=require("../../hooks/useMediaQuery.cjs");function b({className:s,elementType:n="p",lineHeight:t="body",lineClamp:e,style:x,...a}){const l=r.clsx(s,!!e&&"text-truncate","text-body-base",`text-line-height-${t}`),o=e?{"--text-truncate-line-clamp":e,...x}:x;return c.jsx(i.Text,{style:o,elementType:n,className:l,...a})}function d({className:s,elementType:n="small",lineHeight:t="body",lineClamp:e,style:x,...a}){const l=r.clsx(s,!!e&&"text-truncate","text-body-small",`text-line-height-${t}`),o=e?{"--text-truncate-line-clamp":e,...x}:x;return c.jsx(i.Text,{style:o,className:l,elementType:n,...a})}function p({className:s,elementType:n="small",lineClamp:t,lineHeight:e="body",style:x,...a}){const l=r.clsx(s,!!t&&"text-truncate","text-body-small-strong",`text-line-height-${e}`),o=t?{"--text-truncate-line-clamp":t,...x}:x;return c.jsx(i.Text,{style:o,className:l,elementType:n,...a})}function L({className:s,elementType:n="strong",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"text-truncate","text-body-strong"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function $({className:s,elementType:n,...t}){const e=r.clsx(s,"text-body-emphasis");return c.jsx(i.Text,{className:e,elementType:n,...t})}function k({className:s,...n}){const t=r.clsx(s,"text-body-link");return c.jsx(y.Link,{className:t,...n})}function q({className:s,...n}){const t=r.clsx(s,"text-body-code");return c.jsx(i.Text,{className:t,...n})}function H({className:s,...n}){const t=r.clsx(s,"text-input");return c.jsx(i.Text,{className:t,...n})}function N({className:s,elementType:n="h1",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"text-truncate","text-title-hero"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function u({className:s,elementType:n="h2",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"text-truncate","text-title-page"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function h({className:s,elementType:n="p",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"text-truncate","text-subtitle"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function T({className:s,elementType:n="h3",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"text-truncate","text-heading"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function j({className:s,elementType:n="p",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"text-truncate","text-subheading"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function P({className:s,currency:n,size:t="large",price:e,label:x,...a}){const l=r.clsx(s,"text-price",`text-price-size-${t}`),o=c.jsxs(c.Fragment,{children:[c.jsx("sup",{className:"text-price-currency",children:n}),e]});return c.jsxs(i.Text,{elementType:"p",className:l,...a,children:[t==="small"?c.jsx(T,{elementType:"span",children:o}):c.jsx(u,{elementType:"span",children:o}),x&&c.jsx(d,{children:x})]})}function S({className:s,...n}){const t=r.clsx(s,"text-list-item");return c.jsx("li",{className:t,...n})}function g({children:s,className:n,density:t="default",title:e,...x}){const a=r.clsx(n,"text-list",`text-list-density-${t}`);return c.jsxs("ul",{className:a,...x,children:[e&&c.jsx("li",{className:"text-list-title",children:e}),s]})}function F({className:s,...n}){const t=r.clsx(s,"text-link-list");return c.jsx(g,{className:t,...n})}function I({align:s="start",className:n,heading:t,subheading:e,...x}){const a=r.clsx(n,"text-content-heading",`text-align-${s}`);return c.jsxs(m.Flex,{direction:"column",gap:"200",className:a,...x,children:[c.jsx(T,{children:t}),e&&c.jsx(j,{children:e})]})}function M({align:s="start",className:n,title:t,subtitle:e,...x}){const a=r.clsx(n,"text-content-title"),{isMobile:l}=f.useMediaQuery();return c.jsxs(m.Flex,{direction:"column",gap:"200",className:a,...x,children:[l?c.jsx(u,{className:`text-align-${s}`,children:t}):c.jsx(N,{className:`text-align-${s}`,children:t}),e&&c.jsx(h,{className:`text-align-${s}`,children:e})]})}exports.Text=b;exports.TextCode=q;exports.TextContentHeading=I;exports.TextContentTitle=M;exports.TextEmphasis=$;exports.TextHeading=T;exports.TextInput=H;exports.TextLink=k;exports.TextLinkList=F;exports.TextList=g;exports.TextListItem=S;exports.TextPrice=P;exports.TextSmall=d;exports.TextSmallStrong=p;exports.TextStrong=L;exports.TextSubheading=j;exports.TextSubtitle=h;exports.TextTitleHero=N;exports.TextTitlePage=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),r=require("../../../vendor/clsx/dist/clsx.cjs"),i=require("react-aria-components");;/* empty css */const y=require("../Link/Link.cjs"),d=require("../../layout/Flex/Flex.cjs"),f=require("../../hooks/useMediaQuery.cjs");function b({className:s,elementType:n="p",lineHeight:t="body",lineClamp:e,style:x,...a}){const l=r.clsx(s,!!e&&"sds-text-truncate","text-body-base",`text-line-height-${t}`),o=e?{"--text-truncate-line-clamp":e,...x}:x;return c.jsx(i.Text,{style:o,elementType:n,className:l,...a})}function m({className:s,elementType:n="small",lineHeight:t="body",lineClamp:e,style:x,...a}){const l=r.clsx(s,!!e&&"sds-text-truncate","text-body-small",`text-line-height-${t}`),o=e?{"--text-truncate-line-clamp":e,...x}:x;return c.jsx(i.Text,{style:o,className:l,elementType:n,...a})}function p({className:s,elementType:n="small",lineClamp:t,lineHeight:e="body",style:x,...a}){const l=r.clsx(s,!!t&&"sds-text-truncate","text-body-small-strong",`text-line-height-${e}`),o=t?{"--text-truncate-line-clamp":t,...x}:x;return c.jsx(i.Text,{style:o,className:l,elementType:n,...a})}function L({className:s,elementType:n="strong",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"sds-text-truncate","text-body-strong"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function $({className:s,elementType:n,...t}){const e=r.clsx(s,"text-body-emphasis");return c.jsx(i.Text,{className:e,elementType:n,...t})}function k({className:s,...n}){const t=r.clsx(s,"text-body-link");return c.jsx(y.Link,{className:t,...n})}function q({className:s,...n}){const t=r.clsx(s,"text-body-code");return c.jsx(i.Text,{className:t,...n})}function H({className:s,...n}){const t=r.clsx(s,"text-input");return c.jsx(i.Text,{className:t,...n})}function N({className:s,elementType:n="h1",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"sds-text-truncate","text-title-hero"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function u({className:s,elementType:n="h2",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"sds-text-truncate","text-title-page"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function h({className:s,elementType:n="p",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"sds-text-truncate","text-subtitle"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function T({className:s,elementType:n="h3",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"sds-text-truncate","text-heading"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function j({className:s,elementType:n="p",lineClamp:t,style:e,...x}){const a=r.clsx(s,!!t&&"sds-text-truncate","text-subheading"),l=t?{"--text-truncate-line-clamp":t,...e}:e;return c.jsx(i.Text,{style:l,className:a,elementType:n,...x})}function P({className:s,currency:n,size:t="large",price:e,label:x,...a}){const l=r.clsx(s,"text-price",`text-price-size-${t}`),o=c.jsxs(c.Fragment,{children:[c.jsx("sup",{className:"text-price-currency",children:n}),e]});return c.jsxs(i.Text,{elementType:"p",className:l,...a,children:[t==="small"?c.jsx(T,{elementType:"span",children:o}):c.jsx(u,{elementType:"span",children:o}),x&&c.jsx(m,{children:x})]})}function S({className:s,...n}){const t=r.clsx(s,"text-list-item");return c.jsx("li",{className:t,...n})}function g({children:s,className:n,density:t="default",title:e,...x}){const a=r.clsx(n,"text-list",`text-list-density-${t}`);return c.jsxs("ul",{className:a,...x,children:[e&&c.jsx("li",{className:"text-list-title",children:e}),s]})}function F({className:s,...n}){const t=r.clsx(s,"text-link-list");return c.jsx(g,{className:t,...n})}function I({align:s="start",className:n,heading:t,subheading:e,...x}){const a=r.clsx(n,"text-content-heading",`text-align-${s}`);return c.jsxs(d.Flex,{direction:"column",gap:"200",className:a,...x,children:[c.jsx(T,{children:t}),e&&c.jsx(j,{children:e})]})}function M({align:s="start",className:n,title:t,subtitle:e,...x}){const a=r.clsx(n,"text-content-title"),{isMobile:l}=f.useMediaQuery();return c.jsxs(d.Flex,{direction:"column",gap:"200",className:a,...x,children:[l?c.jsx(u,{className:`text-align-${s}`,children:t}):c.jsx(N,{className:`text-align-${s}`,children:t}),e&&c.jsx(h,{className:`text-align-${s}`,children:e})]})}exports.Text=b;exports.TextCode=q;exports.TextContentHeading=I;exports.TextContentTitle=M;exports.TextEmphasis=$;exports.TextHeading=T;exports.TextInput=H;exports.TextLink=k;exports.TextLinkList=F;exports.TextList=g;exports.TextListItem=S;exports.TextPrice=P;exports.TextSmall=m;exports.TextSmallStrong=p;exports.TextStrong=L;exports.TextSubheading=j;exports.TextSubtitle=h;exports.TextTitleHero=N;exports.TextTitlePage=u;
2
2
  //# sourceMappingURL=Text.cjs.map