@caligo-ui/core 1.0.0 → 1.2.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 (226) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/README.md +6 -5
  3. package/agent/caligo.json +648 -41
  4. package/dist/css/Accordion.css +6 -0
  5. package/dist/css/AccordionSummary.css +2 -0
  6. package/dist/css/Alert.css +8 -0
  7. package/dist/css/AppBar.css +2 -0
  8. package/dist/css/Avatar.css +4 -0
  9. package/dist/css/AvatarGroup.css +6 -0
  10. package/dist/css/Badge.css +6 -0
  11. package/dist/css/Breadcrumb.css +2 -0
  12. package/dist/css/Breadcrumbs.css +2 -0
  13. package/dist/css/Button.css +2 -0
  14. package/dist/css/ButtonGroup.css +4 -0
  15. package/dist/css/Card.css +4 -0
  16. package/dist/css/Checkbox.css +2 -0
  17. package/dist/css/Chip.css +4 -0
  18. package/dist/css/CircularProgress.css +2 -0
  19. package/dist/css/Collapse.css +2 -0
  20. package/dist/css/Collapsible.css +8 -0
  21. package/dist/css/Container.css +2 -0
  22. package/dist/css/Dialog.css +2 -0
  23. package/dist/css/Divider.css +2 -0
  24. package/dist/css/Drawer.css +2 -0
  25. package/dist/css/ErrorPanel.css +6 -0
  26. package/dist/css/FormControl.css +2 -0
  27. package/dist/css/FormControlLabel.css +2 -0
  28. package/dist/css/FormGroup.css +2 -0
  29. package/dist/css/FormHelperText.css +2 -0
  30. package/dist/css/FormLabel.css +2 -0
  31. package/dist/css/Grid.css +2 -0
  32. package/dist/css/Icon.css +4 -0
  33. package/dist/css/IconButton.css +4 -0
  34. package/dist/css/InputAdornment.css +2 -0
  35. package/dist/css/InputBase.css +2 -0
  36. package/dist/css/InputGroup.css +12 -0
  37. package/dist/css/Label.css +2 -0
  38. package/dist/css/LicenseInfo.css +2 -0
  39. package/dist/css/LinearProgress.css +2 -0
  40. package/dist/css/Link.css +2 -0
  41. package/dist/css/List.css +2 -0
  42. package/dist/css/ListItem.css +6 -0
  43. package/dist/css/ListItemAvatar.css +2 -0
  44. package/dist/css/ListItemButton.css +2 -0
  45. package/dist/css/ListItemIcon.css +4 -0
  46. package/dist/css/ListItemText.css +4 -0
  47. package/dist/css/ListSubheader.css +2 -0
  48. package/dist/css/Menu.css +2 -0
  49. package/dist/css/MenuItem.css +2 -0
  50. package/dist/css/MenuList.css +6 -0
  51. package/dist/css/NotificationBadge.css +6 -0
  52. package/dist/css/Pagination.css +6 -0
  53. package/dist/css/PaginationItem.css +4 -0
  54. package/dist/css/Paper.css +2 -0
  55. package/dist/css/Popover.css +2 -0
  56. package/dist/css/PreviewCard.css +4 -0
  57. package/dist/css/Progress.css +4 -0
  58. package/dist/css/Radio.css +2 -0
  59. package/dist/css/RadioGroup.css +2 -0
  60. package/dist/css/ScrollArea.css +2 -0
  61. package/dist/css/Select.css +10 -0
  62. package/dist/css/Separator.css +2 -0
  63. package/dist/css/Sheet.css +2 -0
  64. package/dist/css/Skeleton.css +2 -0
  65. package/dist/css/Slider.css +2 -0
  66. package/dist/css/Snackbar.css +4 -0
  67. package/dist/css/SnackbarContent.css +2 -0
  68. package/dist/css/Spinner.css +2 -0
  69. package/dist/css/Stack.css +2 -0
  70. package/dist/css/Switch.css +2 -0
  71. package/dist/css/Tab.css +2 -0
  72. package/dist/css/Table.css +2 -0
  73. package/dist/css/TableBody.css +2 -0
  74. package/dist/css/TableCell.css +2 -0
  75. package/dist/css/TableContainer.css +2 -0
  76. package/dist/css/TableFooter.css +2 -0
  77. package/dist/css/TableHead.css +2 -0
  78. package/dist/css/TableRow.css +2 -0
  79. package/dist/css/TableSortLabel.css +2 -0
  80. package/dist/css/Tabs.css +2 -0
  81. package/dist/css/Tag.css +4 -0
  82. package/dist/css/TextField.css +10 -0
  83. package/dist/css/Toast.css +4 -0
  84. package/dist/css/ToggleButton.css +2 -0
  85. package/dist/css/ToggleButtonGroup.css +2 -0
  86. package/dist/css/ToggleGroup.css +2 -0
  87. package/dist/css/Toolbar.css +2 -0
  88. package/dist/css/Tooltip.css +2 -0
  89. package/dist/css/Typography.css +2 -0
  90. package/dist/css/VirtualList.css +2 -0
  91. package/dist/esm/Alert/Alert.css +1 -1
  92. package/dist/esm/Alert/Alert2.js +2 -0
  93. package/dist/esm/Alert/Alert2.js.map +1 -1
  94. package/dist/esm/Avatar/Avatar.css +1 -1
  95. package/dist/esm/Avatar/Avatar2.js +33 -39
  96. package/dist/esm/Avatar/Avatar2.js.map +1 -1
  97. package/dist/esm/Breadcrumbs/Breadcrumbs.css +1 -1
  98. package/dist/esm/Button/Button.css +1 -1
  99. package/dist/esm/Button/Button2.js +36 -36
  100. package/dist/esm/Button/Button2.js.map +1 -1
  101. package/dist/esm/Button/buttonClasses.js +1 -1
  102. package/dist/esm/Button/buttonClasses.js.map +1 -1
  103. package/dist/esm/Card/Card.css +1 -1
  104. package/dist/esm/Checkbox/Checkbox.css +1 -1
  105. package/dist/esm/Chip/Chip.css +1 -1
  106. package/dist/esm/Chip/Chip2.js +30 -53
  107. package/dist/esm/Chip/Chip2.js.map +1 -1
  108. package/dist/esm/Dialog/Dialog.css +1 -1
  109. package/dist/esm/Dialog/Dialog2.js.map +1 -1
  110. package/dist/esm/Drawer/Drawer.css +1 -1
  111. package/dist/esm/FormLabel/FormLabel.css +1 -1
  112. package/dist/esm/IconButton/IconButton.css +1 -1
  113. package/dist/esm/IconButton/IconButton2.js +9 -8
  114. package/dist/esm/IconButton/IconButton2.js.map +1 -1
  115. package/dist/esm/InputBase/InputBase.js +52 -0
  116. package/dist/esm/InputBase/InputBase.js.map +1 -0
  117. package/dist/esm/InputBase/index.js +1 -0
  118. package/dist/esm/List/List.css +1 -1
  119. package/dist/esm/Menu/Menu.css +1 -1
  120. package/dist/esm/MenuItem/MenuItem.css +1 -1
  121. package/dist/esm/Paper/Paper.css +1 -1
  122. package/dist/esm/Popover/Popover.css +1 -1
  123. package/dist/esm/Radio/Radio.css +1 -1
  124. package/dist/esm/Radio/Radio2.js +74 -45
  125. package/dist/esm/Radio/Radio2.js.map +1 -1
  126. package/dist/esm/RadioGroup/RadioGroup.js +29 -22
  127. package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
  128. package/dist/esm/RadioGroup/radioGroupContext.js.map +1 -1
  129. package/dist/esm/ScrollArea/ScrollArea.css +1 -0
  130. package/dist/esm/ScrollArea/ScrollArea2.js +25 -0
  131. package/dist/esm/ScrollArea/ScrollArea2.js.map +1 -0
  132. package/dist/esm/ScrollArea/index.js +1 -0
  133. package/dist/esm/Select/Select.css +1 -1
  134. package/dist/esm/Snackbar/Snackbar.css +1 -1
  135. package/dist/esm/Switch/Switch.css +1 -1
  136. package/dist/esm/Switch/Switch2.js +47 -42
  137. package/dist/esm/Switch/Switch2.js.map +1 -1
  138. package/dist/esm/Tab/Tab.css +1 -1
  139. package/dist/esm/Tab/Tab2.js +29 -24
  140. package/dist/esm/Tab/Tab2.js.map +1 -1
  141. package/dist/esm/Table/Table.css +1 -1
  142. package/dist/esm/TableCell/TableCell.js +6 -6
  143. package/dist/esm/TableCell/TableCell.js.map +1 -1
  144. package/dist/esm/Tabs/Tabs.css +1 -1
  145. package/dist/esm/TextField/TextField.css +1 -1
  146. package/dist/esm/TextField/TextField2.js +106 -86
  147. package/dist/esm/TextField/TextField2.js.map +1 -1
  148. package/dist/esm/TextField/textFieldClasses.js +2 -0
  149. package/dist/esm/TextField/textFieldClasses.js.map +1 -1
  150. package/dist/esm/ToggleButton/ToggleButton.css +1 -1
  151. package/dist/esm/Toolbar/Toolbar.css +1 -1
  152. package/dist/esm/Tooltip/Tooltip.css +1 -1
  153. package/dist/esm/Tooltip/Tooltip2.js +50 -33
  154. package/dist/esm/Tooltip/Tooltip2.js.map +1 -1
  155. package/dist/esm/Typography/Typography.css +1 -1
  156. package/dist/esm/caligo.css +1 -1
  157. package/dist/esm/index.js +65 -63
  158. package/dist/esm/internal/glyphs.js +5 -0
  159. package/dist/esm/internal/glyphs.js.map +1 -1
  160. package/dist/esm/internal/hues.js +23 -0
  161. package/dist/esm/internal/hues.js.map +1 -0
  162. package/dist/esm/internal/inputEvent.js +22 -0
  163. package/dist/esm/internal/inputEvent.js.map +1 -0
  164. package/dist/esm/internal/releaseInfo.js +1 -1
  165. package/dist/esm/internal/releaseInfo.js.map +1 -1
  166. package/dist/esm/mui/index.js.map +1 -1
  167. package/dist/esm/mui/themeValues.js +106 -0
  168. package/dist/esm/mui/themeValues.js.map +1 -1
  169. package/dist/esm/parts/Breadcrumb.js +68 -0
  170. package/dist/esm/parts/Breadcrumb.js.map +1 -0
  171. package/dist/esm/parts/Combobox.js +171 -0
  172. package/dist/esm/parts/Combobox.js.map +1 -0
  173. package/dist/esm/parts/ContextMenu.js +17 -17
  174. package/dist/esm/parts/ContextMenu.js.map +1 -1
  175. package/dist/esm/parts/Menu.js +105 -24
  176. package/dist/esm/parts/Menu.js.map +1 -1
  177. package/dist/esm/parts/Select.js +120 -0
  178. package/dist/esm/parts/Select.js.map +1 -0
  179. package/dist/esm/parts/Toast.js +95 -0
  180. package/dist/esm/parts/Toast.js.map +1 -0
  181. package/dist/esm/parts/Toolbar.js +100 -0
  182. package/dist/esm/parts/Toolbar.js.map +1 -0
  183. package/dist/esm/parts/Tooltip.js +20 -8
  184. package/dist/esm/parts/Tooltip.js.map +1 -1
  185. package/dist/esm/parts/index.js +156 -87
  186. package/dist/esm/parts/index.js.map +1 -1
  187. package/dist/global/caligo-ui.css +1 -1
  188. package/dist/global/caligo-ui.js +1 -1
  189. package/dist/global/caligo-ui.js.map +1 -1
  190. package/dist/types/Alert/Alert.d.ts +7 -2
  191. package/dist/types/Avatar/Avatar.d.ts +38 -3
  192. package/dist/types/Button/Button.d.ts +9 -2
  193. package/dist/types/Button/buttonClasses.d.ts +2 -0
  194. package/dist/types/Chip/Chip.d.ts +21 -0
  195. package/dist/types/Dialog/Dialog.d.ts +1 -0
  196. package/dist/types/IconButton/IconButton.d.ts +6 -0
  197. package/dist/types/InputBase/InputBase.d.ts +64 -0
  198. package/dist/types/InputBase/index.d.ts +2 -0
  199. package/dist/types/Radio/Radio.d.ts +5 -3
  200. package/dist/types/RadioGroup/RadioGroup.d.ts +4 -2
  201. package/dist/types/RadioGroup/radioGroupContext.d.ts +6 -2
  202. package/dist/types/ScrollArea/ScrollArea.d.ts +28 -0
  203. package/dist/types/ScrollArea/index.d.ts +2 -0
  204. package/dist/types/Switch/Switch.d.ts +4 -3
  205. package/dist/types/Tab/Tab.d.ts +7 -0
  206. package/dist/types/TableCell/TableCell.d.ts +6 -0
  207. package/dist/types/TextField/TextField.d.ts +11 -0
  208. package/dist/types/TextField/textFieldClasses.d.ts +4 -0
  209. package/dist/types/Tooltip/Tooltip.d.ts +20 -0
  210. package/dist/types/index.d.ts +2 -0
  211. package/dist/types/internal/glyphs.d.ts +1 -0
  212. package/dist/types/internal/hues.d.ts +10 -0
  213. package/dist/types/internal/inputEvent.d.ts +13 -0
  214. package/dist/types/internal/releaseInfo.d.ts +1 -1
  215. package/dist/types/mui/index.d.ts +2 -0
  216. package/dist/types/mui/themeValues.d.ts +106 -0
  217. package/dist/types/parts/Breadcrumb.d.ts +24 -0
  218. package/dist/types/parts/Combobox.d.ts +88 -0
  219. package/dist/types/parts/ContextMenu.d.ts +2 -2
  220. package/dist/types/parts/Menu.d.ts +44 -0
  221. package/dist/types/parts/Select.d.ts +72 -0
  222. package/dist/types/parts/Toast.d.ts +46 -0
  223. package/dist/types/parts/Toolbar.d.ts +47 -0
  224. package/dist/types/parts/Tooltip.d.ts +6 -0
  225. package/dist/types/parts/index.d.ts +95 -4
  226. package/package.json +13 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Switch2.js","names":["React","getSwitchUtilityClass","generateUtilityClass","slot","switchClasses","generateUtilityClasses","Switch","checkedProp","classesProp","disabledProp","_disableRipple","other","useDefaultProps","inProps","formControl","useFormControl","disabled","checked","setChecked","useControlled","defaultChecked","useFocusVisible","slotProps","classes","composeClasses","capitalize","color","size","edge","focusVisible","cx","className","mergeSlotProps","required","inputRef","event","onChange"],"sources":["../../../src/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDefaultProps } from '../internal/defaultProps';\nimport { cx } from '../internal/cx';\nimport { capitalize, composeClasses, generateUtilityClass, generateUtilityClasses } from '../internal/classes';\nimport { useFormControl } from '../internal/formControlContext';\nimport { mergeSlotProps } from '../internal/slots';\nimport type { OverridableStringUnion } from '../internal/types';\nimport { useControlled } from '../internal/useControlled';\nimport { useFocusVisible } from '../internal/useFocusVisible';\nimport './Switch.css';\n\nexport interface SwitchClasses {\n root: string;\n /** State class, applied as `Caligo-checked`. */\n checked: string;\n /** State class, applied as `Caligo-disabled`. */\n disabled: string;\n /** State class, applied as `Caligo-focusVisible`. */\n focusVisible: string;\n edgeStart: string;\n edgeEnd: string;\n colorPrimary: string;\n colorSecondary: string;\n colorError: string;\n colorSuccess: string;\n colorWarning: string;\n colorInfo: string;\n colorDefault: string;\n sizeSmall: string;\n sizeMedium: string;\n sizeLarge: string;\n /** The native checkbox input, invisible over the root. */\n input: string;\n track: string;\n thumb: string;\n}\nexport type SwitchClassKey = keyof SwitchClasses;\nexport function getSwitchUtilityClass(slot: string): string {\n return generateUtilityClass('Switch', slot);\n}\nexport const switchClasses: SwitchClasses = generateUtilityClasses('Switch', [\n 'root', 'checked', 'disabled', 'focusVisible', 'edgeStart', 'edgeEnd',\n 'colorPrimary', 'colorSecondary', 'colorError', 'colorSuccess', 'colorWarning', 'colorInfo', 'colorDefault',\n 'sizeSmall', 'sizeMedium', 'sizeLarge', 'input', 'track', 'thumb',\n]);\n\n/** Add colors through module augmentation, as in Material UI. */\nexport interface SwitchPropsColorOverrides {}\n/** Add sizes through module augmentation, as in Material UI. */\nexport interface SwitchPropsSizeOverrides {}\n\nexport interface SwitchOwnProps {\n /** Whether it is checked, for a controlled switch. Pair it with `onChange`. */\n checked?: boolean;\n classes?: Partial<SwitchClasses>;\n /** The fill when checked: a theme palette color, or `default` for the primary text color. @default 'primary' */\n color?: OverridableStringUnion<'primary' | 'secondary' | 'error' | 'success' | 'warning' | 'info' | 'default', SwitchPropsColorOverrides>;\n /** Whether it starts checked, when uncontrolled. */\n defaultChecked?: boolean;\n disabled?: boolean;\n /** Accepted for Material UI compatibility. Caligo has no ripple. */\n disableRipple?: boolean;\n /** Lines the track up with the start or end of its container. */\n edge?: 'start' | 'end' | false;\n /** The input's id, for a `<label htmlFor>`. */\n id?: string;\n inputRef?: React.Ref<HTMLInputElement>;\n name?: string;\n /** Material UI signature: `(event, checked)`. */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;\n required?: boolean;\n /** Track widths: small 36px, medium 44px, large 52px. Caligo extra: `large`. @default 'medium' */\n size?: OverridableStringUnion<'small' | 'medium' | 'large', SwitchPropsSizeOverrides>;\n /** Props for each part. Material UI's slot names. */\n slotProps?: {\n input?: React.InputHTMLAttributes<HTMLInputElement>;\n track?: React.HTMLAttributes<HTMLSpanElement>;\n thumb?: React.HTMLAttributes<HTMLSpanElement>;\n };\n /** Value submitted with the form when on. The browser sends `on` when left out. */\n value?: string;\n}\n\nexport type SwitchProps = SwitchOwnProps & Omit<React.HTMLAttributes<HTMLSpanElement>, keyof SwitchOwnProps | 'color' | 'defaultValue'>;\n\n/**\n * An on/off switch. Follows Material UI's `Switch` API: a native checkbox input with\n * `role=\"switch\"` under a drawn track and thumb. Label it with FormControlLabel.\n */\nexport const Switch = React.forwardRef<HTMLSpanElement, SwitchProps>(function Switch(inProps, ref) {\n const props = useDefaultProps('Switch', inProps);\n const {\n checked: checkedProp,\n classes: classesProp,\n className,\n color = 'primary',\n defaultChecked = false,\n disabled: disabledProp,\n disableRipple: _disableRipple,\n edge = false,\n id,\n inputRef,\n name,\n onChange,\n required,\n size = 'medium',\n slotProps,\n value,\n ...other\n } = props;\n\n const formControl = useFormControl();\n const disabled = disabledProp ?? formControl?.disabled ?? false;\n const [checked, setChecked] = useControlled(checkedProp, defaultChecked);\n const { focusVisible, onFocus, onBlur } = useFocusVisible<HTMLInputElement>({\n onFocus: slotProps?.input?.onFocus,\n onBlur: slotProps?.input?.onBlur,\n });\n\n const classes = composeClasses(\n {\n root: [\n 'root', `color${capitalize(color)}`, `size${capitalize(size)}`, edge && `edge${capitalize(edge)}`,\n checked && 'checked', disabled && 'disabled', focusVisible && 'focusVisible',\n ],\n input: ['input'],\n track: ['track'],\n thumb: ['thumb'],\n },\n getSwitchUtilityClass,\n classesProp,\n );\n\n return (\n <span ref={ref} className={cx(classes.root, className)} {...other}>\n <input\n {...mergeSlotProps<React.InputHTMLAttributes<HTMLInputElement>>(\n { type: 'checkbox', role: 'switch', className: classes.input, id, name, value, checked, disabled, required: required ?? formControl?.required },\n slotProps?.input,\n )}\n ref={inputRef}\n onChange={(event) => {\n setChecked(event.target.checked);\n slotProps?.input?.onChange?.(event);\n onChange?.(event, event.target.checked);\n }}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n <span aria-hidden=\"true\" {...mergeSlotProps({ className: classes.track }, slotProps?.track)}>\n <span {...mergeSlotProps({ className: classes.thumb }, slotProps?.thumb)} />\n </span>\n </span>\n );\n});\n"],"mappings":";;;;;;;;;;;;AAqCA,SAAgBC,EAAsB,GAAsB;CAC1D,OAAOC,EAAqB,UAAUC,CAAI;AAC5C;AACA,IAAaC,IAA+BC,EAAuB,UAAU;CAC3E;CAAQ;CAAW;CAAY;CAAgB;CAAa;CAC5D;CAAgB;CAAkB;CAAc;CAAgB;CAAgB;CAAa;CAC7F;CAAa;CAAc;CAAa;CAAS;CAAS;AAC5D,CAAC,GA6CYC,IAASN,EAAM,WAAyC,SAAgB,GAAS,GAAK;CAEjG,IAAM,EACJ,SAASO,GACT,SAASC,GACT,cACA,WAAQ,WACR,oBAAiB,IACjB,UAAUC,GACV,eAAeC,GACf,UAAO,IACP,OACA,aACA,SACA,aACA,aACA,UAAO,UACP,cACA,UACA,GAAGC,MAlBSC,EAAgB,UAAUC,CAmBpC,GAEEC,IAAcC,EAAe,GAC7BC,IAAWP,KAAgBK,GAAa,YAAY,IACpD,CAACG,GAASC,KAAcC,EAAcZ,GAAaa,CAAc,GACjE,EAAE,iBAAc,YAAS,cAAWC,EAAkC;EAC1E,SAASC,GAAW,OAAO;EAC3B,QAAQA,GAAW,OAAO;CAC5B,CAAC,GAEKC,IAAUC,EACd;EACE,MAAM;GACJ;GAAQ,QAAQC,EAAWC,CAAK;GAAK,OAAOD,EAAWE,CAAI;GAAKC,KAAQ,OAAOH,EAAWG,CAAI;GAC9FX,KAAW;GAAWD,KAAY;GAAYa,KAAgB;EAChE;EACA,OAAO,CAAC,OAAO;EACf,OAAO,CAAC,OAAO;EACf,OAAO,CAAC,OAAO;CACjB,GACA5B,GACAO,CACF;CAEA,OACE,kBAAC,QAAD;EAAW;EAAK,WAAWsB,EAAGP,EAAQ,MAAMQ,CAAS;EAAG,GAAIpB;EAA5D,UAAA,CACE,kBAAC,SAAD;GACE,GAAIqB,EACF;IAAE,MAAM;IAAY,MAAM;IAAU,WAAWT,EAAQ;IAAO;IAAI;IAAM;IAAO;IAAS;IAAU,UAAUU,KAAYnB,GAAa;GAAS,GAC9IQ,GAAW,KACb;GACA,KAAKY;GACL,WAAW,MAAU;IAGnB,AAFAhB,EAAWiB,EAAM,OAAO,OAAO,GAC/Bb,GAAW,OAAO,WAAWa,CAAK,GAClCC,IAAWD,GAAOA,EAAM,OAAO,OAAO;GACxC;GACS;GACD;EACT,CAAA,GACD,kBAAC,QAAD;GAAM,eAAY;GAAO,GAAIH,EAAe,EAAE,WAAWT,EAAQ,MAAM,GAAGD,GAAW,KAAK;GACxF,UAAA,kBAAC,QAAD,EAAM,GAAIU,EAAe,EAAE,WAAWT,EAAQ,MAAM,GAAGD,GAAW,KAAK,EAAI,CAAA;EACvE,CAAA,CACF;;AAEV,CAAC"}
1
+ {"version":3,"file":"Switch2.js","names":["Switch","BaseSwitch","React","getSwitchUtilityClass","generateUtilityClass","slot","switchClasses","generateUtilityClasses","Switch$1","checkedProp","classesProp","disabledProp","_disableRipple","other","useDefaultProps","inProps","formControl","useFormControl","disabled","checked","setChecked","useControlled","defaultChecked","inputOnChange","inputOnFocus","inputOnBlur","inputId","inputName","inputValue","inputSlot","slotProps","splitAriaProps","handleFocus","handleBlur","useFocusVisible","event","onFocus","onBlur","hiddenInput","setInputRef","node","inputRef","classes","composeClasses","capitalize","color","size","edge","focusVisible","Switch","aria","id","name","value","required","next","inputChangeEvent","details","onChange","cx","className","mergeSlotProps"],"sources":["../../../src/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDefaultProps } from '../internal/defaultProps';\nimport { cx } from '../internal/cx';\nimport { capitalize, composeClasses, generateUtilityClass, generateUtilityClasses } from '../internal/classes';\nimport { useFormControl } from '../internal/formControlContext';\nimport { mergeSlotProps } from '../internal/slots';\nimport type { OverridableStringUnion } from '../internal/types';\nimport { useControlled } from '../internal/useControlled';\nimport { useFocusVisible } from '../internal/useFocusVisible';\nimport { Switch as BaseSwitch } from '@base-ui/react/switch';\nimport { inputChangeEvent, splitAriaProps } from '../internal/inputEvent';\nimport './Switch.css';\n\nexport interface SwitchClasses {\n root: string;\n /** State class, applied as `Caligo-checked`. */\n checked: string;\n /** State class, applied as `Caligo-disabled`. */\n disabled: string;\n /** State class, applied as `Caligo-focusVisible`. */\n focusVisible: string;\n edgeStart: string;\n edgeEnd: string;\n colorPrimary: string;\n colorSecondary: string;\n colorError: string;\n colorSuccess: string;\n colorWarning: string;\n colorInfo: string;\n colorDefault: string;\n sizeSmall: string;\n sizeMedium: string;\n sizeLarge: string;\n /** Kept for Material UI compatibility: the hidden input is Base UI's and takes no class. */\n input: string;\n track: string;\n thumb: string;\n}\nexport type SwitchClassKey = keyof SwitchClasses;\nexport function getSwitchUtilityClass(slot: string): string {\n return generateUtilityClass('Switch', slot);\n}\nexport const switchClasses: SwitchClasses = generateUtilityClasses('Switch', [\n 'root', 'checked', 'disabled', 'focusVisible', 'edgeStart', 'edgeEnd',\n 'colorPrimary', 'colorSecondary', 'colorError', 'colorSuccess', 'colorWarning', 'colorInfo', 'colorDefault',\n 'sizeSmall', 'sizeMedium', 'sizeLarge', 'input', 'track', 'thumb',\n]);\n\n/** Add colors through module augmentation, as in Material UI. */\nexport interface SwitchPropsColorOverrides {}\n/** Add sizes through module augmentation, as in Material UI. */\nexport interface SwitchPropsSizeOverrides {}\n\nexport interface SwitchOwnProps {\n /** Whether it is checked, for a controlled switch. Pair it with `onChange`. */\n checked?: boolean;\n classes?: Partial<SwitchClasses>;\n /** The fill when checked: a theme palette color, or `default` for the primary text color. @default 'primary' */\n color?: OverridableStringUnion<'primary' | 'secondary' | 'error' | 'success' | 'warning' | 'info' | 'default', SwitchPropsColorOverrides>;\n /** Whether it starts checked, when uncontrolled. */\n defaultChecked?: boolean;\n disabled?: boolean;\n /** Accepted for Material UI compatibility. Caligo has no ripple. */\n disableRipple?: boolean;\n /** Lines the track up with the start or end of its container. */\n edge?: 'start' | 'end' | false;\n /** The input's id, for a `<label htmlFor>`. */\n id?: string;\n inputRef?: React.Ref<HTMLInputElement>;\n name?: string;\n /** Material UI signature: `(event, checked)`. */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;\n required?: boolean;\n /** Track widths: small 36px, medium 44px, large 52px. Caligo extra: `large`. @default 'medium' */\n size?: OverridableStringUnion<'small' | 'medium' | 'large', SwitchPropsSizeOverrides>;\n /** Props for each part. Material UI's slot names. */\n slotProps?: {\n input?: React.InputHTMLAttributes<HTMLInputElement>;\n track?: React.HTMLAttributes<HTMLSpanElement>;\n thumb?: React.HTMLAttributes<HTMLSpanElement>;\n };\n /** Value submitted with the form when on. The browser sends `on` when left out. */\n value?: string;\n}\n\nexport type SwitchProps = SwitchOwnProps & Omit<React.HTMLAttributes<HTMLSpanElement>, keyof SwitchOwnProps | 'color' | 'defaultValue'>;\n\n/**\n * An on/off switch. Follows Material UI's `Switch` API and uses Base UI's `Switch` for behavior, as Checkbox and Radio\n * do: the root is the control (`role=\"switch\"`), with a hidden input for forms. `onChange(event, checked)` gets an\n * event whose `target` is that input. Name it through `slotProps.input` (`aria-label`) or a FormControlLabel.\n */\nexport const Switch = React.forwardRef<HTMLSpanElement, SwitchProps>(function Switch(inProps, ref) {\n const props = useDefaultProps('Switch', inProps);\n const {\n checked: checkedProp,\n classes: classesProp,\n className,\n color = 'primary',\n defaultChecked = false,\n disabled: disabledProp,\n disableRipple: _disableRipple,\n edge = false,\n id,\n inputRef,\n name,\n onBlur,\n onChange,\n onFocus,\n required,\n size = 'medium',\n slotProps,\n value,\n ...other\n } = props;\n\n const formControl = useFormControl();\n const disabled = disabledProp ?? formControl?.disabled ?? false;\n const [checked, setChecked] = useControlled(checkedProp, defaultChecked);\n const { onChange: inputOnChange, onFocus: inputOnFocus, onBlur: inputOnBlur, id: inputId, name: inputName, value: inputValue, ...inputSlot } = slotProps?.input ?? {};\n const { aria } = splitAriaProps(inputSlot as Record<string, unknown>);\n const { focusVisible, onFocus: handleFocus, onBlur: handleBlur } = useFocusVisible<HTMLSpanElement>({\n onFocus: (event) => { inputOnFocus?.(event as unknown as React.FocusEvent<HTMLInputElement>); onFocus?.(event); },\n onBlur: (event) => { inputOnBlur?.(event as unknown as React.FocusEvent<HTMLInputElement>); onBlur?.(event); },\n });\n const hiddenInput = React.useRef<HTMLInputElement | null>(null);\n const setInputRef = (node: HTMLInputElement | null) => {\n hiddenInput.current = node;\n if (typeof inputRef === 'function') inputRef(node);\n else if (inputRef) (inputRef as React.MutableRefObject<HTMLInputElement | null>).current = node;\n };\n\n const classes = composeClasses(\n {\n root: [\n 'root', `color${capitalize(color)}`, `size${capitalize(size)}`, edge && `edge${capitalize(edge)}`,\n checked && 'checked', disabled && 'disabled', focusVisible && 'focusVisible',\n ],\n input: ['input'],\n track: ['track'],\n thumb: ['thumb'],\n },\n getSwitchUtilityClass,\n classesProp,\n );\n\n return (\n <BaseSwitch.Root\n ref={ref}\n {...other}\n {...aria}\n {...((id ?? inputId) !== undefined ? { id: id ?? inputId } : null)}\n {...((name ?? inputName) !== undefined ? { name: name ?? inputName } : null)}\n {...((value ?? inputValue) !== undefined ? { value: String(value ?? inputValue) } : null)}\n required={required ?? formControl?.required}\n checked={checked}\n disabled={disabled}\n inputRef={setInputRef}\n onCheckedChange={(next, details) => {\n setChecked(next);\n const event = inputChangeEvent(details.event, hiddenInput.current, next);\n inputOnChange?.(event);\n onChange?.(event, next);\n }}\n className={cx(classes.root, className)}\n onFocus={handleFocus}\n onBlur={handleBlur}\n >\n <span aria-hidden=\"true\" {...mergeSlotProps({ className: classes.track }, slotProps?.track)}>\n <BaseSwitch.Thumb {...mergeSlotProps({ className: classes.thumb }, slotProps?.thumb)} />\n </span>\n </BaseSwitch.Root>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;AAuCA,SAAgBG,EAAsB,GAAsB;CAC1D,OAAOC,EAAqB,UAAUC,CAAI;AAC5C;AACA,IAAaC,IAA+BC,EAAuB,UAAU;CAC3E;CAAQ;CAAW;CAAY;CAAgB;CAAa;CAC5D;CAAgB;CAAkB;CAAc;CAAgB;CAAgB;CAAa;CAC7F;CAAa;CAAc;CAAa;CAAS;CAAS;AAC5D,CAAC,GA8CYP,IAASE,EAAM,WAAyC,SAAgB,GAAS,GAAK;CAEjG,IAAM,EACJ,SAASO,GACT,SAASC,GACT,cACA,WAAQ,WACR,oBAAiB,IACjB,UAAUC,GACV,eAAeC,GACf,UAAO,IACP,OACA,aACA,SACA,WACA,aACA,YACA,aACA,UAAO,UACP,cACA,UACA,GAAGC,MApBSC,EAAgB,UAAUC,CAqBpC,GAEEC,IAAcC,EAAe,GAC7BC,IAAWP,KAAgBK,GAAa,YAAY,IACpD,CAACG,GAASC,KAAcC,EAAcZ,GAAaa,CAAc,GACjE,EAAE,UAAUC,GAAe,SAASC,GAAc,QAAQC,GAAa,IAAIC,GAAS,MAAMC,GAAW,OAAOC,GAAY,GAAGC,MAAcC,GAAW,SAAS,CAAC,GAC9J,EAAE,YAASC,EAAeF,CAAoC,GAC9D,EAAE,iBAAc,SAASG,GAAa,QAAQC,MAAeC,EAAiC;EAClG,UAAU,MAAU;GAA0E,AAAxEV,IAAeW,CAAsD,GAAGC,IAAUD,CAAK;EAAG;EAChH,SAAS,MAAU;GAAyE,AAAvEV,IAAcU,CAAsD,GAAGE,IAASF,CAAK;EAAG;CAC/G,CAAC,GACKG,IAAcpC,EAAM,OAAgC,IAAI,GACxDqC,KAAe,MAAkC;EAErD,AADA,EAAY,UAAUC,GAClB,OAAOC,KAAa,aAAYA,EAASD,CAAI,IACxCC,MAAU,EAA8D,UAAUD;CAC7F,GAEME,IAAUC,EACd;EACE,MAAM;GACJ;GAAQ,QAAQC,EAAWC,CAAK;GAAK,OAAOD,EAAWE,CAAI;GAAKC,KAAQ,OAAOH,EAAWG,CAAI;GAC9F5B,KAAW;GAAWD,KAAY;GAAY8B,KAAgB;EAChE;EACA,OAAO,CAAC,OAAO;EACf,OAAO,CAAC,OAAO;EACf,OAAO,CAAC,OAAO;CACjB,GACA7C,GACAO,CACF;CAEA,OACE,kBAACT,EAAW,MAAZ;EACO;EACL,GAAIY;EACJ,GAAIqC;EACJ,IAAMC,KAAMzB,OAAa,KAAA,IAAoC,OAAxB,EAAE,IAAIyB,KAAMzB,EAAQ;EACzD,IAAM0B,KAAQzB,OAAe,KAAA,IAA0C,OAA9B,EAAE,MAAMyB,KAAQzB,EAAU;EACnE,IAAM0B,KAASzB,OAAgB,KAAA,IAAqD,OAAzC,EAAE,OAAO,OAAOyB,KAASzB,CAAU,EAAE;EAChF,UAAU0B,KAAYtC,GAAa;EAC1B;EACC;EACV,UAAUuB;EACV,kBAAkB,GAAM,MAAY;GAClC,EAAWgB,CAAI;GACf,IAAMpB,IAAQqB,EAAiBC,EAAQ,OAAOnB,EAAY,SAASiB,CAAI;GAEvE,AADAhC,IAAgBY,CAAK,GACrBuB,IAAWvB,GAAOoB,CAAI;EACxB;EACA,WAAWI,EAAGjB,EAAQ,MAAMkB,CAAS;EACrC,SAAS5B;EACT,QAAQC;EAER,UAAA,kBAAC,QAAD;GAAM,eAAY;GAAO,GAAI4B,EAAe,EAAE,WAAWnB,EAAQ,MAAM,GAAGZ,GAAW,KAAK;GACxF,UAAA,kBAAC7B,EAAW,OAAZ,EAAkB,GAAI4D,EAAe,EAAE,WAAWnB,EAAQ,MAAM,GAAGZ,GAAW,KAAK,EAAI,CAAA;EACnF,CAAA;CACS,CAAA;AAErB,CAAC"}
@@ -1 +1 @@
1
- @layer caligo{.CaligoTab-root{box-sizing:border-box;min-width:0;padding:var(--cal-tabs-padding-y-md,8px) var(--cal-tabs-padding-x-md,12px);color:var(--cal-text-secondary);font:inherit;white-space:nowrap;cursor:pointer;transition:background-color var(--cal-duration-fast) var(--cal-ease-in-out), color var(--cal-duration-fast) var(--cal-ease-in-out);background:0 0;border:0;border-radius:0;outline:0;flex-shrink:0;justify-content:center;align-items:center;gap:6px;margin:0;font-weight:500;display:inline-flex}@media (hover:hover){.CaligoTab-root:hover:not(.Caligo-disabled){color:var(--cal-text-primary)}}.CaligoTab-root.Caligo-selected{color:var(--cal-text-primary);font-weight:600}.CaligoTab-root:focus-visible,.CaligoTab-root.Caligo-focusVisible{box-shadow:var(--cal-focus-ring-sm,var(--cal-focus-ring))}.CaligoTab-root.Caligo-disabled{opacity:var(--cal-opacity-disabled,.5);cursor:not-allowed}.CaligoTab-wrapped{white-space:normal}.CaligoTab-labelIcon[data-icon-position=top],.CaligoTab-labelIcon[data-icon-position=bottom]{flex-direction:column}.CaligoTab-iconWrapper{flex:none;width:16px;height:16px}}
1
+ @layer caligo{.CaligoTab-root{box-sizing:border-box;min-width:0;padding:var(--cal-tabs-padding-y-md,8px) var(--cal-tabs-padding-x-md,12px);color:var(--cal-text-secondary);font:inherit;white-space:nowrap;cursor:pointer;transition:background-color var(--cal-duration-fast) var(--cal-ease-in-out), color var(--cal-duration-fast) var(--cal-ease-in-out);background:0 0;border:0;border-radius:0;outline:0;flex-shrink:0;justify-content:center;align-items:center;gap:6px;margin:0;font-weight:500;display:inline-flex}@media (hover:hover){.CaligoTab-root:hover:not(.Caligo-disabled){color:var(--cal-text-primary)}}.CaligoTab-root.Caligo-selected{color:var(--cal-text-primary);font-weight:600}.CaligoTab-root:focus-visible,.CaligoTab-root.Caligo-focusVisible{box-shadow:var(--cal-focus-ring-sm,var(--cal-focus-ring))}.CaligoTab-root.Caligo-disabled{opacity:var(--cal-opacity-disabled,.5);cursor:not-allowed}.CaligoTab-wrapped{white-space:normal}.CaligoTab-labelIcon[data-icon-position=top],.CaligoTab-labelIcon[data-icon-position=bottom]{flex-direction:column}.CaligoTab-iconWrapper{flex:none;width:16px;height:16px}a.CaligoTab-root{text-decoration:none}a.CaligoTab-root.Caligo-disabled{pointer-events:none}}
@@ -21,38 +21,43 @@ var f = i("Tab", [
21
21
  "wrapped",
22
22
  "fullWidth"
23
23
  ]), p = c.forwardRef(function(r, i) {
24
- let { children: f, classes: p, className: m, disabled: h = !1, icon: g, iconPosition: _ = "top", id: v, label: y, onBlur: b, onClick: x, onFocus: S, value: C, wrapped: w = !1, ...T } = e("Tab", r), E = c.useContext(s), D = c.useContext(o), O = C ?? D, k = E ? E.value === O : !1, { focusVisible: A, onFocus: j, onBlur: M } = a({
25
- onFocus: S,
26
- onBlur: b
27
- }), N = n({
24
+ let { children: f, classes: p, className: m, component: h, disabled: g = !1, href: _, icon: v, iconPosition: y = "top", id: b, label: x, onBlur: S, onClick: C, onFocus: w, value: T, wrapped: E = !1, ...D } = e("Tab", r), O = h ?? (_ ? "a" : "button"), k = O === "button", A = c.useContext(s), j = c.useContext(o), M = T ?? j, N = A ? A.value === M : !1, { focusVisible: P, onFocus: F, onBlur: I } = a({
25
+ onFocus: w,
26
+ onBlur: S
27
+ }), L = n({
28
28
  root: [
29
29
  "root",
30
- g && y != null && "labelIcon",
31
- w && "wrapped",
32
- E?.fullWidth && "fullWidth",
33
- k && "selected",
34
- h && "disabled",
35
- A && "focusVisible"
30
+ v && x != null && "labelIcon",
31
+ E && "wrapped",
32
+ A?.fullWidth && "fullWidth",
33
+ N && "selected",
34
+ g && "disabled",
35
+ P && "focusVisible"
36
36
  ],
37
37
  iconWrapper: ["iconWrapper"]
38
- }, d, p), P = String(O).replace(/\s+/g, "-"), F = g ? c.cloneElement(g, { className: t(N.iconWrapper, g.props.className) }) : null;
39
- return /* @__PURE__ */ u("button", {
38
+ }, d, p), R = String(M).replace(/\s+/g, "-"), z = v ? c.cloneElement(v, { className: t(L.iconWrapper, v.props.className) }) : null;
39
+ return /* @__PURE__ */ u(O, {
40
40
  ref: i,
41
- type: "button",
41
+ ...k ? {
42
+ type: "button",
43
+ disabled: g
44
+ } : {
45
+ ..._ !== void 0 && !g ? { href: _ } : null,
46
+ "aria-disabled": g || void 0
47
+ },
42
48
  role: "tab",
43
- id: v ?? (E ? `${E.idPrefix}-tab-${P}` : void 0),
44
- "aria-selected": k,
45
- tabIndex: k || E && (E.value === !1 || E.value === void 0) && D === 0 ? 0 : -1,
46
- disabled: h,
47
- "data-icon-position": g && y != null ? _ : void 0,
48
- className: t(N.root, m),
49
- onFocus: j,
50
- onBlur: M,
49
+ id: b ?? (A ? `${A.idPrefix}-tab-${R}` : void 0),
50
+ "aria-selected": N,
51
+ tabIndex: N || A && (A.value === !1 || A.value === void 0) && j === 0 ? 0 : -1,
52
+ "data-icon-position": v && x != null ? y : void 0,
53
+ className: t(L.root, m),
54
+ onFocus: F,
55
+ onBlur: I,
51
56
  onClick: (e) => {
52
- x?.(e), e.defaultPrevented || E?.onSelect(e, O);
57
+ g && !k ? e.preventDefault() : (C?.(e), e.defaultPrevented || A?.onSelect(e, M));
53
58
  },
54
- ...T,
55
- children: [_ === "end" || _ === "bottom" ? /* @__PURE__ */ u(l, { children: [y, F] }) : /* @__PURE__ */ u(l, { children: [F, y] }), f]
59
+ ...D,
60
+ children: [y === "end" || y === "bottom" ? /* @__PURE__ */ u(l, { children: [x, z] }) : /* @__PURE__ */ u(l, { children: [z, x] }), f]
56
61
  });
57
62
  });
58
63
  export { p as Tab, d as getTabUtilityClass, f as tabClasses };
@@ -1 +1 @@
1
- {"version":3,"file":"Tab2.js","names":["_Fragment","React","getTabUtilityClass","generateUtilityClass","slot","tabClasses","generateUtilityClasses","Tab","classesProp","valueProp","other","useDefaultProps","inProps","tabs","TabsContext","index","TabIndexContext","value","selected","handleFocus","handleBlur","useFocusVisible","classes","composeClasses","icon","label","wrapped","disabled","focusVisible","key","iconNode","cx","id","iconPosition","className","onClick","event","Fragment","children"],"sources":["../../../src/Tab/Tab.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDefaultProps } from '../internal/defaultProps';\nimport { cx } from '../internal/cx';\nimport { composeClasses, generateUtilityClass, generateUtilityClasses } from '../internal/classes';\nimport { useFocusVisible } from '../internal/useFocusVisible';\nimport { TabIndexContext, TabsContext } from '../Tabs/tabsContext';\nimport './Tab.css';\n\nexport interface TabClasses { root: string; selected: string; disabled: string; focusVisible: string; labelIcon: string; iconWrapper: string; wrapped: string; fullWidth: string }\nexport type TabClassKey = keyof TabClasses;\nexport function getTabUtilityClass(slot: string): string { return generateUtilityClass('Tab', slot); }\nexport const tabClasses: TabClasses = generateUtilityClasses('Tab', ['root', 'selected', 'disabled', 'focusVisible', 'labelIcon', 'iconWrapper', 'wrapped', 'fullWidth']);\n\nexport interface TabOwnProps {\n classes?: Partial<TabClasses>;\n disabled?: boolean;\n /** An icon element shown with the label, such as `<Icon name=\"inbox\" />`. Alone, it makes an icon-only tab: give it an `aria-label`. */\n icon?: React.ReactElement;\n /** Where `icon` sits relative to `label`. Only applies when both are set. @default 'top' */\n iconPosition?: 'top' | 'bottom' | 'start' | 'end';\n label?: React.ReactNode;\n /** Defaults to the Tab's index, as in Material UI. */\n value?: unknown;\n /** Lets a long label wrap to two lines. */\n wrapped?: boolean;\n}\nexport type TabProps = TabOwnProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof TabOwnProps | 'value'>;\n\n/**\n * One tab inside Tabs. Follows Material UI's `Tab` API. Its id matches TabPanel's aria-labelledby;\n * pass `aria-controls` yourself when the panel is always in the DOM.\n */\nexport const Tab = React.forwardRef<HTMLButtonElement, TabProps>(function Tab(inProps, ref) {\n const props = useDefaultProps('Tab', inProps);\n const { children, classes: classesProp, className, disabled = false, icon, iconPosition = 'top', id, label, onBlur, onClick, onFocus, value: valueProp, wrapped = false, ...other } = props;\n const tabs = React.useContext(TabsContext);\n const index = React.useContext(TabIndexContext);\n const value = valueProp ?? index;\n const selected = tabs ? tabs.value === value : false;\n const { focusVisible, onFocus: handleFocus, onBlur: handleBlur } = useFocusVisible<HTMLButtonElement>({ onFocus, onBlur });\n const classes = composeClasses(\n {\n root: ['root', icon && label != null && 'labelIcon', wrapped && 'wrapped', tabs?.fullWidth && 'fullWidth', selected && 'selected', disabled && 'disabled', focusVisible && 'focusVisible'],\n iconWrapper: ['iconWrapper'],\n },\n getTabUtilityClass,\n classesProp,\n );\n const key = String(value).replace(/\\s+/g, '-');\n const iconNode = icon ? React.cloneElement(icon as React.ReactElement<{ className?: string }>, { className: cx(classes.iconWrapper, (icon.props as { className?: string }).className) }) : null;\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"tab\"\n id={id ?? (tabs ? `${tabs.idPrefix}-tab-${key}` : undefined)}\n aria-selected={selected}\n tabIndex={selected || (tabs && (tabs.value === false || tabs.value === undefined) && index === 0) ? 0 : -1}\n disabled={disabled}\n data-icon-position={icon && label != null ? iconPosition : undefined}\n className={cx(classes.root, className)}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onClick={(event) => { onClick?.(event); if (!event.defaultPrevented) tabs?.onSelect(event, value); }}\n {...other}\n >\n {iconPosition === 'end' || iconPosition === 'bottom' ? <>{label}{iconNode}</> : <>{iconNode}{label}</>}\n {children}\n </button>\n );\n});\n"],"mappings":";;;;;;;;;;AAUA,SAAgBE,EAAmB,GAAsB;CAAE,OAAOC,EAAqB,OAAOC,CAAI;AAAG;AACrG,IAAaC,IAAyBC,EAAuB,OAAO;CAAC;CAAQ;CAAY;CAAY;CAAgB;CAAa;CAAe;CAAW;AAAW,CAAC,GAqB3JC,IAAMN,EAAM,WAAwC,SAAa,GAAS,GAAK;CAE1F,IAAM,EAAE,aAAU,SAASO,GAAa,cAAW,cAAW,IAAO,SAAM,kBAAe,OAAO,OAAI,UAAO,WAAQ,YAAS,YAAS,OAAOC,GAAW,aAAU,IAAO,GAAGC,MAD9JC,EAAgB,OAAOC,CACiJ,GAChLC,IAAOZ,EAAM,WAAWa,CAAW,GACnCC,IAAQd,EAAM,WAAWe,CAAe,GACxCC,IAAQR,KAAaM,GACrBG,IAAWL,IAAOA,EAAK,UAAUI,IAAQ,IACzC,EAAE,iBAAc,SAASE,GAAa,QAAQC,MAAeC,EAAmC;EAAE;EAAS;CAAO,CAAC,GACnHC,IAAUC,EACd;EACE,MAAM;GAAC;GAAQC,KAAQC,KAAS,QAAQ;GAAaC,KAAW;GAAWb,GAAM,aAAa;GAAaK,KAAY;GAAYS,KAAY;GAAYC,KAAgB;EAAc;EACzL,aAAa,CAAC,aAAa;CAC7B,GACA1B,GACAM,CACF,GACMqB,IAAM,OAAOZ,CAAK,CAAC,CAAC,QAAQ,QAAQ,GAAG,GACvCa,IAAWN,IAAOvB,EAAM,aAAauB,GAAoD,EAAE,WAAWO,EAAGT,EAAQ,aAAcE,EAAK,MAAiC,SAAS,EAAE,CAAC,IAAI;CAC3L,OACE,kBAAC,UAAD;EACO;EACL,MAAK;EACL,MAAK;EACL,IAAIQ,MAAOnB,IAAO,GAAGA,EAAK,SAAS,OAAOgB,MAAQ,KAAA;EAClD,iBAAeX;EACf,UAAUA,KAAaL,MAASA,EAAK,UAAU,MAASA,EAAK,UAAU,KAAA,MAAcE,MAAU,IAAK,IAAI;EAC9F;EACV,sBAAoBS,KAAQC,KAAS,OAAOQ,IAAe,KAAA;EAC3D,WAAWF,EAAGT,EAAQ,MAAMY,CAAS;EACrC,SAASf;EACT,QAAQC;EACR,UAAU,MAAU;GAAoB,AAAlBe,IAAUC,CAAK,GAAQA,EAAM,oBAAkBvB,GAAM,SAASuB,GAAOnB,CAAK;EAAG;EACnG,GAAIP;EAbN,UAAA,CAeGuB,MAAiB,SAASA,MAAiB,WAAW,kBAAAjC,GAAA,EAAA,UAAA,CAAGyB,GAAOK,CAAW,EAAA,CAAA,IAAI,kBAAA9B,GAAA,EAAA,UAAA,CAAG8B,GAAUL,CAAQ,EAAA,CAAA,GACpGa,CACK;;AAEZ,CAAC"}
1
+ {"version":3,"file":"Tab2.js","names":["_Fragment","React","getTabUtilityClass","generateUtilityClass","slot","tabClasses","generateUtilityClasses","Tab","classesProp","valueProp","other","useDefaultProps","inProps","Root","component","href","native","tabs","TabsContext","index","TabIndexContext","value","selected","handleFocus","handleBlur","useFocusVisible","classes","composeClasses","icon","label","wrapped","disabled","focusVisible","key","iconNode","cx","id","iconPosition","className","event","onClick","Fragment","children"],"sources":["../../../src/Tab/Tab.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDefaultProps } from '../internal/defaultProps';\nimport { cx } from '../internal/cx';\nimport { composeClasses, generateUtilityClass, generateUtilityClasses } from '../internal/classes';\nimport { useFocusVisible } from '../internal/useFocusVisible';\nimport { TabIndexContext, TabsContext } from '../Tabs/tabsContext';\nimport './Tab.css';\n\nexport interface TabClasses { root: string; selected: string; disabled: string; focusVisible: string; labelIcon: string; iconWrapper: string; wrapped: string; fullWidth: string }\nexport type TabClassKey = keyof TabClasses;\nexport function getTabUtilityClass(slot: string): string { return generateUtilityClass('Tab', slot); }\nexport const tabClasses: TabClasses = generateUtilityClasses('Tab', ['root', 'selected', 'disabled', 'focusVisible', 'labelIcon', 'iconWrapper', 'wrapped', 'fullWidth']);\n\nexport interface TabOwnProps {\n classes?: Partial<TabClasses>;\n /**\n * The root element: a `button` by default, or `a` with `href`, or your router's Link, for tabs that go to pages.\n * A link tab keeps `role=\"tab\"` and `aria-selected`, as Material UI's does.\n */\n component?: React.ElementType;\n disabled?: boolean;\n /** Makes the tab a link (an `<a>` unless `component` says otherwise). */\n href?: string;\n /** An icon element shown with the label, such as `<Icon name=\"inbox\" />`. Alone, it makes an icon-only tab: give it an `aria-label`. */\n icon?: React.ReactElement;\n /** Where `icon` sits relative to `label`. Only applies when both are set. @default 'top' */\n iconPosition?: 'top' | 'bottom' | 'start' | 'end';\n label?: React.ReactNode;\n /** Defaults to the Tab's index, as in Material UI. */\n value?: unknown;\n /** Lets a long label wrap to two lines. */\n wrapped?: boolean;\n}\nexport type TabProps = TabOwnProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof TabOwnProps | 'value'>;\n\n/**\n * One tab inside Tabs. Follows Material UI's `Tab` API. Its id matches TabPanel's aria-labelledby;\n * pass `aria-controls` yourself when the panel is always in the DOM.\n */\nexport const Tab = React.forwardRef<HTMLButtonElement, TabProps>(function Tab(inProps, ref) {\n const props = useDefaultProps('Tab', inProps);\n const { children, classes: classesProp, className, component, disabled = false, href, icon, iconPosition = 'top', id, label, onBlur, onClick, onFocus, value: valueProp, wrapped = false, ...other } = props;\n const Root: React.ElementType = component ?? (href ? 'a' : 'button');\n const native = Root === 'button';\n const tabs = React.useContext(TabsContext);\n const index = React.useContext(TabIndexContext);\n const value = valueProp ?? index;\n const selected = tabs ? tabs.value === value : false;\n const { focusVisible, onFocus: handleFocus, onBlur: handleBlur } = useFocusVisible<HTMLButtonElement>({ onFocus, onBlur });\n const classes = composeClasses(\n {\n root: ['root', icon && label != null && 'labelIcon', wrapped && 'wrapped', tabs?.fullWidth && 'fullWidth', selected && 'selected', disabled && 'disabled', focusVisible && 'focusVisible'],\n iconWrapper: ['iconWrapper'],\n },\n getTabUtilityClass,\n classesProp,\n );\n const key = String(value).replace(/\\s+/g, '-');\n const iconNode = icon ? React.cloneElement(icon as React.ReactElement<{ className?: string }>, { className: cx(classes.iconWrapper, (icon.props as { className?: string }).className) }) : null;\n return (\n <Root\n ref={ref}\n {...(native ? { type: 'button', disabled } : { ...(href !== undefined && !disabled ? { href } : null), 'aria-disabled': disabled || undefined })}\n role=\"tab\"\n id={id ?? (tabs ? `${tabs.idPrefix}-tab-${key}` : undefined)}\n aria-selected={selected}\n tabIndex={selected || (tabs && (tabs.value === false || tabs.value === undefined) && index === 0) ? 0 : -1}\n data-icon-position={icon && label != null ? iconPosition : undefined}\n className={cx(classes.root, className)}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => { if (disabled && !native) { event.preventDefault(); return; } onClick?.(event); if (!event.defaultPrevented) tabs?.onSelect(event, value); }}\n {...other}\n >\n {iconPosition === 'end' || iconPosition === 'bottom' ? <>{label}{iconNode}</> : <>{iconNode}{label}</>}\n {children}\n </Root>\n );\n});\n"],"mappings":";;;;;;;;;;AAUA,SAAgBE,EAAmB,GAAsB;CAAE,OAAOC,EAAqB,OAAOC,CAAI;AAAG;AACrG,IAAaC,IAAyBC,EAAuB,OAAO;CAAC;CAAQ;CAAY;CAAY;CAAgB;CAAa;CAAe;CAAW;AAAW,CAAC,GA4B3JC,IAAMN,EAAM,WAAwC,SAAa,GAAS,GAAK;CAE1F,IAAM,EAAE,aAAU,SAASO,GAAa,cAAW,cAAW,cAAW,IAAO,SAAM,SAAM,kBAAe,OAAO,OAAI,UAAO,WAAQ,YAAS,YAAS,OAAOC,GAAW,aAAU,IAAO,GAAGC,MAD/KC,EAAgB,OAAOC,CACkK,GACjMC,IAA0BC,MAAcC,IAAO,MAAM,WACrDC,IAASH,MAAS,UAClBI,IAAOhB,EAAM,WAAWiB,CAAW,GACnCC,IAAQlB,EAAM,WAAWmB,CAAe,GACxCC,IAAQZ,KAAaU,GACrBG,IAAWL,IAAOA,EAAK,UAAUI,IAAQ,IACzC,EAAE,iBAAc,SAASE,GAAa,QAAQC,MAAeC,EAAmC;EAAE;EAAS;CAAO,CAAC,GACnHC,IAAUC,EACd;EACE,MAAM;GAAC;GAAQC,KAAQC,KAAS,QAAQ;GAAaC,KAAW;GAAWb,GAAM,aAAa;GAAaK,KAAY;GAAYS,KAAY;GAAYC,KAAgB;EAAc;EACzL,aAAa,CAAC,aAAa;CAC7B,GACA9B,GACAM,CACF,GACMyB,IAAM,OAAOZ,CAAK,CAAC,CAAC,QAAQ,QAAQ,GAAG,GACvCa,IAAWN,IAAO3B,EAAM,aAAa2B,GAAoD,EAAE,WAAWO,EAAGT,EAAQ,aAAcE,EAAK,MAAiC,SAAS,EAAE,CAAC,IAAI;CAC3L,OACE,kBAACf,GAAD;EACO;EACL,GAAKG,IAAS;GAAE,MAAM;GAAU;EAAS,IAAI;GAAE,GAAID,MAAS,KAAA,KAAa,CAACgB,IAAW,EAAE,QAAK,IAAI;GAAO,iBAAiBA,KAAY,KAAA;EAAU;EAC9I,MAAK;EACL,IAAIK,MAAOnB,IAAO,GAAGA,EAAK,SAAS,OAAOgB,MAAQ,KAAA;EAClD,iBAAeX;EACf,UAAUA,KAAaL,MAASA,EAAK,UAAU,MAASA,EAAK,UAAU,KAAA,MAAcE,MAAU,IAAK,IAAI;EACxG,sBAAoBS,KAAQC,KAAS,OAAOQ,IAAe,KAAA;EAC3D,WAAWF,EAAGT,EAAQ,MAAMY,CAAS;EACrC,SAASf;EACT,QAAQC;EACR,UAAU,MAA+C;GAAE,AAAIO,KAAY,CAACf,IAAUuB,EAAM,eAAe,KAAaC,IAAUD,CAAK,GAAQA,EAAM,oBAAkBtB,GAAM,SAASsB,GAAOlB,CAAK;EAAG;EACrM,GAAIX;EAZN,UAAA,CAcG2B,MAAiB,SAASA,MAAiB,WAAW,kBAAArC,GAAA,EAAA,UAAA,CAAG6B,GAAOK,CAAW,EAAA,CAAA,IAAI,kBAAAlC,GAAA,EAAA,UAAA,CAAGkC,GAAUL,CAAQ,EAAA,CAAA,GACpGa,CACG;;AAEV,CAAC"}
@@ -1 +1 @@
1
- @layer caligo{.CaligoTable-root{border-collapse:collapse;border-spacing:0;width:100%;font-family:var(--cal-font-sans);color:var(--cal-text-primary);display:table}.CaligoTableContainer-root{width:100%;overflow-x:auto}.CaligoTableRow-root{color:inherit;vertical-align:middle;outline:0}@media (hover:hover){.CaligoTableRow-hover:hover{background:var(--cal-ghost-hover)}}.CaligoTableRow-root.Caligo-selected{background:var(--cal-state-new-lighter,var(--cal-primary-subtle-bg))}.CaligoTableCell-root{box-sizing:border-box;border-bottom:1px solid var(--cal-border-subtle);text-align:start;vertical-align:inherit;padding:12px 8px;font-size:14px;line-height:20px}.CaligoTableCell-sizeSmall{padding:8px;font-size:12px;line-height:18px}.CaligoTableCell-paddingCheckbox{padding:0;width:36px;padding-inline-start:4px}.CaligoTableCell-paddingNone{padding:0}.CaligoTableCell-head{background:var(--cal-bg-secondary);color:var(--cal-text-secondary);font-size:12px;font-weight:500;line-height:16px}.CaligoTableCell-stickyHeader{z-index:2;position:sticky;top:0}.CaligoTableCell-footer{color:var(--cal-text-secondary);font-size:12px}.CaligoTableCell-alignRight{text-align:end}.CaligoTableCell-alignCenter{text-align:center}.CaligoTableCell-alignJustify{text-align:justify}.CaligoTableSortLabel-root{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;outline:0;align-items:center;gap:4px;margin:0;padding:0;display:inline-flex}.CaligoTableSortLabel-root.Caligo-active{color:var(--cal-text-primary)}@media (hover:hover){.CaligoTableSortLabel-root:hover{color:var(--cal-text-primary)}}.CaligoTableSortLabel-root:focus-visible{box-shadow:var(--cal-focus-ring-sm,var(--cal-focus-ring));border-radius:var(--cal-radius-small)}.CaligoTableSortLabel-icon{opacity:0;width:14px;height:14px;transition:opacity var(--cal-duration-fast), transform var(--cal-duration-fast)}.CaligoTableSortLabel-root:hover .CaligoTableSortLabel-icon{opacity:.5}.CaligoTableSortLabel-root.Caligo-active .CaligoTableSortLabel-icon{opacity:1}.CaligoTableSortLabel-iconDirectionDesc{transform:rotate(180deg)}.CaligoTableRow-legacy{border-bottom:1px solid var(--cal-border-subtle);grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;align-items:center;min-height:44px;font-size:14px;display:grid}.CaligoTableRow-legacy>*{min-width:0;padding:0 8px}}
1
+ @layer caligo{.CaligoTable-root{border-collapse:collapse;border-spacing:0;width:100%;font-family:var(--cal-font-sans);color:var(--cal-text-primary);display:table}.CaligoTableContainer-root{width:100%;overflow-x:auto}.CaligoTableRow-root{color:inherit;vertical-align:middle;outline:0}@media (hover:hover){.CaligoTableRow-hover:hover{background:var(--cal-ghost-hover)}}.CaligoTableRow-root.Caligo-selected{background:var(--cal-state-new-lighter,var(--cal-primary-subtle-bg))}.CaligoTableCell-root{box-sizing:border-box;padding:var(--cal-table-cell-padding-y,12px) 8px;border-bottom:1px solid var(--cal-border-subtle);text-align:start;vertical-align:inherit;font-size:14px;line-height:20px}.CaligoTableCell-sizeSmall{padding:var(--cal-table-cell-padding-y-sm,8px) 8px;font-size:12px;line-height:18px}.CaligoTableCell-paddingCheckbox{padding:0;width:36px;padding-inline-start:4px}.CaligoTableCell-paddingNone{padding:0}.CaligoTableCell-head{background:var(--cal-surface-secondary);color:var(--cal-text-secondary);white-space:nowrap;font-size:12px;font-weight:500;line-height:16px}.CaligoTableCell-stickyHeader{z-index:2;position:sticky;top:0}.CaligoTableCell-footer{color:var(--cal-text-secondary);font-size:12px}.CaligoTableCell-alignRight{text-align:end}.CaligoTableCell-alignCenter{text-align:center}.CaligoTableCell-alignJustify{text-align:justify}.CaligoTableSortLabel-root{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;outline:0;align-items:center;gap:4px;margin:0;padding:0;display:inline-flex}.CaligoTableSortLabel-root.Caligo-active{color:var(--cal-text-primary)}@media (hover:hover){.CaligoTableSortLabel-root:hover{color:var(--cal-text-primary)}}.CaligoTableSortLabel-root:focus-visible{box-shadow:var(--cal-focus-ring-sm,var(--cal-focus-ring));border-radius:var(--cal-radius-small)}.CaligoTableSortLabel-icon{opacity:0;width:14px;height:14px;transition:opacity var(--cal-duration-fast), transform var(--cal-duration-fast)}.CaligoTableSortLabel-root:hover .CaligoTableSortLabel-icon{opacity:.5}.CaligoTableSortLabel-root.Caligo-active .CaligoTableSortLabel-icon{opacity:1}.CaligoTableSortLabel-iconDirectionDesc{transform:rotate(180deg)}.CaligoTableRow-legacy{border-bottom:1px solid var(--cal-border-subtle);grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;align-items:center;min-height:44px;font-size:14px;display:grid}.CaligoTableRow-legacy>*{min-width:0;padding:0 8px}.CaligoTableCell-pinnedStart,.CaligoTableCell-pinnedEnd{z-index:1;background-color:var(--cal-surface-container,var(--cal-surface-primary));position:sticky}.CaligoTableCell-pinnedStart{box-shadow:inset -1px 0 0 var(--cal-border-subtle);inset-inline-start:0}.CaligoTableCell-pinnedEnd{box-shadow:inset 1px 0 0 var(--cal-border-subtle);inset-inline-end:0}:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .CaligoTableCell-pinnedStart{box-shadow:inset 1px 0 0 var(--cal-border-subtle)}:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .CaligoTableCell-pinnedEnd{box-shadow:inset -1px 0 0 var(--cal-border-subtle)}.CaligoTableCell-head:is(.CaligoTableCell-pinnedStart,.CaligoTableCell-pinnedEnd){background-color:var(--cal-surface-secondary)}.CaligoTableCell-stickyHeader:is(.CaligoTableCell-pinnedStart,.CaligoTableCell-pinnedEnd){z-index:3}@media (hover:hover){.CaligoTableRow-hover:hover>:is(.CaligoTableCell-pinnedStart,.CaligoTableCell-pinnedEnd){background-image:linear-gradient(var(--cal-ghost-hover), var(--cal-ghost-hover))}}.CaligoTableRow-root.Caligo-selected>:is(.CaligoTableCell-pinnedStart,.CaligoTableCell-pinnedEnd){background-image:linear-gradient(var(--cal-state-new-lighter,var(--cal-primary-subtle-bg)), var(--cal-state-new-lighter,var(--cal-primary-subtle-bg)))}}
@@ -7,13 +7,13 @@ import * as a from "react";
7
7
  import { jsx as o } from "react/jsx-runtime";
8
8
  // src/TableCell/TableCell.tsx
9
9
  var s = a.forwardRef(function(s, c) {
10
- let { align: l = "inherit", className: u, component: d, padding: f, scope: p, size: m, sortDirection: h, variant: g, ..._ } = e("TableCell", s), v = a.useContext(n), y = a.useContext(i), b = a.useContext(r), x = g ?? (y ? "head" : b ? "footer" : "body"), S = d ?? (x === "head" ? "th" : "td"), C = m ?? v.size, w = f ?? v.padding;
11
- return /* @__PURE__ */ o(S, {
10
+ let { align: l = "inherit", className: u, component: d, padding: f, pinned: p, scope: m, size: h, sortDirection: g, variant: _, ...v } = e("TableCell", s), y = a.useContext(n), b = a.useContext(i), x = a.useContext(r), S = _ ?? (b ? "head" : x ? "footer" : "body"), C = d ?? (S === "head" ? "th" : "td"), w = h ?? y.size, T = f ?? y.padding;
11
+ return /* @__PURE__ */ o(C, {
12
12
  ref: c,
13
- scope: p ?? (S === "th" ? "col" : void 0),
14
- "aria-sort": h ? h === "asc" ? "ascending" : "descending" : void 0,
15
- className: t("CaligoTableCell-root", `CaligoTableCell-${x}`, C === "small" && "CaligoTableCell-sizeSmall", w !== "normal" && `CaligoTableCell-padding${w.charAt(0).toUpperCase()}${w.slice(1)}`, l !== "inherit" && `CaligoTableCell-align${l.charAt(0).toUpperCase()}${l.slice(1)}`, x === "head" && v.stickyHeader && "CaligoTableCell-stickyHeader", u),
16
- ..._
13
+ scope: m ?? (C === "th" ? "col" : void 0),
14
+ "aria-sort": g ? g === "asc" ? "ascending" : "descending" : void 0,
15
+ className: t("CaligoTableCell-root", `CaligoTableCell-${S}`, w === "small" && "CaligoTableCell-sizeSmall", T !== "normal" && `CaligoTableCell-padding${T.charAt(0).toUpperCase()}${T.slice(1)}`, l !== "inherit" && `CaligoTableCell-align${l.charAt(0).toUpperCase()}${l.slice(1)}`, S === "head" && y.stickyHeader && "CaligoTableCell-stickyHeader", p && `CaligoTableCell-pinned${p === "start" ? "Start" : "End"}`, u),
16
+ ...v
17
17
  });
18
18
  });
19
19
  export { s as TableCell };
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.js","names":["React","TableCell","paddingProp","sizeProp","variantProp","other","useDefaultProps","inProps","table","TableContext","inHead","TableHeadContext","inFooter","TableFooterContext","variant","Root","component","size","padding","scope","sortDirection","cx","align","className"],"sources":["../../../src/TableCell/TableCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDefaultProps } from '../internal/defaultProps';\nimport { cx } from '../internal/cx';\nimport { TableContext, TableFooterContext, TableHeadContext } from './tableContext';\nimport '../Table/Table.css';\n\nexport interface TableCellProps extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> {\n /** Text alignment. Set `right` on number columns yourself, in the head cell too; it isn't automatic. `inherit` starts text at the reading-direction start. @default 'inherit' */\n align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';\n /** `td`, or `th` inside TableHead. */\n component?: React.ElementType;\n /** `checkbox` makes a narrow cell for a selection Checkbox; `none` removes the padding. Leave out to use the Table's `padding`. */\n padding?: 'normal' | 'checkbox' | 'none';\n /** `small` gives tighter padding and smaller text. Leave out to use the Table's `size`. */\n size?: 'small' | 'medium';\n /** Sets aria-sort on a header cell. */\n sortDirection?: 'asc' | 'desc' | false;\n /** `head` inside TableHead, `footer` inside TableFooter, otherwise `body`. */\n variant?: 'head' | 'body' | 'footer';\n}\n\n/** One cell. Follows Material UI's `TableCell` API; inside TableHead it's a `th` with scope=\"col\". */\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(inProps, ref) {\n const props = useDefaultProps('TableCell', inProps);\n const { align = 'inherit', className, component, padding: paddingProp, scope, size: sizeProp, sortDirection, variant: variantProp, ...other } = props;\n const table = React.useContext(TableContext);\n const inHead = React.useContext(TableHeadContext);\n const inFooter = React.useContext(TableFooterContext);\n const variant = variantProp ?? (inHead ? 'head' : inFooter ? 'footer' : 'body');\n const Root: React.ElementType = component ?? (variant === 'head' ? 'th' : 'td');\n const size = sizeProp ?? table.size;\n const padding = paddingProp ?? table.padding;\n return (\n <Root\n ref={ref}\n scope={scope ?? (Root === 'th' ? 'col' : undefined)}\n aria-sort={sortDirection ? (sortDirection === 'asc' ? 'ascending' : 'descending') : undefined}\n className={cx(\n 'CaligoTableCell-root', `CaligoTableCell-${variant}`, size === 'small' && 'CaligoTableCell-sizeSmall',\n padding !== 'normal' && `CaligoTableCell-padding${padding.charAt(0).toUpperCase()}${padding.slice(1)}`,\n align !== 'inherit' && `CaligoTableCell-align${align.charAt(0).toUpperCase()}${align.slice(1)}`,\n variant === 'head' && table.stickyHeader && 'CaligoTableCell-stickyHeader', className,\n )}\n {...other}\n />\n );\n});\n"],"mappings":";;;;;;;;AAsBA,IAAaC,IAAYD,EAAM,WAAiD,SAAmB,GAAS,GAAK;CAE/G,IAAM,EAAE,WAAQ,WAAW,cAAW,cAAW,SAASE,GAAa,UAAO,MAAMC,GAAU,kBAAe,SAASC,GAAa,GAAGC,MADxHC,EAAgB,aAAaC,CACqG,GAC1IC,IAAQR,EAAM,WAAWS,CAAY,GACrCC,IAASV,EAAM,WAAWW,CAAgB,GAC1CC,IAAWZ,EAAM,WAAWa,CAAkB,GAC9CC,IAAUV,MAAgBM,IAAS,SAASE,IAAW,WAAW,SAClEG,IAA0BC,MAAcF,MAAY,SAAS,OAAO,OACpEG,IAAOd,KAAYK,EAAM,MACzBU,IAAUhB,KAAeM,EAAM;CACrC,OACE,kBAACO,GAAD;EACO;EACL,OAAOI,MAAUJ,MAAS,OAAO,QAAQ,KAAA;EACzC,aAAWK,IAAiBA,MAAkB,QAAQ,cAAc,eAAgB,KAAA;EACpF,WAAWC,EACT,wBAAwB,mBAAmBP,KAAWG,MAAS,WAAW,6BAC1EC,MAAY,YAAY,0BAA0BA,EAAQ,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAQ,MAAM,CAAC,KACnGI,MAAU,aAAa,wBAAwBA,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAM,MAAM,CAAC,KAC5FR,MAAY,UAAUN,EAAM,gBAAgB,gCAAgCe,CAC9E;EACA,GAAIlB;CACL,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"TableCell.js","names":["React","TableCell","paddingProp","sizeProp","variantProp","other","useDefaultProps","inProps","table","TableContext","inHead","TableHeadContext","inFooter","TableFooterContext","variant","Root","component","size","padding","scope","sortDirection","cx","align","pinned","className"],"sources":["../../../src/TableCell/TableCell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useDefaultProps } from '../internal/defaultProps';\nimport { cx } from '../internal/cx';\nimport { TableContext, TableFooterContext, TableHeadContext } from './tableContext';\nimport '../Table/Table.css';\n\nexport interface TableCellProps extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> {\n /** Text alignment. Set `right` on number columns yourself, in the head cell too; it isn't automatic. `inherit` starts text at the reading-direction start. @default 'inherit' */\n align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';\n /** `td`, or `th` inside TableHead. */\n component?: React.ElementType;\n /** `checkbox` makes a narrow cell for a selection Checkbox; `none` removes the padding. Leave out to use the Table's `padding`. */\n padding?: 'normal' | 'checkbox' | 'none';\n /** `small` gives tighter padding and smaller text. Leave out to use the Table's `size`. */\n size?: 'small' | 'medium';\n /**\n * Caligo extra: keeps the cell in place while the table scrolls sideways, at the `start` or `end` edge, as a pinned\n * first or last column. Pin the same column's head and body cells; with several pinned, set each one's\n * `style.insetInlineStart` (or End) to the widths before it.\n */\n pinned?: 'start' | 'end';\n /** Sets aria-sort on a header cell. */\n sortDirection?: 'asc' | 'desc' | false;\n /** `head` inside TableHead, `footer` inside TableFooter, otherwise `body`. */\n variant?: 'head' | 'body' | 'footer';\n}\n\n/** One cell. Follows Material UI's `TableCell` API; inside TableHead it's a `th` with scope=\"col\". */\nexport const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(inProps, ref) {\n const props = useDefaultProps('TableCell', inProps);\n const { align = 'inherit', className, component, padding: paddingProp, pinned, scope, size: sizeProp, sortDirection, variant: variantProp, ...other } = props;\n const table = React.useContext(TableContext);\n const inHead = React.useContext(TableHeadContext);\n const inFooter = React.useContext(TableFooterContext);\n const variant = variantProp ?? (inHead ? 'head' : inFooter ? 'footer' : 'body');\n const Root: React.ElementType = component ?? (variant === 'head' ? 'th' : 'td');\n const size = sizeProp ?? table.size;\n const padding = paddingProp ?? table.padding;\n return (\n <Root\n ref={ref}\n scope={scope ?? (Root === 'th' ? 'col' : undefined)}\n aria-sort={sortDirection ? (sortDirection === 'asc' ? 'ascending' : 'descending') : undefined}\n className={cx(\n 'CaligoTableCell-root', `CaligoTableCell-${variant}`, size === 'small' && 'CaligoTableCell-sizeSmall',\n padding !== 'normal' && `CaligoTableCell-padding${padding.charAt(0).toUpperCase()}${padding.slice(1)}`,\n align !== 'inherit' && `CaligoTableCell-align${align.charAt(0).toUpperCase()}${align.slice(1)}`,\n variant === 'head' && table.stickyHeader && 'CaligoTableCell-stickyHeader', pinned && `CaligoTableCell-pinned${pinned === 'start' ? 'Start' : 'End'}`, className,\n )}\n {...other}\n />\n );\n});\n"],"mappings":";;;;;;;;AA4BA,IAAaC,IAAYD,EAAM,WAAiD,SAAmB,GAAS,GAAK;CAE/G,IAAM,EAAE,WAAQ,WAAW,cAAW,cAAW,SAASE,GAAa,WAAQ,UAAO,MAAMC,GAAU,kBAAe,SAASC,GAAa,GAAGC,MADhIC,EAAgB,aAAaC,CAC6G,GAClJC,IAAQR,EAAM,WAAWS,CAAY,GACrCC,IAASV,EAAM,WAAWW,CAAgB,GAC1CC,IAAWZ,EAAM,WAAWa,CAAkB,GAC9CC,IAAUV,MAAgBM,IAAS,SAASE,IAAW,WAAW,SAClEG,IAA0BC,MAAcF,MAAY,SAAS,OAAO,OACpEG,IAAOd,KAAYK,EAAM,MACzBU,IAAUhB,KAAeM,EAAM;CACrC,OACE,kBAACO,GAAD;EACO;EACL,OAAOI,MAAUJ,MAAS,OAAO,QAAQ,KAAA;EACzC,aAAWK,IAAiBA,MAAkB,QAAQ,cAAc,eAAgB,KAAA;EACpF,WAAWC,EACT,wBAAwB,mBAAmBP,KAAWG,MAAS,WAAW,6BAC1EC,MAAY,YAAY,0BAA0BA,EAAQ,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAQ,MAAM,CAAC,KACnGI,MAAU,aAAa,wBAAwBA,EAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAM,MAAM,CAAC,KAC5FR,MAAY,UAAUN,EAAM,gBAAgB,gCAAgCe,KAAU,yBAAyBA,MAAW,UAAU,UAAU,SAASC,CACzJ;EACA,GAAInB;CACL,CAAA;AAEL,CAAC"}
@@ -1 +1 @@
1
- @layer caligo{.CaligoTabs-root{min-width:0;font-family:var(--cal-font-sans);font-size:14px;line-height:20px;display:flex;overflow:hidden}.CaligoTabs-scroller{flex:auto;min-width:0;overflow:hidden}.CaligoTabs-scrollable .CaligoTabs-scroller{scrollbar-width:none;overflow-x:auto}.CaligoTabs-flexContainer{isolation:isolate;display:flex;position:relative}.CaligoTabs-vertical .CaligoTabs-flexContainer{flex-direction:column;align-items:stretch}.CaligoTabs-centered .CaligoTabs-flexContainer{justify-content:center}.CaligoTabs-fullWidth .CaligoTab-root{flex:1 1 0}.CaligoTabs-underline .CaligoTabs-flexContainer{gap:var(--cal-tabs-gap-sm,4px);border-bottom:1px solid var(--cal-border-subtle)}.CaligoTabs-underline.CaligoTabs-vertical .CaligoTabs-flexContainer{border-bottom:0;border-inline-end:1px solid var(--cal-border-subtle)}.CaligoTabs-underline .CaligoTab-root{border-bottom:2px solid #0000;margin-bottom:-1px}.CaligoTabs-underline.CaligoTabs-vertical .CaligoTab-root{border-bottom:0;margin:0;border-inline-end:2px solid #0000;justify-content:flex-start;margin-inline-end:-1px}.CaligoTabs-pill .CaligoTabs-flexContainer{border-radius:calc(var(--cal-radius-component) + min(var(--cal-radius-component) * 1000, 4px));background:var(--cal-bg-tertiary);gap:4px;padding:4px}.CaligoTabs-pill .CaligoTab-root{border-radius:var(--cal-radius-component);border:1px solid #0000;flex:1}.CaligoTabs-indicator{z-index:-1;pointer-events:none;opacity:0;position:absolute;top:0;left:0}.CaligoTabs-flexContainer[data-indicator]>.CaligoTabs-indicator{opacity:1}.CaligoTabs-flexContainer[data-indicator=ready]>.CaligoTabs-indicator{transition-property:transform,width,height;transition-duration:var(--cal-motion-select,.22s);transition-timing-function:var(--cal-ease-select,cubic-bezier(.2, 0, 0, 1))}.CaligoTabs-pill .CaligoTabs-indicator{width:var(--_iw);height:var(--_ih);transform:translate(var(--_ix), var(--_iy));border-radius:var(--cal-radius-component);background:var(--lightningcss-light,var(--cal-surface-primary))var(--lightningcss-dark,color-mix(in oklab, var(--cal-surface-primary), #fff 12%));box-shadow:var(--cal-shadow-xs), 0 0 0 1px var(--lightningcss-light,#0a0a0f0a)var(--lightningcss-dark,#ffffff14)}.CaligoTabs-underline .CaligoTabs-indicator{width:var(--_iw);height:2px;transform:translate(var(--_ix), calc(var(--_iy) + var(--_ih) - 2px));background:var(--cal-text-primary);z-index:1;border-radius:2px}.CaligoTabs-underline.CaligoTabs-vertical .CaligoTabs-indicator{width:2px;height:var(--_ih);transform:translate(calc(var(--_ix) + var(--_iw) - 2px), var(--_iy))}@media (prefers-reduced-motion:reduce){.CaligoTabs-indicator{transition:none!important}}}
1
+ @layer caligo{.CaligoTabs-root{min-width:0;font-family:var(--cal-font-sans);font-size:var(--cal-tabs-font-size,14px);line-height:20px;display:flex;overflow:hidden}.CaligoTabs-scroller{flex:auto;min-width:0;overflow:hidden}.CaligoTabs-scrollable .CaligoTabs-scroller{scrollbar-width:none;overflow-x:auto}.CaligoTabs-flexContainer{isolation:isolate;display:flex;position:relative}.CaligoTabs-vertical .CaligoTabs-flexContainer{flex-direction:column;align-items:stretch}.CaligoTabs-centered .CaligoTabs-flexContainer{justify-content:center}.CaligoTabs-fullWidth .CaligoTab-root{flex:1 1 0}.CaligoTabs-underline .CaligoTabs-flexContainer{gap:var(--cal-tabs-gap-sm,4px);border-bottom:1px solid var(--cal-border-subtle)}.CaligoTabs-underline.CaligoTabs-vertical .CaligoTabs-flexContainer{border-bottom:0;border-inline-end:1px solid var(--cal-border-subtle)}.CaligoTabs-underline .CaligoTab-root{border-bottom:2px solid #0000;margin-bottom:-1px}.CaligoTabs-underline.CaligoTabs-vertical .CaligoTab-root{border-bottom:0;margin:0;border-inline-end:2px solid #0000;justify-content:flex-start;margin-inline-end:-1px}.CaligoTabs-pill .CaligoTabs-flexContainer{--_pad:var(--cal-tabs-track-padding,4px);--_inner:max(2px, calc(var(--cal-radius-component) - var(--_pad)));gap:var(--_pad);padding:var(--_pad);border-radius:var(--cal-radius-component);background:var(--cal-bg-tertiary)}.CaligoTabs-pill .CaligoTab-root{border-radius:var(--_inner,var(--cal-radius-component));border:1px solid #0000;flex:1;min-width:max-content}.CaligoTabs-indicator{z-index:-1;pointer-events:none;opacity:0;position:absolute;top:0;left:0}.CaligoTabs-flexContainer[data-indicator]>.CaligoTabs-indicator{opacity:1}.CaligoTabs-flexContainer[data-indicator=ready]>.CaligoTabs-indicator{transition-property:transform,width,height;transition-duration:var(--cal-motion-select,.22s);transition-timing-function:var(--cal-ease-select,cubic-bezier(.2, 0, 0, 1))}.CaligoTabs-pill .CaligoTabs-indicator{width:var(--_iw);height:var(--_ih);transform:translate(var(--_ix), var(--_iy));border-radius:var(--_inner,var(--cal-radius-component));background:var(--lightningcss-light,var(--cal-surface-primary))var(--lightningcss-dark,color-mix(in oklab, var(--cal-surface-primary), #fff 12%));box-shadow:var(--cal-shadow-xs), 0 0 0 1px var(--lightningcss-light,#0a0a0f0a)var(--lightningcss-dark,#ffffff14)}.CaligoTabs-pill .CaligoTabs-indicator:not(:where([data-style] *)){background:linear-gradient(180deg, var(--cal-surface-primary), var(--cal-tertiary-default));box-shadow:inset 0 0 0 1px color-mix(in oklab, var(--cal-text-primary) 14%, transparent), var(--cal-raise)}.CaligoTabs-underline .CaligoTabs-indicator{width:var(--_iw);height:2px;transform:translate(var(--_ix), calc(var(--_iy) + var(--_ih) - 2px));background:var(--cal-text-primary);z-index:1;border-radius:2px}.CaligoTabs-underline.CaligoTabs-vertical .CaligoTabs-indicator{width:2px;height:var(--_ih);transform:translate(calc(var(--_ix) + var(--_iw) - 2px), var(--_iy))}@media (prefers-reduced-motion:reduce){.CaligoTabs-indicator{transition:none!important}}}
@@ -1 +1 @@
1
- @layer caligo{.CaligoTextField-root{gap:var(--cal-input-label-gap);box-sizing:border-box;width:320px;min-width:0;max-width:100%;font-family:var(--cal-font-sans);vertical-align:top;flex-direction:column;margin:0;display:inline-flex}.CaligoTextField-fullWidth{width:100%;display:flex}.CaligoTextField-root.Caligo-disabled{opacity:var(--cal-opacity-disabled,.5)}.CaligoTextField-label{color:var(--cal-text-primary);font-size:14px;font-weight:500;line-height:18px}.CaligoTextField-sizeXsmall .CaligoTextField-label,.CaligoTextField-sizeSmall .CaligoTextField-label{font-size:12px;line-height:16px}.CaligoTextField-asterisk{color:var(--cal-error-subtle-text)}.CaligoTextField-inputRoot{box-sizing:border-box;align-items:center;gap:var(--cal-input-gap);height:var(--cal-input-height-md);padding:0 var(--cal-input-padding-x-md);border-radius:var(--cal-input-radius-md);color:var(--cal-icon-secondary);cursor:text;transition:border-color var(--cal-duration-fast) var(--cal-ease-in-out), box-shadow var(--cal-duration-fast) var(--cal-ease-in-out);border:1px solid #0000;display:flex;position:relative}.CaligoTextField-inputRoot:after{content:"";border-radius:inherit;background:var(--cal-stroke-field);pointer-events:none;-webkit-mask-composite:xor;padding:1px;position:absolute;inset:-1px;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor,source-over;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}.CaligoTextField-sizeXsmall .CaligoTextField-inputRoot{height:var(--cal-input-height-xs);padding:0 var(--cal-input-padding-x-xs)}.CaligoTextField-sizeSmall .CaligoTextField-inputRoot{height:var(--cal-input-height-sm);padding:0 var(--cal-input-padding-x-sm)}.CaligoTextField-sizeLarge .CaligoTextField-inputRoot{height:var(--cal-input-height-lg);padding:0 var(--cal-input-padding-x-lg)}.CaligoTextField-multiline .CaligoTextField-inputRoot{align-items:flex-start;height:auto}.CaligoTextField-input{min-width:0;font:inherit;color:var(--cal-text-primary);background:0 0;border:0;outline:0;flex:1;margin:0;padding:0;font-size:14px;line-height:20px}.CaligoTextField-input::placeholder{color:var(--cal-text-placeholder);opacity:1}.CaligoTextField-input:disabled{color:var(--cal-text-disabled);cursor:not-allowed}textarea.CaligoTextField-input{resize:vertical;min-height:40px;padding:10px 0}.CaligoTextField-startAdornment,.CaligoTextField-endAdornment{flex:none;align-items:center;display:inline-flex}.CaligoTextField-startAdornment svg,.CaligoTextField-endAdornment svg{width:16px;height:16px}.CaligoTextField-helperText{align-items:center;gap:var(--cal-input-helper-gap);color:var(--cal-text-secondary);letter-spacing:.12px;margin:0;font-size:12px;line-height:16px;display:flex}.CaligoTextField-helperText.Caligo-error{color:var(--cal-error-subtle-text)}.CaligoTextField-helperText.Caligo-error:before{content:"";vertical-align:-2px;margin-inline-end:0;background:currentColor;flex:none;align-self:flex-start;width:14px;height:14px;margin-top:1px;display:inline-block;-webkit-mask:url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27%23000%27%20stroke-width=%272%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M3%2012a9%209%200%201%200%2018%200a9%209%200%201%200%20-18%200%27/%3E%3Cpath%20d=%27M12%208v4%27/%3E%3Cpath%20d=%27M12%2016h.01%27/%3E%3C/svg%3E) 50%/contain no-repeat;mask:url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27%23000%27%20stroke-width=%272%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M3%2012a9%209%200%201%200%2018%200a9%209%200%201%200%20-18%200%27/%3E%3Cpath%20d=%27M12%208v4%27/%3E%3Cpath%20d=%27M12%2016h.01%27/%3E%3C/svg%3E) 50%/contain no-repeat}.CaligoTextField-helperText.Caligo-disabled{color:var(--cal-text-disabled)}.CaligoTextField-outlined .CaligoTextField-inputRoot{background:var(--cal-surface-primary);border-color:var(--cal-component-input-border);box-shadow:var(--cal-shadow-xs)}@media (hover:hover){.CaligoTextField-outlined .CaligoTextField-inputRoot:hover{border-color:var(--cal-border-strong)}}.CaligoTextField-outlined .CaligoTextField-inputRoot.Caligo-focused{border-color:var(--cal-primary-default)}.CaligoTextField-outlined.Caligo-disabled .CaligoTextField-inputRoot{background:var(--cal-bg-secondary);box-shadow:none}.CaligoTextField-filled .CaligoTextField-inputRoot{background:var(--cal-bg-secondary);box-shadow:var(--cal-shadow-xs)}@media (hover:hover){.CaligoTextField-filled .CaligoTextField-inputRoot:hover{border-bottom-color:var(--cal-component-input-border)}}.CaligoTextField-filled .CaligoTextField-inputRoot.Caligo-focused{box-shadow:var(--cal-focus-ring)}.CaligoTextField-filled.Caligo-disabled .CaligoTextField-inputRoot{box-shadow:none}.CaligoTextField-standard .CaligoTextField-inputRoot{border-bottom-color:var(--cal-border-primary);border-radius:0;padding-inline:0}.CaligoTextField-standard .CaligoTextField-inputRoot:after{display:none}@media (hover:hover){.CaligoTextField-standard .CaligoTextField-inputRoot:hover{border-bottom-color:var(--cal-border-strong)}}.CaligoTextField-standard .CaligoTextField-inputRoot.Caligo-focused{border-bottom-color:var(--cal-primary-default)}.CaligoTextField-inputRoot.Caligo-error{border-color:var(--cal-error-default)}@media (hover:hover){.CaligoTextField-inputRoot.Caligo-error:hover{border-color:var(--cal-error-default)}}.CaligoTextField-inputRoot.Caligo-error:after{display:none}.CaligoTextField-filled .CaligoTextField-inputRoot.Caligo-error,.CaligoTextField-standard .CaligoTextField-inputRoot.Caligo-error{border-color:#0000;border-bottom-color:var(--cal-error-default)}.CaligoTextField-outlined .CaligoTextField-inputRoot:focus-within{border-color:var(--cal-primary-default)}.CaligoTextField-inputRoot:has(:focus-visible){box-shadow:var(--cal-focus-ring-sm,var(--cal-focus-ring))}}
1
+ @layer caligo{.CaligoTextField-root{gap:var(--cal-input-label-gap);box-sizing:border-box;width:320px;min-width:0;max-width:100%;font-family:var(--cal-font-sans);vertical-align:top;flex-direction:column;margin:0;display:inline-flex}.CaligoTextField-fullWidth{width:100%;display:flex}.CaligoTextField-root.Caligo-disabled .CaligoTextField-label{color:var(--cal-text-secondary)}.CaligoTextField-description{margin:calc(var(--cal-input-label-gap) * -.5) 0 0;color:var(--cal-text-secondary);font-size:12px;line-height:16px}.CaligoTextField-horizontal{grid-template-columns:var(--cal-field-label-width,minmax(0, 1fr)) minmax(0, 2fr);align-items:start;gap:4px 16px;width:100%;display:grid}.CaligoTextField-horizontal>.CaligoTextField-label{padding-top:calc((var(--cal-input-height-md) - 18px) / 2);grid-column:1}.CaligoTextField-horizontal.CaligoTextField-sizeSmall>.CaligoTextField-label{padding-top:calc((var(--cal-input-height-sm) - 18px) / 2)}.CaligoTextField-horizontal.CaligoTextField-sizeXsmall>.CaligoTextField-label{padding-top:calc((var(--cal-input-height-xs) - 18px) / 2)}.CaligoTextField-horizontal.CaligoTextField-sizeLarge>.CaligoTextField-label{padding-top:calc((var(--cal-input-height-lg) - 18px) / 2)}.CaligoTextField-horizontal>.CaligoTextField-description{grid-column:1;margin:0}.CaligoTextField-horizontal>.CaligoTextField-inputRoot{grid-area:1/2/span 2;align-self:start}.CaligoTextField-horizontal>.CaligoTextField-helperText{grid-column:2}@media (width<=599.95px){.CaligoTextField-horizontal{grid-template-columns:minmax(0,1fr)}.CaligoTextField-horizontal>:is(.CaligoTextField-label,.CaligoTextField-description,.CaligoTextField-inputRoot,.CaligoTextField-helperText){grid-area:auto/1;padding-top:0}}.CaligoTextField-label{color:var(--cal-text-primary);font-size:var(--cal-field-label-font-size,14px);font-weight:500;line-height:18px}.CaligoTextField-asterisk{color:var(--cal-error-subtle-text)}.CaligoTextField-inputRoot{box-sizing:border-box;align-items:center;gap:var(--cal-input-gap);height:var(--cal-input-height-md);padding:0 var(--cal-input-padding-x-md);border-radius:var(--cal-input-radius-md);color:var(--cal-icon-secondary);cursor:text;transition:border-color var(--cal-duration-fast) var(--cal-ease-in-out), box-shadow var(--cal-duration-fast) var(--cal-ease-in-out);border:1px solid #0000;display:flex;position:relative}.CaligoTextField-inputRoot:after{content:"";border-radius:inherit;background:var(--cal-stroke-field);pointer-events:none;-webkit-mask-composite:xor;padding:1px;position:absolute;inset:-1px;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor,source-over;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}.CaligoTextField-sizeXsmall .CaligoTextField-inputRoot{height:var(--cal-input-height-xs);padding:0 var(--cal-input-padding-x-xs)}.CaligoTextField-sizeSmall .CaligoTextField-inputRoot{height:var(--cal-input-height-sm);padding:0 var(--cal-input-padding-x-sm)}.CaligoTextField-sizeLarge .CaligoTextField-inputRoot{height:var(--cal-input-height-lg);padding:0 var(--cal-input-padding-x-lg)}.CaligoTextField-multiline .CaligoTextField-inputRoot{align-items:flex-start;height:auto}.CaligoTextField-input{min-width:0;font:inherit;font-size:var(--cal-input-font-size,14px);color:var(--cal-text-primary);background:0 0;border:0;outline:0;flex:1;margin:0;padding:0;line-height:20px}.CaligoTextField-input::placeholder{color:var(--cal-text-placeholder);opacity:1}.CaligoTextField-input:disabled{color:var(--cal-text-disabled);cursor:not-allowed}textarea.CaligoTextField-input{resize:vertical;min-height:40px;padding:10px 0}.CaligoTextField-startAdornment,.CaligoTextField-endAdornment{flex:none;align-items:center;display:inline-flex}.CaligoTextField-startAdornment svg,.CaligoTextField-endAdornment svg{width:16px;height:16px}.CaligoTextField-helperText{align-items:center;gap:var(--cal-input-helper-gap);color:var(--cal-text-secondary);letter-spacing:.12px;margin:0;font-size:12px;line-height:16px;display:flex}.CaligoTextField-helperText.Caligo-error{color:var(--cal-error-subtle-text)}.CaligoTextField-helperText.Caligo-error:before{content:"";vertical-align:-2px;margin-inline-end:0;background:currentColor;flex:none;align-self:flex-start;width:14px;height:14px;margin-top:1px;display:inline-block;-webkit-mask:url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27%23000%27%20stroke-width=%272%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M3%2012a9%209%200%201%200%2018%200a9%209%200%201%200%20-18%200%27/%3E%3Cpath%20d=%27M12%208v4%27/%3E%3Cpath%20d=%27M12%2016h.01%27/%3E%3C/svg%3E) 50%/contain no-repeat;mask:url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27%23000%27%20stroke-width=%272%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M3%2012a9%209%200%201%200%2018%200a9%209%200%201%200%20-18%200%27/%3E%3Cpath%20d=%27M12%208v4%27/%3E%3Cpath%20d=%27M12%2016h.01%27/%3E%3C/svg%3E) 50%/contain no-repeat}.CaligoTextField-helperText.Caligo-disabled{color:var(--cal-text-disabled)}.CaligoTextField-outlined .CaligoTextField-inputRoot{background:var(--cal-surface-primary);border-color:var(--cal-component-input-border);box-shadow:var(--cal-shadow-xs)}@media (hover:hover){.CaligoTextField-outlined .CaligoTextField-inputRoot:hover{border-color:var(--cal-border-strong)}}.CaligoTextField-outlined .CaligoTextField-inputRoot.Caligo-focused{border-color:var(--cal-primary-default)}.CaligoTextField-outlined.Caligo-disabled .CaligoTextField-inputRoot{background:var(--cal-bg-secondary);box-shadow:none}.CaligoTextField-filled .CaligoTextField-inputRoot{background:var(--cal-bg-secondary);box-shadow:var(--cal-shadow-xs)}@media (hover:hover){.CaligoTextField-filled .CaligoTextField-inputRoot:hover{border-bottom-color:var(--cal-component-input-border)}}.CaligoTextField-filled .CaligoTextField-inputRoot.Caligo-focused{box-shadow:var(--cal-focus-halo,var(--cal-focus-ring))}.CaligoTextField-filled.Caligo-disabled .CaligoTextField-inputRoot{box-shadow:none}.CaligoTextField-standard .CaligoTextField-inputRoot{border-bottom-color:var(--cal-border-primary);border-radius:0;padding-inline:0}.CaligoTextField-standard .CaligoTextField-inputRoot:after{display:none}@media (hover:hover){.CaligoTextField-standard .CaligoTextField-inputRoot:hover{border-bottom-color:var(--cal-border-strong)}}.CaligoTextField-standard .CaligoTextField-inputRoot.Caligo-focused{border-bottom-color:var(--cal-primary-default)}.CaligoTextField-inputRoot.Caligo-error{border-color:var(--cal-error-default)}@media (hover:hover){.CaligoTextField-inputRoot.Caligo-error:hover{border-color:var(--cal-error-default)}}.CaligoTextField-inputRoot.Caligo-error:after{display:none}.CaligoTextField-filled .CaligoTextField-inputRoot.Caligo-error,.CaligoTextField-standard .CaligoTextField-inputRoot.Caligo-error{border-color:#0000;border-bottom-color:var(--cal-error-default)}.CaligoTextField-outlined .CaligoTextField-inputRoot:focus-within{border-color:var(--cal-primary-default)}.CaligoTextField-standard .CaligoTextField-inputRoot:focus-within{border-bottom-color:var(--cal-primary-default)}button.CaligoTextField-inputRoot{width:100%;font:inherit;font-size:var(--cal-input-font-size,14px);text-align:start;color:var(--cal-text-primary);cursor:pointer;line-height:20px}.CaligoTextField-ghost .CaligoTextField-inputRoot{box-shadow:none;background:0 0;border-color:#0000}.CaligoTextField-ghost .CaligoTextField-inputRoot:after{display:none}@media (hover:hover){.CaligoTextField-ghost .CaligoTextField-inputRoot:hover:not(.Caligo-disabled){background:var(--cal-ghost-hover)}}.CaligoTextField-ghost .CaligoTextField-inputRoot:is([data-popup-open],[aria-expanded=true]){background:var(--cal-ghost-pressed)}.CaligoTextField-ghost .CaligoTextField-inputRoot:focus-within{border-color:#0000}button.CaligoTextField-inputRoot:focus-visible{border-color:var(--cal-primary-default);box-shadow:var(--cal-focus-halo,var(--cal-focus-ring));outline:0}.CaligoTextField-inputRoot:has(:focus-visible){box-shadow:var(--cal-focus-halo,var(--cal-focus-ring-sm,var(--cal-focus-ring)))}}
@@ -15,156 +15,176 @@ function ne(e, t) {
15
15
  typeof e == "function" ? e(t) : e && (e.current = t);
16
16
  }
17
17
  var u = s.forwardRef(function(u, d) {
18
- let { autoComplete: re, autoFocus: ie, children: ae, classes: oe, className: f, defaultValue: p, disabled: m, error: se, fullWidth: h = !1, helperText: g, id: _, inputRef: v, label: y, multiline: b = !1, name: x, onBlur: S, onChange: C, onFocus: ce, placeholder: w, required: T, select: le = !1, rows: E, minRows: ue, maxRows: D, size: O, slotProps: k = {}, type: de, value: A, variant: j = "outlined", ...M } = e("TextField", u), N = a(), P = m ?? N?.disabled ?? !1, F = se ?? N?.error ?? !1, I = T ?? N?.required ?? !1, L = O ?? N?.size ?? "medium", R = s.useId(), z = _ ?? `caligo-textfield-${R.replace(/:/g, "")}`, B = g == null ? void 0 : `${z}-helper-text`, V = y == null ? void 0 : `${z}-label`, [H, U] = s.useState(!1), W = b && E == null, G = ue ?? 3, K = s.useRef(null), [fe, pe] = s.useState(G), [me, he] = s.useState(!1), q = s.useCallback(() => {
19
- let e = K.current;
20
- if (!e || !W) return;
18
+ let { autoComplete: re, autoFocus: ie, children: ae, classes: oe, className: f, defaultValue: p, description: m, disabled: se, error: h, fullWidth: g = !1, helperText: _, id: v, inputRef: y, label: b, multiline: x = !1, name: S, onBlur: ce, onChange: C, onFocus: le, orientation: w = "vertical", placeholder: T, required: ue, select: de = !1, rows: E, minRows: fe, maxRows: D, size: pe, slotProps: O = {}, type: me, value: k, variant: A = "outlined", ...j } = e("TextField", u), M = a(), N = se ?? M?.disabled ?? !1, P = h ?? M?.error ?? !1, F = ue ?? M?.required ?? !1, I = pe ?? M?.size ?? "medium", L = s.useId(), R = v ?? `caligo-textfield-${L.replace(/:/g, "")}`, z = _ == null ? void 0 : `${R}-helper-text`, B = m == null ? void 0 : `${R}-description`, he = b == null ? void 0 : `${R}-label`, [V, H] = s.useState(!1), U = x && E == null, W = fe ?? 3, G = s.useRef(null), [ge, _e] = s.useState(W), [ve, ye] = s.useState(!1), K = s.useCallback(() => {
19
+ let e = G.current;
20
+ if (!e || !U) return;
21
21
  let t = e.rows;
22
22
  e.rows = 1;
23
23
  let n = window.getComputedStyle(e), r = (parseFloat(n.paddingTop) || 0) + (parseFloat(n.paddingBottom) || 0), i = parseFloat(n.lineHeight) || te, a = Math.ceil(Math.max(0, e.scrollHeight - r) / i);
24
24
  e.rows = t;
25
25
  let o = D ?? Infinity;
26
- pe(Math.max(G, Math.min(o, a))), he(a > o);
26
+ _e(Math.max(W, Math.min(o, a))), ye(a > o);
27
27
  }, [
28
+ U,
28
29
  W,
29
- G,
30
30
  D
31
31
  ]);
32
32
  if (s.useLayoutEffect(() => {
33
- q();
34
- }, [q, A]), le) return /* @__PURE__ */ c(o, {
33
+ K();
34
+ }, [K, k]), s.useEffect(() => {
35
+ let e = G.current;
36
+ if (!e || !U) return;
37
+ let t = e.clientWidth, n = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
38
+ e.clientWidth !== t && (t = e.clientWidth, K());
39
+ });
40
+ n?.observe(e);
41
+ let r = !0;
42
+ return document.fonts?.ready.then(() => {
43
+ r && K();
44
+ }).catch(() => {}), () => {
45
+ r = !1, n?.disconnect();
46
+ };
47
+ }, [U, K]), de) return /* @__PURE__ */ c(o, {
35
48
  ref: d,
36
- ...M,
37
- ...k.select,
49
+ ...j,
50
+ ...O.select,
38
51
  className: t("CaligoTextField-select", f),
39
- id: _,
40
- name: x,
41
- label: y,
42
- helperText: g,
43
- error: F,
44
- required: I,
45
- disabled: P,
46
- fullWidth: h,
47
- size: L,
48
- variant: j,
49
- ...A === void 0 ? null : { value: A },
52
+ id: v,
53
+ name: S,
54
+ label: b,
55
+ helperText: _,
56
+ error: P,
57
+ required: F,
58
+ disabled: N,
59
+ fullWidth: g,
60
+ size: I,
61
+ variant: A,
62
+ ...k === void 0 ? null : { value: k },
50
63
  ...p === void 0 ? null : { defaultValue: p },
51
- ...v ? { inputRef: v } : null,
52
- placeholder: w,
64
+ ...y ? { inputRef: y } : null,
65
+ placeholder: T,
53
66
  onChange: (e) => C?.(e),
54
67
  children: ae
55
68
  });
56
- let J = r({
69
+ let q = r({
57
70
  root: [
58
71
  "root",
59
- j,
60
- `size${n(L)}`,
61
- h && "fullWidth",
62
- b && "multiline",
63
- P && "disabled",
64
- F && "error",
65
- H && "focused",
66
- I && "required"
72
+ A,
73
+ `size${n(I)}`,
74
+ g && "fullWidth",
75
+ x && "multiline",
76
+ w === "horizontal" && "horizontal",
77
+ N && "disabled",
78
+ P && "error",
79
+ V && "focused",
80
+ F && "required"
67
81
  ],
68
82
  label: [
69
83
  "label",
70
- F && "error",
71
- P && "disabled",
72
- H && "focused",
73
- I && "required"
84
+ P && "error",
85
+ N && "disabled",
86
+ V && "focused",
87
+ F && "required"
74
88
  ],
75
89
  asterisk: ["asterisk"],
76
90
  inputRoot: [
77
91
  "inputRoot",
78
- H && "focused",
79
- F && "error",
80
- P && "disabled"
92
+ V && "focused",
93
+ P && "error",
94
+ N && "disabled"
81
95
  ],
82
96
  input: ["input"],
83
97
  startAdornment: ["startAdornment"],
84
98
  endAdornment: ["endAdornment"],
85
99
  helperText: [
86
100
  "helperText",
87
- F && "error",
88
- P && "disabled"
89
- ]
90
- }, ee, oe), { startAdornment: Y, endAdornment: X, ...ge } = k.input ?? {}, Z = k.htmlInput ?? {}, _e = (e) => {
91
- U(!0), Z.onFocus?.(e), ce?.(e);
92
- }, ve = (e) => {
93
- U(!1), Z.onBlur?.(e), S?.(e);
94
- }, ye = (e) => {
95
- Z.onChange?.(e), C?.(e), A === void 0 && q();
96
- }, be = t(Z["aria-describedby"], B) || void 0, Q = i({
97
- id: z,
98
- name: x,
99
- value: A,
101
+ P && "error",
102
+ N && "disabled"
103
+ ],
104
+ description: ["description"]
105
+ }, ee, oe), { startAdornment: J, endAdornment: Y, ...X } = O.input ?? {}, Z = O.htmlInput ?? {}, be = (e) => {
106
+ H(!0), Z.onFocus?.(e), le?.(e);
107
+ }, xe = (e) => {
108
+ H(!1), Z.onBlur?.(e), ce?.(e);
109
+ }, Se = (e) => {
110
+ Z.onChange?.(e), C?.(e), k === void 0 && K();
111
+ }, Ce = t(Z["aria-describedby"], B, z) || void 0, Q = i({
112
+ id: R,
113
+ name: S,
114
+ value: k,
100
115
  defaultValue: p,
101
- placeholder: w,
116
+ placeholder: T,
102
117
  autoComplete: re,
103
118
  autoFocus: ie,
104
- disabled: P,
105
- required: I,
106
- "aria-invalid": F || void 0,
107
- "aria-describedby": be,
108
- className: J.input,
119
+ disabled: N,
120
+ required: F,
121
+ "aria-invalid": P || void 0,
122
+ "aria-describedby": Ce,
123
+ className: q.input,
109
124
  ref: (e) => {
110
- K.current = e instanceof HTMLTextAreaElement ? e : null, ne(v, e);
125
+ G.current = e instanceof HTMLTextAreaElement ? e : null, ne(y, e);
111
126
  }
112
127
  }, Z), $ = {
113
- onFocus: _e,
114
- onBlur: ve,
115
- onChange: ye
116
- }, xe = b ? /* @__PURE__ */ c("textarea", {
128
+ onFocus: be,
129
+ onBlur: xe,
130
+ onChange: Se
131
+ }, we = x ? /* @__PURE__ */ c("textarea", {
117
132
  ...Q,
118
133
  ...$,
119
134
  ref: Q.ref,
120
- rows: E ?? fe,
135
+ rows: E ?? ge,
121
136
  style: {
122
- ...W ? { overflowY: me ? "auto" : "hidden" } : null,
137
+ ...U ? { overflowY: ve ? "auto" : "hidden" } : null,
123
138
  ...Q.style
124
139
  }
125
140
  }) : /* @__PURE__ */ c("input", {
126
141
  ...Q,
127
142
  ...$,
128
143
  ref: Q.ref,
129
- type: de ?? Q.type ?? "text"
144
+ type: me ?? Q.type ?? "text"
130
145
  });
131
146
  return /* @__PURE__ */ l("div", {
132
147
  ref: d,
133
- className: t(J.root, f),
134
- ...M,
148
+ className: t(q.root, f),
149
+ ...j,
135
150
  children: [
136
- y != null && /* @__PURE__ */ l("label", {
151
+ b != null && /* @__PURE__ */ l("label", {
137
152
  ...i({
138
- id: V,
139
- htmlFor: z,
140
- className: J.label
141
- }, k.inputLabel),
142
- children: [y, I && /* @__PURE__ */ c("span", {
153
+ id: he,
154
+ htmlFor: R,
155
+ className: q.label
156
+ }, O.inputLabel),
157
+ children: [b, F && /* @__PURE__ */ c("span", {
143
158
  "aria-hidden": "true",
144
- className: J.asterisk,
159
+ className: q.asterisk,
145
160
  children: " *"
146
161
  })]
147
162
  }),
163
+ m != null && /* @__PURE__ */ c("p", {
164
+ id: B,
165
+ className: q.description,
166
+ children: m
167
+ }),
148
168
  /* @__PURE__ */ l("div", {
149
- ...i({ className: J.inputRoot }, ge),
169
+ ...i({ className: q.inputRoot }, X),
150
170
  children: [
171
+ J != null && /* @__PURE__ */ c("span", {
172
+ className: q.startAdornment,
173
+ children: J
174
+ }),
175
+ we,
151
176
  Y != null && /* @__PURE__ */ c("span", {
152
- className: J.startAdornment,
177
+ className: q.endAdornment,
153
178
  children: Y
154
- }),
155
- xe,
156
- X != null && /* @__PURE__ */ c("span", {
157
- className: J.endAdornment,
158
- children: X
159
179
  })
160
180
  ]
161
181
  }),
162
- g != null && /* @__PURE__ */ c("p", {
182
+ _ != null && /* @__PURE__ */ c("p", {
163
183
  ...i({
164
- id: B,
165
- className: J.helperText
166
- }, k.formHelperText),
167
- children: g
184
+ id: z,
185
+ className: q.helperText
186
+ }, O.formHelperText),
187
+ children: _
168
188
  })
169
189
  ]
170
190
  });