@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.
- package/CHANGELOG.md +137 -0
- package/README.md +6 -5
- package/agent/caligo.json +648 -41
- package/dist/css/Accordion.css +6 -0
- package/dist/css/AccordionSummary.css +2 -0
- package/dist/css/Alert.css +8 -0
- package/dist/css/AppBar.css +2 -0
- package/dist/css/Avatar.css +4 -0
- package/dist/css/AvatarGroup.css +6 -0
- package/dist/css/Badge.css +6 -0
- package/dist/css/Breadcrumb.css +2 -0
- package/dist/css/Breadcrumbs.css +2 -0
- package/dist/css/Button.css +2 -0
- package/dist/css/ButtonGroup.css +4 -0
- package/dist/css/Card.css +4 -0
- package/dist/css/Checkbox.css +2 -0
- package/dist/css/Chip.css +4 -0
- package/dist/css/CircularProgress.css +2 -0
- package/dist/css/Collapse.css +2 -0
- package/dist/css/Collapsible.css +8 -0
- package/dist/css/Container.css +2 -0
- package/dist/css/Dialog.css +2 -0
- package/dist/css/Divider.css +2 -0
- package/dist/css/Drawer.css +2 -0
- package/dist/css/ErrorPanel.css +6 -0
- package/dist/css/FormControl.css +2 -0
- package/dist/css/FormControlLabel.css +2 -0
- package/dist/css/FormGroup.css +2 -0
- package/dist/css/FormHelperText.css +2 -0
- package/dist/css/FormLabel.css +2 -0
- package/dist/css/Grid.css +2 -0
- package/dist/css/Icon.css +4 -0
- package/dist/css/IconButton.css +4 -0
- package/dist/css/InputAdornment.css +2 -0
- package/dist/css/InputBase.css +2 -0
- package/dist/css/InputGroup.css +12 -0
- package/dist/css/Label.css +2 -0
- package/dist/css/LicenseInfo.css +2 -0
- package/dist/css/LinearProgress.css +2 -0
- package/dist/css/Link.css +2 -0
- package/dist/css/List.css +2 -0
- package/dist/css/ListItem.css +6 -0
- package/dist/css/ListItemAvatar.css +2 -0
- package/dist/css/ListItemButton.css +2 -0
- package/dist/css/ListItemIcon.css +4 -0
- package/dist/css/ListItemText.css +4 -0
- package/dist/css/ListSubheader.css +2 -0
- package/dist/css/Menu.css +2 -0
- package/dist/css/MenuItem.css +2 -0
- package/dist/css/MenuList.css +6 -0
- package/dist/css/NotificationBadge.css +6 -0
- package/dist/css/Pagination.css +6 -0
- package/dist/css/PaginationItem.css +4 -0
- package/dist/css/Paper.css +2 -0
- package/dist/css/Popover.css +2 -0
- package/dist/css/PreviewCard.css +4 -0
- package/dist/css/Progress.css +4 -0
- package/dist/css/Radio.css +2 -0
- package/dist/css/RadioGroup.css +2 -0
- package/dist/css/ScrollArea.css +2 -0
- package/dist/css/Select.css +10 -0
- package/dist/css/Separator.css +2 -0
- package/dist/css/Sheet.css +2 -0
- package/dist/css/Skeleton.css +2 -0
- package/dist/css/Slider.css +2 -0
- package/dist/css/Snackbar.css +4 -0
- package/dist/css/SnackbarContent.css +2 -0
- package/dist/css/Spinner.css +2 -0
- package/dist/css/Stack.css +2 -0
- package/dist/css/Switch.css +2 -0
- package/dist/css/Tab.css +2 -0
- package/dist/css/Table.css +2 -0
- package/dist/css/TableBody.css +2 -0
- package/dist/css/TableCell.css +2 -0
- package/dist/css/TableContainer.css +2 -0
- package/dist/css/TableFooter.css +2 -0
- package/dist/css/TableHead.css +2 -0
- package/dist/css/TableRow.css +2 -0
- package/dist/css/TableSortLabel.css +2 -0
- package/dist/css/Tabs.css +2 -0
- package/dist/css/Tag.css +4 -0
- package/dist/css/TextField.css +10 -0
- package/dist/css/Toast.css +4 -0
- package/dist/css/ToggleButton.css +2 -0
- package/dist/css/ToggleButtonGroup.css +2 -0
- package/dist/css/ToggleGroup.css +2 -0
- package/dist/css/Toolbar.css +2 -0
- package/dist/css/Tooltip.css +2 -0
- package/dist/css/Typography.css +2 -0
- package/dist/css/VirtualList.css +2 -0
- package/dist/esm/Alert/Alert.css +1 -1
- package/dist/esm/Alert/Alert2.js +2 -0
- package/dist/esm/Alert/Alert2.js.map +1 -1
- package/dist/esm/Avatar/Avatar.css +1 -1
- package/dist/esm/Avatar/Avatar2.js +33 -39
- package/dist/esm/Avatar/Avatar2.js.map +1 -1
- package/dist/esm/Breadcrumbs/Breadcrumbs.css +1 -1
- package/dist/esm/Button/Button.css +1 -1
- package/dist/esm/Button/Button2.js +36 -36
- package/dist/esm/Button/Button2.js.map +1 -1
- package/dist/esm/Button/buttonClasses.js +1 -1
- package/dist/esm/Button/buttonClasses.js.map +1 -1
- package/dist/esm/Card/Card.css +1 -1
- package/dist/esm/Checkbox/Checkbox.css +1 -1
- package/dist/esm/Chip/Chip.css +1 -1
- package/dist/esm/Chip/Chip2.js +30 -53
- package/dist/esm/Chip/Chip2.js.map +1 -1
- package/dist/esm/Dialog/Dialog.css +1 -1
- package/dist/esm/Dialog/Dialog2.js.map +1 -1
- package/dist/esm/Drawer/Drawer.css +1 -1
- package/dist/esm/FormLabel/FormLabel.css +1 -1
- package/dist/esm/IconButton/IconButton.css +1 -1
- package/dist/esm/IconButton/IconButton2.js +9 -8
- package/dist/esm/IconButton/IconButton2.js.map +1 -1
- package/dist/esm/InputBase/InputBase.js +52 -0
- package/dist/esm/InputBase/InputBase.js.map +1 -0
- package/dist/esm/InputBase/index.js +1 -0
- package/dist/esm/List/List.css +1 -1
- package/dist/esm/Menu/Menu.css +1 -1
- package/dist/esm/MenuItem/MenuItem.css +1 -1
- package/dist/esm/Paper/Paper.css +1 -1
- package/dist/esm/Popover/Popover.css +1 -1
- package/dist/esm/Radio/Radio.css +1 -1
- package/dist/esm/Radio/Radio2.js +74 -45
- package/dist/esm/Radio/Radio2.js.map +1 -1
- package/dist/esm/RadioGroup/RadioGroup.js +29 -22
- package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/RadioGroup/radioGroupContext.js.map +1 -1
- package/dist/esm/ScrollArea/ScrollArea.css +1 -0
- package/dist/esm/ScrollArea/ScrollArea2.js +25 -0
- package/dist/esm/ScrollArea/ScrollArea2.js.map +1 -0
- package/dist/esm/ScrollArea/index.js +1 -0
- package/dist/esm/Select/Select.css +1 -1
- package/dist/esm/Snackbar/Snackbar.css +1 -1
- package/dist/esm/Switch/Switch.css +1 -1
- package/dist/esm/Switch/Switch2.js +47 -42
- package/dist/esm/Switch/Switch2.js.map +1 -1
- package/dist/esm/Tab/Tab.css +1 -1
- package/dist/esm/Tab/Tab2.js +29 -24
- package/dist/esm/Tab/Tab2.js.map +1 -1
- package/dist/esm/Table/Table.css +1 -1
- package/dist/esm/TableCell/TableCell.js +6 -6
- package/dist/esm/TableCell/TableCell.js.map +1 -1
- package/dist/esm/Tabs/Tabs.css +1 -1
- package/dist/esm/TextField/TextField.css +1 -1
- package/dist/esm/TextField/TextField2.js +106 -86
- package/dist/esm/TextField/TextField2.js.map +1 -1
- package/dist/esm/TextField/textFieldClasses.js +2 -0
- package/dist/esm/TextField/textFieldClasses.js.map +1 -1
- package/dist/esm/ToggleButton/ToggleButton.css +1 -1
- package/dist/esm/Toolbar/Toolbar.css +1 -1
- package/dist/esm/Tooltip/Tooltip.css +1 -1
- package/dist/esm/Tooltip/Tooltip2.js +50 -33
- package/dist/esm/Tooltip/Tooltip2.js.map +1 -1
- package/dist/esm/Typography/Typography.css +1 -1
- package/dist/esm/caligo.css +1 -1
- package/dist/esm/index.js +65 -63
- package/dist/esm/internal/glyphs.js +5 -0
- package/dist/esm/internal/glyphs.js.map +1 -1
- package/dist/esm/internal/hues.js +23 -0
- package/dist/esm/internal/hues.js.map +1 -0
- package/dist/esm/internal/inputEvent.js +22 -0
- package/dist/esm/internal/inputEvent.js.map +1 -0
- package/dist/esm/internal/releaseInfo.js +1 -1
- package/dist/esm/internal/releaseInfo.js.map +1 -1
- package/dist/esm/mui/index.js.map +1 -1
- package/dist/esm/mui/themeValues.js +106 -0
- package/dist/esm/mui/themeValues.js.map +1 -1
- package/dist/esm/parts/Breadcrumb.js +68 -0
- package/dist/esm/parts/Breadcrumb.js.map +1 -0
- package/dist/esm/parts/Combobox.js +171 -0
- package/dist/esm/parts/Combobox.js.map +1 -0
- package/dist/esm/parts/ContextMenu.js +17 -17
- package/dist/esm/parts/ContextMenu.js.map +1 -1
- package/dist/esm/parts/Menu.js +105 -24
- package/dist/esm/parts/Menu.js.map +1 -1
- package/dist/esm/parts/Select.js +120 -0
- package/dist/esm/parts/Select.js.map +1 -0
- package/dist/esm/parts/Toast.js +95 -0
- package/dist/esm/parts/Toast.js.map +1 -0
- package/dist/esm/parts/Toolbar.js +100 -0
- package/dist/esm/parts/Toolbar.js.map +1 -0
- package/dist/esm/parts/Tooltip.js +20 -8
- package/dist/esm/parts/Tooltip.js.map +1 -1
- package/dist/esm/parts/index.js +156 -87
- package/dist/esm/parts/index.js.map +1 -1
- package/dist/global/caligo-ui.css +1 -1
- package/dist/global/caligo-ui.js +1 -1
- package/dist/global/caligo-ui.js.map +1 -1
- package/dist/types/Alert/Alert.d.ts +7 -2
- package/dist/types/Avatar/Avatar.d.ts +38 -3
- package/dist/types/Button/Button.d.ts +9 -2
- package/dist/types/Button/buttonClasses.d.ts +2 -0
- package/dist/types/Chip/Chip.d.ts +21 -0
- package/dist/types/Dialog/Dialog.d.ts +1 -0
- package/dist/types/IconButton/IconButton.d.ts +6 -0
- package/dist/types/InputBase/InputBase.d.ts +64 -0
- package/dist/types/InputBase/index.d.ts +2 -0
- package/dist/types/Radio/Radio.d.ts +5 -3
- package/dist/types/RadioGroup/RadioGroup.d.ts +4 -2
- package/dist/types/RadioGroup/radioGroupContext.d.ts +6 -2
- package/dist/types/ScrollArea/ScrollArea.d.ts +28 -0
- package/dist/types/ScrollArea/index.d.ts +2 -0
- package/dist/types/Switch/Switch.d.ts +4 -3
- package/dist/types/Tab/Tab.d.ts +7 -0
- package/dist/types/TableCell/TableCell.d.ts +6 -0
- package/dist/types/TextField/TextField.d.ts +11 -0
- package/dist/types/TextField/textFieldClasses.d.ts +4 -0
- package/dist/types/Tooltip/Tooltip.d.ts +20 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/internal/glyphs.d.ts +1 -0
- package/dist/types/internal/hues.d.ts +10 -0
- package/dist/types/internal/inputEvent.d.ts +13 -0
- package/dist/types/internal/releaseInfo.d.ts +1 -1
- package/dist/types/mui/index.d.ts +2 -0
- package/dist/types/mui/themeValues.d.ts +106 -0
- package/dist/types/parts/Breadcrumb.d.ts +24 -0
- package/dist/types/parts/Combobox.d.ts +88 -0
- package/dist/types/parts/ContextMenu.d.ts +2 -2
- package/dist/types/parts/Menu.d.ts +44 -0
- package/dist/types/parts/Select.d.ts +72 -0
- package/dist/types/parts/Toast.d.ts +46 -0
- package/dist/types/parts/Toolbar.d.ts +47 -0
- package/dist/types/parts/Tooltip.d.ts +6 -0
- package/dist/types/parts/index.d.ts +95 -4
- 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"}
|
package/dist/esm/Tab/Tab.css
CHANGED
|
@@ -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}}
|
package/dist/esm/Tab/Tab2.js
CHANGED
|
@@ -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,
|
|
25
|
-
onFocus:
|
|
26
|
-
onBlur:
|
|
27
|
-
}),
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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),
|
|
39
|
-
return /* @__PURE__ */ u(
|
|
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
|
-
|
|
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:
|
|
44
|
-
"aria-selected":
|
|
45
|
-
tabIndex:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
57
|
+
g && !k ? e.preventDefault() : (C?.(e), e.defaultPrevented || A?.onSelect(e, M));
|
|
53
58
|
},
|
|
54
|
-
...
|
|
55
|
-
children: [
|
|
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 };
|
package/dist/esm/Tab/Tab2.js.map
CHANGED
|
@@ -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","
|
|
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"}
|
package/dist/esm/Table/Table.css
CHANGED
|
@@ -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;
|
|
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,
|
|
11
|
-
return /* @__PURE__ */ o(
|
|
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:
|
|
14
|
-
"aria-sort":
|
|
15
|
-
className: t("CaligoTableCell-root", `CaligoTableCell-${
|
|
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":";;;;;;;;
|
|
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"}
|
package/dist/esm/Tabs/Tabs.css
CHANGED
|
@@ -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{
|
|
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{
|
|
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,
|
|
19
|
-
let e =
|
|
20
|
-
if (!e || !
|
|
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
|
-
|
|
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
|
-
|
|
34
|
-
}, [
|
|
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
|
-
...
|
|
37
|
-
...
|
|
49
|
+
...j,
|
|
50
|
+
...O.select,
|
|
38
51
|
className: t("CaligoTextField-select", f),
|
|
39
|
-
id:
|
|
40
|
-
name:
|
|
41
|
-
label:
|
|
42
|
-
helperText:
|
|
43
|
-
error:
|
|
44
|
-
required:
|
|
45
|
-
disabled:
|
|
46
|
-
fullWidth:
|
|
47
|
-
size:
|
|
48
|
-
variant:
|
|
49
|
-
...
|
|
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
|
-
...
|
|
52
|
-
placeholder:
|
|
64
|
+
...y ? { inputRef: y } : null,
|
|
65
|
+
placeholder: T,
|
|
53
66
|
onChange: (e) => C?.(e),
|
|
54
67
|
children: ae
|
|
55
68
|
});
|
|
56
|
-
let
|
|
69
|
+
let q = r({
|
|
57
70
|
root: [
|
|
58
71
|
"root",
|
|
59
|
-
|
|
60
|
-
`size${n(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
]
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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:
|
|
116
|
+
placeholder: T,
|
|
102
117
|
autoComplete: re,
|
|
103
118
|
autoFocus: ie,
|
|
104
|
-
disabled:
|
|
105
|
-
required:
|
|
106
|
-
"aria-invalid":
|
|
107
|
-
"aria-describedby":
|
|
108
|
-
className:
|
|
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
|
-
|
|
125
|
+
G.current = e instanceof HTMLTextAreaElement ? e : null, ne(y, e);
|
|
111
126
|
}
|
|
112
127
|
}, Z), $ = {
|
|
113
|
-
onFocus:
|
|
114
|
-
onBlur:
|
|
115
|
-
onChange:
|
|
116
|
-
},
|
|
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 ??
|
|
135
|
+
rows: E ?? ge,
|
|
121
136
|
style: {
|
|
122
|
-
...
|
|
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:
|
|
144
|
+
type: me ?? Q.type ?? "text"
|
|
130
145
|
});
|
|
131
146
|
return /* @__PURE__ */ l("div", {
|
|
132
147
|
ref: d,
|
|
133
|
-
className: t(
|
|
134
|
-
...
|
|
148
|
+
className: t(q.root, f),
|
|
149
|
+
...j,
|
|
135
150
|
children: [
|
|
136
|
-
|
|
151
|
+
b != null && /* @__PURE__ */ l("label", {
|
|
137
152
|
...i({
|
|
138
|
-
id:
|
|
139
|
-
htmlFor:
|
|
140
|
-
className:
|
|
141
|
-
},
|
|
142
|
-
children: [
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
182
|
+
_ != null && /* @__PURE__ */ c("p", {
|
|
163
183
|
...i({
|
|
164
|
-
id:
|
|
165
|
-
className:
|
|
166
|
-
},
|
|
167
|
-
children:
|
|
184
|
+
id: z,
|
|
185
|
+
className: q.helperText
|
|
186
|
+
}, O.formHelperText),
|
|
187
|
+
children: _
|
|
168
188
|
})
|
|
169
189
|
]
|
|
170
190
|
});
|