ixia-ui-react 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alert-dialog/index.js +1 -1
- package/dist/bento-box/index.js +1 -1
- package/dist/bento-box/index.js.map +1 -1
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +1 -1
- package/dist/{button-BpUC-R1J.js → button-DXQvyQyj.js} +7 -5
- package/dist/button-DXQvyQyj.js.map +1 -0
- package/dist/button-group/index.d.ts +1 -1
- package/dist/button-group/index.js +1 -1
- package/dist/button-group-BiSk3iIf.js +269 -0
- package/dist/button-group-BiSk3iIf.js.map +1 -0
- package/dist/button-group-context-CScS9Ntz.js +7 -0
- package/dist/button-group-context-CScS9Ntz.js.map +1 -0
- package/dist/calendar/index.js +1 -1
- package/dist/code-block/index.d.ts +5 -2
- package/dist/code-block/index.js +9 -24
- package/dist/code-block/index.js.map +1 -1
- package/dist/collapsible/index.d.ts +1 -1
- package/dist/collapsible/index.js +1 -1
- package/dist/{collapsible-BVqrh0Q0.js → collapsible-C3OPWY9l.js} +2 -2
- package/dist/{collapsible-BVqrh0Q0.js.map → collapsible-C3OPWY9l.js.map} +1 -1
- package/dist/color-picker/index.js +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/copy-button/index.d.ts +2 -0
- package/dist/copy-button/index.js +1 -0
- package/dist/copy-button-BAG-P44v.js +28 -0
- package/dist/copy-button-BAG-P44v.js.map +1 -0
- package/dist/dialog/index.js +1 -1
- package/dist/dropzone/index.d.ts +1 -1
- package/dist/dropzone/index.js +1 -1
- package/dist/field/index.js +1 -1
- package/dist/{field-DTL7eA5y.js → field-DkMfrmdj.js} +2 -2
- package/dist/{field-DTL7eA5y.js.map → field-DkMfrmdj.js.map} +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js +2 -2
- package/dist/{form-BxMg796f.js → form-V2VqHn0D.js} +3 -3
- package/dist/{form-BxMg796f.js.map → form-V2VqHn0D.js.map} +1 -1
- package/dist/{index-DfNHJF0t.d.ts → index-B0Qz4Egw.d.ts} +2 -2
- package/dist/{index-B3MK1QYh.d.ts → index-CpNMNewO.d.ts} +3 -3
- package/dist/index-DVMheqs_.d.ts +9 -0
- package/dist/{index-N2CBSUDu.d.ts → index-DXDObRKO.d.ts} +2 -2
- package/dist/index-uaJUy56Z.d.ts +4 -0
- package/dist/input/index.js +1 -1
- package/dist/{input-Laj6dwtK.js → input-Czt30vp7.js} +2 -2
- package/dist/{input-Laj6dwtK.js.map → input-Czt30vp7.js.map} +1 -1
- package/dist/layer-tree/index.d.ts +1 -1
- package/dist/layer-tree/index.js +1 -1
- package/dist/map/google/index.d.ts +2 -2
- package/dist/map/google/index.js +2 -2
- package/dist/map/index.d.ts +2 -2
- package/dist/map/index.js +2 -2
- package/dist/number-field/index.js +1 -1
- package/dist/popover/index.d.ts +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/{popover-B1s4xXrX.js → popover-0WDxRi-s.js} +2 -2
- package/dist/{popover-B1s4xXrX.js.map → popover-0WDxRi-s.js.map} +1 -1
- package/dist/sidebar/index.d.ts +2 -2
- package/dist/sidebar/index.js +4 -4
- package/dist/sidebar/index.js.map +1 -1
- package/dist/slider-group/index.js +1 -1
- package/dist/table/index.d.ts +1 -1
- package/dist/table/index.js +4 -4
- package/dist/toast/index.js +1 -1
- package/package.json +1 -1
- package/dist/button-BpUC-R1J.js.map +0 -1
- package/dist/button-group-7azbqlcO.js +0 -269
- package/dist/button-group-7azbqlcO.js.map +0 -1
- package/dist/index-bVyqfhJS.d.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-Laj6dwtK.js","names":["Input","BaseInput"],"sources":["../src/components/input/input.tsx"],"sourcesContent":["import { Input as BaseInput } from '@base-ui/react/input'\nimport { useRef, useState } from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { formatFileSize, inputVariants } from './input.types'\nimport type { InputProps } from './input.types'\n\nconst DEFAULT_COLOR = '#000000',\n EMPTY_FILE_COUNT = 0,\n SINGLE_FILE_COUNT = 1,\n defaultFileUploadButtonIcon = <Icon name=\"upload\" />,\n defaultFilesSelectedLabel = (count: number) => `${count} files selected`,\n defaultMaxFilesErrorLabel = (maxFiles: number) => {\n if (maxFiles === SINGLE_FILE_COUNT) {\n return `You can select up to ${maxFiles} file.`\n }\n return `You can select up to ${maxFiles} files.`\n },\n defaultMaxFileSizeErrorLabel = (fileName: string, maxFileSize: string) =>\n `\"${fileName}\" exceeds the maximum size of ${maxFileSize}.`\n\nfunction getStringValue(value: unknown): string | undefined {\n if (typeof value === 'string') {\n return value\n }\n return undefined\n}\n\nfunction getColorValue(\n isControlled: boolean,\n controlledValue: unknown,\n uncontrolledValue: string,\n): string {\n if (isControlled) {\n return getStringValue(controlledValue) || DEFAULT_COLOR\n }\n return uncontrolledValue || DEFAULT_COLOR\n}\n\nfunction getColorInputProps(isControlled: boolean, colorValue: string) {\n if (isControlled) {\n return { value: colorValue }\n }\n return { defaultValue: colorValue }\n}\n\nfunction getFileValidationError(\n files: File[],\n options: {\n maxFiles: number | undefined\n maxFileSize: number | undefined\n maxFilesErrorLabel: NonNullable<InputProps['maxFilesErrorLabel']>\n maxFileSizeErrorLabel: NonNullable<InputProps['maxFileSizeErrorLabel']>\n },\n): string | undefined {\n const { maxFiles, maxFileSize, maxFilesErrorLabel, maxFileSizeErrorLabel } = options,\n oversizedFile = files.find((file) => maxFileSize !== undefined && file.size > maxFileSize)\n if (maxFiles !== undefined && files.length > maxFiles) {\n return maxFilesErrorLabel(maxFiles)\n }\n\n if (oversizedFile && maxFileSize !== undefined) {\n return maxFileSizeErrorLabel(oversizedFile.name, formatFileSize(maxFileSize))\n }\n return undefined\n}\n\nfunction getFileStatus(options: {\n fileError: string | undefined\n selectedFiles: File[]\n placeholder: InputProps['placeholder']\n filesSelectedLabel: (count: number) => string\n}) {\n const { fileError, selectedFiles, placeholder, filesSelectedLabel } = options\n if (fileError) {\n return <span className=\"style-text-prose-0 text-error-default\">{fileError}</span>\n }\n if (selectedFiles.length === EMPTY_FILE_COUNT) {\n return <span className=\"style-text-prose-0 text-on-surface-variant\">{placeholder}</span>\n }\n if (selectedFiles.length === SINGLE_FILE_COUNT) {\n return selectedFiles.at(EMPTY_FILE_COUNT)?.name\n }\n return filesSelectedLabel(selectedFiles.length)\n}\n\nexport function Input({\n fileUploadButtonIcon = defaultFileUploadButtonIcon,\n fileUploadButtonLabel,\n maxFiles,\n maxFileSize,\n clearFilesLabel = 'Remove files',\n filesSelectedLabel = defaultFilesSelectedLabel,\n maxFilesErrorLabel = defaultMaxFilesErrorLabel,\n maxFileSizeErrorLabel = defaultMaxFileSizeErrorLabel,\n compact,\n variant,\n size,\n className,\n ref,\n ...props\n}: InputProps) {\n const inputRef = useRef<HTMLInputElement>(null),\n [uncontrolledColorValue, setUncontrolledColorValue] = useState<string>(\n getStringValue(props.defaultValue) || getStringValue(props.value) || DEFAULT_COLOR,\n ),\n [selectedFiles, setSelectedFiles] = useState<File[]>([]),\n [fileError, setFileError] = useState<string | undefined>(undefined)\n\n if (props.type === 'color') {\n const isControlled = props.value !== undefined,\n colorValue = getColorValue(isControlled, props.value, uncontrolledColorValue),\n { onChange, defaultValue: _defaultValue, value: _value, ...colorProps } = props,\n handleColorChange: NonNullable<typeof onChange> = (event) => {\n if (!isControlled) {\n setUncontrolledColorValue(event.currentTarget.value)\n }\n\n onChange?.(event)\n },\n handleColorRef = (node: HTMLInputElement | null) => {\n inputRef.current = node\n\n if (typeof ref === 'function') {\n ref(node)\n return\n }\n\n if (ref && typeof ref === 'object') {\n Object.assign(ref, { current: node })\n }\n }\n\n if (compact) {\n return (\n <button\n aria-label=\"Open color picker\"\n className={cn(\n 'relative outline-2 outline-transparent transition-colors focus-within:outline-border hover:cursor-pointer',\n size === 'small' && 'size-lg -outline-offset-2',\n size === 'medium' && 'size-xl -outline-offset-4',\n size === 'large' && 'size-2xl -outline-offset-6',\n className,\n )}\n disabled={props.disabled}\n onClick={() => inputRef.current?.click()}\n type=\"button\"\n >\n <div\n className={cn(\n 'size-full',\n size === 'small' && 'rounded-md',\n size === 'medium' && 'rounded-lg',\n size === 'large' && 'rounded-xl',\n )}\n style={{\n backgroundColor: colorValue,\n }}\n />\n <BaseInput\n className=\"peer pointer-events-none invisible absolute\"\n {...getColorInputProps(isControlled, colorValue)}\n onChange={handleColorChange}\n ref={handleColorRef}\n type=\"color\"\n {...colorProps}\n />\n </button>\n )\n }\n\n return (\n <button\n aria-label={`${colorValue}, open color picker`}\n className={cn(\n 'relative flex hover:cursor-pointer',\n inputVariants({ size, variant }),\n className,\n )}\n disabled={props.disabled}\n onClick={() => inputRef.current?.click()}\n type=\"button\"\n >\n <div\n className={cn(\n 'absolute top-1/2 left-xs aspect-square h-7/12 -translate-y-1/2',\n size === 'small' && 'rounded-md',\n size === 'medium' && 'rounded-lg',\n size === 'large' && 'rounded-xl',\n )}\n style={{\n backgroundColor: colorValue,\n }}\n />\n <BaseInput\n className=\"peer pointer-events-none invisible absolute top-lg\"\n {...getColorInputProps(isControlled, colorValue)}\n onChange={handleColorChange}\n ref={handleColorRef}\n type=\"color\"\n {...colorProps}\n />\n <p\n className={cn(\n 'text-left',\n size === 'small' && 'pr-2xs pl-lg style-text-default--1',\n size === 'medium' && 'pl-lg style-text-default-0',\n size === 'large' && 'pl-xl style-text-default-1',\n )}\n >\n {colorValue}\n </p>\n </button>\n )\n }\n\n if (props.type === 'file') {\n const { onChange, ...fileProps } = props,\n clearFiles = () => {\n if (inputRef.current) {\n inputRef.current.value = ''\n }\n\n setSelectedFiles([])\n setFileError(undefined)\n },\n handleFileChange: NonNullable<typeof onChange> = (event) => {\n const input = event.currentTarget,\n files = [...(input.files ?? [])],\n validationError = getFileValidationError(files, {\n maxFileSize,\n maxFileSizeErrorLabel,\n maxFiles,\n maxFilesErrorLabel,\n })\n if (validationError) {\n setSelectedFiles([])\n setFileError(validationError)\n input.value = ''\n return\n }\n\n setFileError(undefined)\n setSelectedFiles(files)\n onChange?.(event)\n }\n\n return (\n <div className=\"flex items-center justify-between gap-lg\">\n <div className=\"flex items-center gap-xs\">\n <Button variant=\"soft\" tone=\"neutral\" onClick={() => inputRef.current?.click()}>\n {fileUploadButtonIcon}\n {fileUploadButtonLabel}\n </Button>\n <BaseInput ref={inputRef} {...fileProps} hidden onChange={handleFileChange} />\n <p className=\"style-text-default-0\">\n {getFileStatus({\n fileError,\n filesSelectedLabel,\n placeholder: props.placeholder,\n selectedFiles,\n })}\n </p>\n </div>\n <Button\n aria-label={clearFilesLabel}\n size=\"medium\"\n variant=\"ghost\"\n tone=\"error\"\n onClick={clearFiles}\n >\n <Icon name=\"close\" />\n </Button>\n </div>\n )\n }\n\n return (\n <BaseInput className={cn(inputVariants({ size, variant }), className)} ref={ref} {...props} />\n )\n}\n"],"mappings":";;;;;;;;AAUA,MAAM,gBAAgB;AACpB,MAAA,mBAAmB;AACnB,MAAA,oBAAoB;AACpB,MAAA,8BAA8B,oBAAC,MAAD,EAAM,MAAK,SAAU,CAAA;AACnD,MAAA,6BAA6B,UAAkB,GAAG,MAAM;AACxD,MAAA,6BAA6B,aAAqB;CAChD,IAAI,aAAa,mBACf,OAAO,wBAAwB,SAAS;CAE1C,OAAO,wBAAwB,SAAS;AAC1C;AACA,MAAA,gCAAgC,UAAkB,gBAChD,IAAI,SAAS,gCAAgC,YAAY;AAE7D,SAAS,eAAe,OAAoC;CAC1D,IAAI,OAAO,UAAU,UACnB,OAAO;AAGX;AAEA,SAAS,cACP,cACA,iBACA,mBACQ;CACR,IAAI,cACF,OAAO,eAAe,eAAe,KAAK;CAE5C,OAAO,qBAAqB;AAC9B;AAEA,SAAS,mBAAmB,cAAuB,YAAoB;CACrE,IAAI,cACF,OAAO,EAAE,OAAO,WAAW;CAE7B,OAAO,EAAE,cAAc,WAAW;AACpC;AAEA,SAAS,uBACP,OACA,SAMoB;CACpB,MAAM,EAAE,UAAU,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sx"],"sourcesContent":["import { Input as BaseInput } from '@base-ui/react/input'\nimport { useRef, useState } from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { formatFileSize, inputVariants } from './input.types'\nimport type { InputProps } from './input.types'\n\nconst DEFAULT_COLOR = '#000000',\n EMPTY_FILE_COUNT = 0,\n SINGLE_FILE_COUNT = 1,\n defaultFileUploadButtonIcon = <Icon name=\"upload\" />,\n defaultFilesSelectedLabel = (count: number) => `${count} files selected`,\n defaultMaxFilesErrorLabel = (maxFiles: number) => {\n if (maxFiles === SINGLE_FILE_COUNT) {\n return `You can select up to ${maxFiles} file.`\n }\n return `You can select up to ${maxFiles} files.`\n },\n defaultMaxFileSizeErrorLabel = (fileName: string, maxFileSize: string) =>\n `\"${fileName}\" exceeds the maximum size of ${maxFileSize}.`\n\nfunction getStringValue(value: unknown): string | undefined {\n if (typeof value === 'string') {\n return value\n }\n return undefined\n}\n\nfunction getColorValue(\n isControlled: boolean,\n controlledValue: unknown,\n uncontrolledValue: string,\n): string {\n if (isControlled) {\n return getStringValue(controlledValue) || DEFAULT_COLOR\n }\n return uncontrolledValue || DEFAULT_COLOR\n}\n\nfunction getColorInputProps(isControlled: boolean, colorValue: string) {\n if (isControlled) {\n return { value: colorValue }\n }\n return { defaultValue: colorValue }\n}\n\nfunction getFileValidationError(\n files: File[],\n options: {\n maxFiles: number | undefined\n maxFileSize: number | undefined\n maxFilesErrorLabel: NonNullable<InputProps['maxFilesErrorLabel']>\n maxFileSizeErrorLabel: NonNullable<InputProps['maxFileSizeErrorLabel']>\n },\n): string | undefined {\n const { maxFiles, maxFileSize, maxFilesErrorLabel, maxFileSizeErrorLabel } = options,\n oversizedFile = files.find((file) => maxFileSize !== undefined && file.size > maxFileSize)\n if (maxFiles !== undefined && files.length > maxFiles) {\n return maxFilesErrorLabel(maxFiles)\n }\n\n if (oversizedFile && maxFileSize !== undefined) {\n return maxFileSizeErrorLabel(oversizedFile.name, formatFileSize(maxFileSize))\n }\n return undefined\n}\n\nfunction getFileStatus(options: {\n fileError: string | undefined\n selectedFiles: File[]\n placeholder: InputProps['placeholder']\n filesSelectedLabel: (count: number) => string\n}) {\n const { fileError, selectedFiles, placeholder, filesSelectedLabel } = options\n if (fileError) {\n return <span className=\"style-text-prose-0 text-error-default\">{fileError}</span>\n }\n if (selectedFiles.length === EMPTY_FILE_COUNT) {\n return <span className=\"style-text-prose-0 text-on-surface-variant\">{placeholder}</span>\n }\n if (selectedFiles.length === SINGLE_FILE_COUNT) {\n return selectedFiles.at(EMPTY_FILE_COUNT)?.name\n }\n return filesSelectedLabel(selectedFiles.length)\n}\n\nexport function Input({\n fileUploadButtonIcon = defaultFileUploadButtonIcon,\n fileUploadButtonLabel,\n maxFiles,\n maxFileSize,\n clearFilesLabel = 'Remove files',\n filesSelectedLabel = defaultFilesSelectedLabel,\n maxFilesErrorLabel = defaultMaxFilesErrorLabel,\n maxFileSizeErrorLabel = defaultMaxFileSizeErrorLabel,\n compact,\n variant,\n size,\n className,\n ref,\n ...props\n}: InputProps) {\n const inputRef = useRef<HTMLInputElement>(null),\n [uncontrolledColorValue, setUncontrolledColorValue] = useState<string>(\n getStringValue(props.defaultValue) || getStringValue(props.value) || DEFAULT_COLOR,\n ),\n [selectedFiles, setSelectedFiles] = useState<File[]>([]),\n [fileError, setFileError] = useState<string | undefined>(undefined)\n\n if (props.type === 'color') {\n const isControlled = props.value !== undefined,\n colorValue = getColorValue(isControlled, props.value, uncontrolledColorValue),\n { onChange, defaultValue: _defaultValue, value: _value, ...colorProps } = props,\n handleColorChange: NonNullable<typeof onChange> = (event) => {\n if (!isControlled) {\n setUncontrolledColorValue(event.currentTarget.value)\n }\n\n onChange?.(event)\n },\n handleColorRef = (node: HTMLInputElement | null) => {\n inputRef.current = node\n\n if (typeof ref === 'function') {\n ref(node)\n return\n }\n\n if (ref && typeof ref === 'object') {\n Object.assign(ref, { current: node })\n }\n }\n\n if (compact) {\n return (\n <button\n aria-label=\"Open color picker\"\n className={cn(\n 'relative outline-2 outline-transparent transition-colors focus-within:outline-border hover:cursor-pointer',\n size === 'small' && 'size-lg -outline-offset-2',\n size === 'medium' && 'size-xl -outline-offset-4',\n size === 'large' && 'size-2xl -outline-offset-6',\n className,\n )}\n disabled={props.disabled}\n onClick={() => inputRef.current?.click()}\n type=\"button\"\n >\n <div\n className={cn(\n 'size-full',\n size === 'small' && 'rounded-md',\n size === 'medium' && 'rounded-lg',\n size === 'large' && 'rounded-xl',\n )}\n style={{\n backgroundColor: colorValue,\n }}\n />\n <BaseInput\n className=\"peer pointer-events-none invisible absolute\"\n {...getColorInputProps(isControlled, colorValue)}\n onChange={handleColorChange}\n ref={handleColorRef}\n type=\"color\"\n {...colorProps}\n />\n </button>\n )\n }\n\n return (\n <button\n aria-label={`${colorValue}, open color picker`}\n className={cn(\n 'relative flex hover:cursor-pointer',\n inputVariants({ size, variant }),\n className,\n )}\n disabled={props.disabled}\n onClick={() => inputRef.current?.click()}\n type=\"button\"\n >\n <div\n className={cn(\n 'absolute top-1/2 left-xs aspect-square h-7/12 -translate-y-1/2',\n size === 'small' && 'rounded-md',\n size === 'medium' && 'rounded-lg',\n size === 'large' && 'rounded-xl',\n )}\n style={{\n backgroundColor: colorValue,\n }}\n />\n <BaseInput\n className=\"peer pointer-events-none invisible absolute top-lg\"\n {...getColorInputProps(isControlled, colorValue)}\n onChange={handleColorChange}\n ref={handleColorRef}\n type=\"color\"\n {...colorProps}\n />\n <p\n className={cn(\n 'text-left',\n size === 'small' && 'pr-2xs pl-lg style-text-default--1',\n size === 'medium' && 'pl-lg style-text-default-0',\n size === 'large' && 'pl-xl style-text-default-1',\n )}\n >\n {colorValue}\n </p>\n </button>\n )\n }\n\n if (props.type === 'file') {\n const { onChange, ...fileProps } = props,\n clearFiles = () => {\n if (inputRef.current) {\n inputRef.current.value = ''\n }\n\n setSelectedFiles([])\n setFileError(undefined)\n },\n handleFileChange: NonNullable<typeof onChange> = (event) => {\n const input = event.currentTarget,\n files = [...(input.files ?? [])],\n validationError = getFileValidationError(files, {\n maxFileSize,\n maxFileSizeErrorLabel,\n maxFiles,\n maxFilesErrorLabel,\n })\n if (validationError) {\n setSelectedFiles([])\n setFileError(validationError)\n input.value = ''\n return\n }\n\n setFileError(undefined)\n setSelectedFiles(files)\n onChange?.(event)\n }\n\n return (\n <div className=\"flex items-center justify-between gap-lg\">\n <div className=\"flex items-center gap-xs\">\n <Button variant=\"soft\" tone=\"neutral\" onClick={() => inputRef.current?.click()}>\n {fileUploadButtonIcon}\n {fileUploadButtonLabel}\n </Button>\n <BaseInput ref={inputRef} {...fileProps} hidden onChange={handleFileChange} />\n <p className=\"style-text-default-0\">\n {getFileStatus({\n fileError,\n filesSelectedLabel,\n placeholder: props.placeholder,\n selectedFiles,\n })}\n </p>\n </div>\n <Button\n aria-label={clearFilesLabel}\n size=\"medium\"\n variant=\"ghost\"\n tone=\"error\"\n onClick={clearFiles}\n >\n <Icon name=\"close\" />\n </Button>\n </div>\n )\n }\n\n return (\n <BaseInput className={cn(inputVariants({ size, variant }), className)} ref={ref} {...props} />\n )\n}\n"],"mappings":";;;;;;;;AAUA,MAAM,gBAAgB;AACpB,MAAA,mBAAmB;AACnB,MAAA,oBAAoB;AACpB,MAAA,8BAA8B,oBAAC,MAAD,EAAM,MAAK,SAAU,CAAA;AACnD,MAAA,6BAA6B,UAAkB,GAAG,MAAM;AACxD,MAAA,6BAA6B,aAAqB;CAChD,IAAI,aAAa,mBACf,OAAO,wBAAwB,SAAS;CAE1C,OAAO,wBAAwB,SAAS;AAC1C;AACA,MAAA,gCAAgC,UAAkB,gBAChD,IAAI,SAAS,gCAAgC,YAAY;AAE7D,SAAS,eAAe,OAAoC;CAC1D,IAAI,OAAO,UAAU,UACnB,OAAO;AAGX;AAEA,SAAS,cACP,cACA,iBACA,mBACQ;CACR,IAAI,cACF,OAAO,eAAe,eAAe,KAAK;CAE5C,OAAO,qBAAqB;AAC9B;AAEA,SAAS,mBAAmB,cA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AAM;EAAQ,CAAC,GAAG,SAAS;EAAQ;EAAK,GAAI;CAAQ,CAAA;AAEjG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Button } from "../index-
|
|
1
|
+
import { t as Button } from "../index-uaJUy56Z.js";
|
|
2
2
|
import { t as InputGroup } from "../index-DdFxZ3Xr.js";
|
|
3
3
|
import { r as IconComponent } from "../index-Wb_tILYa.js";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
package/dist/layer-tree/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
2
|
import { n as Icon } from "../icon-D3JWfCa2.js";
|
|
3
|
-
import { t as Button } from "../button-
|
|
3
|
+
import { t as Button } from "../button-DXQvyQyj.js";
|
|
4
4
|
import { t as Badge } from "../badge-Cl-9WTW-.js";
|
|
5
5
|
import { i as InputGroupAddon, r as InputGroupInput, t as InputGroup } from "../input-group-CgdazGrY.js";
|
|
6
6
|
import { i as MenuSubmenu, l as MenuPopup, n as MenuTrigger, p as MenuCheckboxItem, r as MenuSubmenuTrigger, t as Menu } from "../menu-sf13cnGp.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as AutocompleteItem, c as AutocompleteInputGroup, h as AutocompleteCollection, m as AutocompleteContent, o as AutocompleteInputGroupInput, p as AutocompleteEmpty, r as AutocompleteStatus, t as Autocomplete } from "../../index-BJVMIPq4.js";
|
|
2
|
-
import { t as ButtonGroup } from "../../index-
|
|
3
|
-
import { t as Button } from "../../index-
|
|
2
|
+
import { t as ButtonGroup } from "../../index-CpNMNewO.js";
|
|
3
|
+
import { t as Button } from "../../index-uaJUy56Z.js";
|
|
4
4
|
import React$1, { ComponentPropsWithRef, Key, ReactNode } from "react";
|
|
5
5
|
import { APIProviderProps, AdvancedMarker, MapProps } from "@vis.gl/react-google-maps";
|
|
6
6
|
import { ReactAsyncDebouncer } from "@tanstack/react-pacer";
|
package/dist/map/google/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cn } from "../../cn-BDi0DfT5.js";
|
|
2
2
|
import { n as Icon } from "../../icon-D3JWfCa2.js";
|
|
3
|
-
import { t as Button } from "../../button-
|
|
3
|
+
import { t as Button } from "../../button-DXQvyQyj.js";
|
|
4
4
|
import { a as AutocompleteItem, h as AutocompleteCollection, m as AutocompleteContent, p as AutocompleteEmpty, r as AutocompleteStatus, t as Autocomplete } from "../../autocomplete-BfpWVO1l.js";
|
|
5
|
-
import { t as ButtonGroup } from "../../button-group-
|
|
5
|
+
import { t as ButtonGroup } from "../../button-group-BiSk3iIf.js";
|
|
6
6
|
import { n as useIxiaMap } from "../../map.context-Dw1D7E8m.js";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import React, { Fragment as Fragment$1, useCallback, useEffect, useMemo, useState } from "react";
|
package/dist/map/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Button } from "../index-
|
|
2
|
-
import { i as PopoverPanel } from "../index-
|
|
1
|
+
import { t as Button } from "../index-uaJUy56Z.js";
|
|
2
|
+
import { i as PopoverPanel } from "../index-B0Qz4Egw.js";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import React, { ComponentProps, ReactNode } from "react";
|
|
5
5
|
import { Layer, LayerProps } from "@deck.gl/core";
|
package/dist/map/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
2
|
import { n as Icon } from "../icon-D3JWfCa2.js";
|
|
3
|
-
import { t as Button } from "../button-
|
|
4
|
-
import { t as Popover } from "../popover-
|
|
3
|
+
import { t as Button } from "../button-DXQvyQyj.js";
|
|
4
|
+
import { t as Popover } from "../popover-0WDxRi-s.js";
|
|
5
5
|
import { n as useIxiaMap, t as MapContext } from "../map.context-Dw1D7E8m.js";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
2
|
import { n as Icon } from "../icon-D3JWfCa2.js";
|
|
3
|
-
import { t as Button } from "../button-
|
|
3
|
+
import { t as Button } from "../button-DXQvyQyj.js";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import React from "react";
|
package/dist/popover/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as popoverHandle, a as PopoverHeader, c as PopoverButton, d as PopoverDescriptionProps, f as PopoverHeaderProps, g as PopoverTriggerProps, h as PopoverTitleProps, i as PopoverPanel, l as PopoverButtonProps, m as PopoverProps, n as PopoverTrigger, o as PopoverDescription, p as PopoverPanelProps, r as PopoverTitle, s as PopoverContent, t as Popover, u as PopoverContentProps } from "../index-
|
|
1
|
+
import { _ as popoverHandle, a as PopoverHeader, c as PopoverButton, d as PopoverDescriptionProps, f as PopoverHeaderProps, g as PopoverTriggerProps, h as PopoverTitleProps, i as PopoverPanel, l as PopoverButtonProps, m as PopoverProps, n as PopoverTrigger, o as PopoverDescription, p as PopoverPanelProps, r as PopoverTitle, s as PopoverContent, t as Popover, u as PopoverContentProps } from "../index-B0Qz4Egw.js";
|
|
2
2
|
export { Popover, PopoverButton, type PopoverButtonProps, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, PopoverHeader, type PopoverHeaderProps, PopoverPanel, type PopoverPanelProps, type PopoverProps, PopoverTitle, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerProps, popoverHandle };
|
package/dist/popover/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Popover, l as PopoverButton, c as PopoverContent, s as PopoverDescription, o as PopoverHeader, i as PopoverPanel, r as PopoverTitle, n as PopoverTrigger, a as popoverHandle } from "../popover-
|
|
1
|
+
export { t as Popover, l as PopoverButton, c as PopoverContent, s as PopoverDescription, o as PopoverHeader, i as PopoverPanel, r as PopoverTitle, n as PopoverTrigger, a as popoverHandle } from "../popover-0WDxRi-s.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cn } from "./cn-BDi0DfT5.js";
|
|
2
|
-
import { t as Button } from "./button-
|
|
2
|
+
import { t as Button } from "./button-DXQvyQyj.js";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { isValidElement } from "react";
|
|
@@ -111,4 +111,4 @@ const Popover$1 = Object.assign(Popover$2, {
|
|
|
111
111
|
});
|
|
112
112
|
export { popoverHandle as a, PopoverContent as c, PopoverPanel as i, PopoverButton as l, PopoverTrigger as n, PopoverHeader as o, PopoverTitle as r, PopoverDescription as s, Popover$1 as t };
|
|
113
113
|
|
|
114
|
-
//# sourceMappingURL=popover-
|
|
114
|
+
//# sourceMappingURL=popover-0WDxRi-s.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-B1s4xXrX.js","names":["Popover","BasePopover","BasePopover","BasePopover","BasePopover","BasePopover","BasePopover","Popover","PopoverRoot"],"sources":["../src/components/popover/popover.tsx","../src/components/popover/popover-button.tsx","../src/components/popover/popover-content.tsx","../src/components/popover/popover-description.tsx","../src/components/popover/popover-header.tsx","../src/components/popover/popover.types.ts","../src/components/popover/popover-panel.tsx","../src/components/popover/popover-title.tsx","../src/components/popover/popover-trigger.tsx","../src/components/popover/index.ts"],"sourcesContent":["import { Popover as BasePopover } from '@base-ui/react/popover'\n\nimport type { PopoverProps } from './popover.types'\n\nexport function Popover({ ...props }: PopoverProps) {\n return <BasePopover.Root {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport type { PopoverButtonProps } from './popover.types'\n\nexport function PopoverButton({\n variant,\n tone,\n className,\n children,\n ref,\n ...props\n}: PopoverButtonProps) {\n if (variant === 'ghost' && tone === 'neutral') {\n return (\n <Button\n variant={variant}\n tone={tone}\n className={cn('hover:bg-neutral-container-high!', className)}\n ref={ref}\n {...props}\n >\n {children}\n </Button>\n )\n }\n\n return (\n <Button variant={variant} tone={tone} className={cn('', className)} ref={ref} {...props}>\n {children}\n </Button>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { PopoverContentProps } from './popover.types'\n\nexport function PopoverContent({ className, ref, ...props }: PopoverContentProps) {\n return <div className={cn('space-y-3xs', className)} ref={ref} {...props} />\n}\n","import { Popover as BasePopover } from '@base-ui/react/popover'\n\nimport { cn } from '@/utils/cn'\n\nimport type { PopoverDescriptionProps } from './popover.types'\n\nexport function PopoverDescription({ className, ref, ...props }: PopoverDescriptionProps) {\n return (\n <BasePopover.Description\n className={cn('style-text-prose--1', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { PopoverHeaderProps } from './popover.types'\n\nexport function PopoverHeader({ className, ref, ...props }: PopoverHeaderProps) {\n return <div className={cn('flex flex-col pb-xs', className)} ref={ref} {...props} />\n}\n","import { Popover as BasePopover } from '@base-ui/react/popover'\nimport { cva } from 'class-variance-authority'\nimport type { VariantProps } from 'class-variance-authority'\n\nimport type { Button } from '../button'\n\nconst popoverPanelVariants = cva(\n 'relative z-99 h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) overflow-hidden rounded-2xl text-on-surface transition-[width,height,opacity,scale] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-ending-style:scale-90 data-ending-style:opacity-0 data-instant:transition-none data-starting-style:scale-90 data-starting-style:opacity-0',\n {\n defaultVariants: {\n elevation: 'medium',\n },\n variants: {\n elevation: {\n high: 'bg-surface-3 shadow-lg',\n low: 'bg-surface shadow-sm',\n medium: 'bg-surface-2 shadow-md',\n },\n },\n },\n ),\n popoverHandle = BasePopover.createHandle<React.ComponentType>()\n\ntype PopoverProps = React.ComponentProps<typeof BasePopover.Root>\ntype PopoverTriggerProps = React.ComponentProps<typeof BasePopover.Trigger>\ntype PopoverPanelProps = React.ComponentProps<typeof BasePopover.Positioner> &\n VariantProps<typeof popoverPanelVariants>\ntype PopoverTitleProps = React.ComponentProps<typeof BasePopover.Title>\ntype PopoverDescriptionProps = React.ComponentProps<typeof BasePopover.Description>\ntype PopoverHeaderProps = React.ComponentProps<'div'>\ntype PopoverContentProps = React.ComponentProps<'div'>\ntype PopoverButtonProps = React.ComponentProps<typeof Button>\n\nexport type {\n PopoverProps,\n PopoverTriggerProps,\n PopoverPanelProps,\n PopoverTitleProps,\n PopoverDescriptionProps,\n PopoverHeaderProps,\n PopoverContentProps,\n PopoverButtonProps,\n}\nexport { popoverHandle, popoverPanelVariants }\n","import { Popover as BasePopover } from '@base-ui/react/popover'\n\nimport { cn } from '../../utils/cn'\nimport { popoverPanelVariants } from './popover.types'\nimport type { PopoverPanelProps } from './popover.types'\n\nexport function PopoverPanel({ elevation, className, ref, children, ...props }: PopoverPanelProps) {\n return (\n <BasePopover.Portal>\n <BasePopover.Positioner\n className={cn(\n 'h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none',\n )}\n ref={ref}\n sideOffset={8}\n {...props}\n >\n <BasePopover.Popup className={popoverPanelVariants({ className, elevation })}>\n <BasePopover.Arrow className=\"flex transition-[left] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180\" />\n <BasePopover.Viewport\n className={cn(\n \"relative h-(--popup-height,auto) w-(--popup-width,auto) max-w-full overflow-clip p-[1rem] transition-[width,height] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] **:data-current:w-[calc(var(--popup-width)-2rem)] **:data-current:translate-x-0 **:data-current:opacity-100 **:data-current:transition-[translate,opacity] **:data-current:duration-[350ms,175ms] **:data-current:ease-[cubic-bezier(0.22,1,0.36,1)] **:data-previous:w-[calc(var(--popup-width)-2rem)] **:data-previous:translate-x-0 **:data-previous:opacity-100 **:data-previous:transition-[translate,opacity] **:data-previous:duration-[350ms,175ms] **:data-previous:ease-[cubic-bezier(0.22,1,0.36,1)] **:data-[activation-direction~='left']:data-previous:data-ending-style:translate-x-1/2 **:data-[activation-direction~='left']:data-previous:data-ending-style:opacity-0 **:data-[activation-direction~='left']:data-current:data-starting-style:-translate-x-1/2 **:data-[activation-direction~='left']:data-current:data-starting-style:opacity-0 **:data-[activation-direction~='right']:data-previous:data-ending-style:-translate-x-1/2 **:data-[activation-direction~='right']:data-previous:data-ending-style:opacity-0 **:data-[activation-direction~='right']:data-current:data-starting-style:translate-x-1/2 **:data-[activation-direction~='right']:data-current:data-starting-style:opacity-0\",\n className,\n )}\n >\n {children}\n </BasePopover.Viewport>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n )\n}\n","import { Popover as BasePopover } from '@base-ui/react/popover'\n\nimport { cn } from '@/utils/cn'\n\nimport type { PopoverTitleProps } from './popover.types'\n\nexport function PopoverTitle({ className, ref, ...props }: PopoverTitleProps) {\n return (\n <BasePopover.Title\n className={cn('flex items-center gap-2xs style-text-strong-0 [&>svg]:size-sm', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { Popover as BasePopover } from '@base-ui/react/popover'\nimport { isValidElement } from 'react'\nimport type { ReactElement } from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport type { PopoverTriggerProps } from './popover.types'\n\nexport function PopoverTrigger({ className, children, ref, ...props }: PopoverTriggerProps) {\n let render: ReactElement | undefined = undefined\n if (isValidElement(children)) {\n render = children\n }\n\n return (\n <BasePopover.Trigger className={cn('px-xs', className)} ref={ref} render={render} {...props} />\n )\n}\n","import { Popover as PopoverRoot } from './popover'\nimport { PopoverButton } from './popover-button'\nimport { PopoverContent } from './popover-content'\nimport { PopoverDescription } from './popover-description'\nimport { PopoverHeader } from './popover-header'\nimport { PopoverPanel } from './popover-panel'\nimport { PopoverTitle } from './popover-title'\nimport { PopoverTrigger } from './popover-trigger'\n\nconst Popover = Object.assign(PopoverRoot, {\n Button: PopoverButton,\n Content: PopoverContent,\n Description: PopoverDescription,\n Header: PopoverHeader,\n Panel: PopoverPanel,\n Title: PopoverTitle,\n Trigger: PopoverTrigger,\n})\n\nexport type {\n PopoverButtonProps,\n PopoverContentProps,\n PopoverDescriptionProps,\n PopoverHeaderProps,\n PopoverPanelProps,\n PopoverProps,\n PopoverTitleProps,\n PopoverTriggerProps,\n} from './popover.types'\nexport { PopoverButton } from './popover-button'\nexport { PopoverDescription } from './popover-description'\nexport { PopoverPanel } from './popover-panel'\nexport { PopoverTitle } from './popover-title'\nexport { PopoverTrigger } from './popover-trigger'\nexport { PopoverHeader } from './popover-header'\nexport { PopoverContent } from './popover-content'\nexport { popoverHandle } from './popover.types'\n\nexport { Popover }\n"],"mappings":";;;;;;;AAIA,SAAgBA,UAAQ,EAAE,GAAG,SAAuB;CAClD,OAAO,oBAACC,QAAY,MAAb,EAAkB,GAAI,MAAQ,CAAA;AACvC;;ACDA,SAAgB,cAAc,EAC5B,SACA,MACA,WACA,UACA,KACA,GAAG,SACkB;CACrB,IAAI,YAAY,WAAW,SAAS,WAClC,OACE,oBAAC,QAAD;EACW;EACH;EACN,WAAW,GAAG,oCAAoC,SAAS;EACtD;EACL,GAAI;EAEH;CACK,CAAA;CAIZ,OACE,oBAAC,QAAD;EAAiB;EAAe;EAAM,WAAW,GAAG,IAAI,SAAS;EAAQ;EAAK,GAAI;EAC/E;CACK,CAAA;AAEZ;;AC5BA,SAAgB,eAAe,EAAE,WAAW,KAAK,GAAG,SAA8B;CAChF,OAAO,oBAAC,OAAD;EAAK,WAAW,GAAG,eAAe,SAAS;EAAQ;EAAK,GAAI;CAA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S,SAAS;EAAQ;EAAa;EAAQ,GAAI;CAAQ,CAAA;AAElG;;ACRA,MAAMC,YAAU,OAAO,OAAOC,WAAa;CACzC,QAAQ;CACR,SAAS;CACT,aAAa;CACb,QAAQ;CACR,OAAO;CACP,OAAO;CACP,SAAS;AACX,CAAC"}
|
|
1
|
+
{"version":3,"file":"popover-0WDxRi-s.js","names":["Popover","BasePopover","BasePopover","BasePopover","BasePopover","BasePopover","BasePopover","Popover","PopoverRoot"],"sources":["../src/components/popover/popover.tsx","../src/components/popover/popover-button.tsx","../src/components/popover/popover-content.tsx","../src/components/popover/popover-description.tsx","../src/components/popover/popover-header.tsx","../src/components/popover/popover.types.ts","../src/components/popover/popover-panel.tsx","../src/components/popover/popover-title.tsx","../src/components/popover/popover-trigger.tsx","../src/components/popover/index.ts"],"sourcesContent":["import { Popover as BasePopover } from '@base-ui/react/popover'\n\nimport type { PopoverProps } from './popover.types'\n\nexport function Popover({ ...props }: PopoverProps) {\n return <BasePopover.Root {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport type { PopoverButtonProps } from './popover.types'\n\nexport function PopoverButton({\n variant,\n tone,\n className,\n children,\n ref,\n ...props\n}: PopoverButtonProps) {\n if (variant === 'ghost' && tone === 'neutral') {\n return (\n <Button\n variant={variant}\n tone={tone}\n className={cn('hover:bg-neutral-container-high!', className)}\n ref={ref}\n {...props}\n >\n {children}\n </Button>\n )\n }\n\n return (\n <Button variant={variant} tone={tone} className={cn('', className)} ref={ref} {...props}>\n {children}\n </Button>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { PopoverContentProps } from './popover.types'\n\nexport function PopoverContent({ className, ref, ...props }: PopoverContentProps) {\n return <div className={cn('space-y-3xs', className)} ref={ref} {...props} />\n}\n","import { Popover as BasePopover } from '@base-ui/react/popover'\n\nimport { cn } from '@/utils/cn'\n\nimport type { PopoverDescriptionProps } from './popover.types'\n\nexport function PopoverDescription({ className, ref, ...props }: PopoverDescriptionProps) {\n return (\n <BasePopover.Description\n className={cn('style-text-prose--1', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { PopoverHeaderProps } from './popover.types'\n\nexport function PopoverHeader({ className, ref, ...props }: PopoverHeaderProps) {\n return <div className={cn('flex flex-col pb-xs', className)} ref={ref} {...props} />\n}\n","import { Popover as BasePopover } from '@base-ui/react/popover'\nimport { cva } from 'class-variance-authority'\nimport type { VariantProps } from 'class-variance-authority'\n\nimport type { Button } from '../button'\n\nconst popoverPanelVariants = cva(\n 'relative z-99 h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) overflow-hidden rounded-2xl text-on-surface transition-[width,height,opacity,scale] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-ending-style:scale-90 data-ending-style:opacity-0 data-instant:transition-none data-starting-style:scale-90 data-starting-style:opacity-0',\n {\n defaultVariants: {\n elevation: 'medium',\n },\n variants: {\n elevation: {\n high: 'bg-surface-3 shadow-lg',\n low: 'bg-surface shadow-sm',\n medium: 'bg-surface-2 shadow-md',\n },\n },\n },\n ),\n popoverHandle = BasePopover.createHandle<React.ComponentType>()\n\ntype PopoverProps = React.ComponentProps<typeof BasePopover.Root>\ntype PopoverTriggerProps = React.ComponentProps<typeof BasePopover.Trigger>\ntype PopoverPanelProps = React.ComponentProps<typeof BasePopover.Positioner> &\n VariantProps<typeof popoverPanelVariants>\ntype PopoverTitleProps = React.ComponentProps<typeof BasePopover.Title>\ntype PopoverDescriptionProps = React.ComponentProps<typeof BasePopover.Description>\ntype PopoverHeaderProps = React.ComponentProps<'div'>\ntype PopoverContentProps = React.ComponentProps<'div'>\ntype PopoverButtonProps = React.ComponentProps<typeof Button>\n\nexport type {\n PopoverProps,\n PopoverTriggerProps,\n PopoverPanelProps,\n PopoverTitleProps,\n PopoverDescriptionProps,\n PopoverHeaderProps,\n PopoverContentProps,\n PopoverButtonProps,\n}\nexport { popoverHandle, popoverPanelVariants }\n","import { Popover as BasePopover } from '@base-ui/react/popover'\n\nimport { cn } from '../../utils/cn'\nimport { popoverPanelVariants } from './popover.types'\nimport type { PopoverPanelProps } from './popover.types'\n\nexport function PopoverPanel({ elevation, className, ref, children, ...props }: PopoverPanelProps) {\n return (\n <BasePopover.Portal>\n <BasePopover.Positioner\n className={cn(\n 'h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none',\n )}\n ref={ref}\n sideOffset={8}\n {...props}\n >\n <BasePopover.Popup className={popoverPanelVariants({ className, elevation })}>\n <BasePopover.Arrow className=\"flex transition-[left] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180\" />\n <BasePopover.Viewport\n className={cn(\n \"relative h-(--popup-height,auto) w-(--popup-width,auto) max-w-full overflow-clip p-[1rem] transition-[width,height] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] **:data-current:w-[calc(var(--popup-width)-2rem)] **:data-current:translate-x-0 **:data-current:opacity-100 **:data-current:transition-[translate,opacity] **:data-current:duration-[350ms,175ms] **:data-current:ease-[cubic-bezier(0.22,1,0.36,1)] **:data-previous:w-[calc(var(--popup-width)-2rem)] **:data-previous:translate-x-0 **:data-previous:opacity-100 **:data-previous:transition-[translate,opacity] **:data-previous:duration-[350ms,175ms] **:data-previous:ease-[cubic-bezier(0.22,1,0.36,1)] **:data-[activation-direction~='left']:data-previous:data-ending-style:translate-x-1/2 **:data-[activation-direction~='left']:data-previous:data-ending-style:opacity-0 **:data-[activation-direction~='left']:data-current:data-starting-style:-translate-x-1/2 **:data-[activation-direction~='left']:data-current:data-starting-style:opacity-0 **:data-[activation-direction~='right']:data-previous:data-ending-style:-translate-x-1/2 **:data-[activation-direction~='right']:data-previous:data-ending-style:opacity-0 **:data-[activation-direction~='right']:data-current:data-starting-style:translate-x-1/2 **:data-[activation-direction~='right']:data-current:data-starting-style:opacity-0\",\n className,\n )}\n >\n {children}\n </BasePopover.Viewport>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n )\n}\n","import { Popover as BasePopover } from '@base-ui/react/popover'\n\nimport { cn } from '@/utils/cn'\n\nimport type { PopoverTitleProps } from './popover.types'\n\nexport function PopoverTitle({ className, ref, ...props }: PopoverTitleProps) {\n return (\n <BasePopover.Title\n className={cn('flex items-center gap-2xs style-text-strong-0 [&>svg]:size-sm', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { Popover as BasePopover } from '@base-ui/react/popover'\nimport { isValidElement } from 'react'\nimport type { ReactElement } from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport type { PopoverTriggerProps } from './popover.types'\n\nexport function PopoverTrigger({ className, children, ref, ...props }: PopoverTriggerProps) {\n let render: ReactElement | undefined = undefined\n if (isValidElement(children)) {\n render = children\n }\n\n return (\n <BasePopover.Trigger className={cn('px-xs', className)} ref={ref} render={render} {...props} />\n )\n}\n","import { Popover as PopoverRoot } from './popover'\nimport { PopoverButton } from './popover-button'\nimport { PopoverContent } from './popover-content'\nimport { PopoverDescription } from './popover-description'\nimport { PopoverHeader } from './popover-header'\nimport { PopoverPanel } from './popover-panel'\nimport { PopoverTitle } from './popover-title'\nimport { PopoverTrigger } from './popover-trigger'\n\nconst Popover = Object.assign(PopoverRoot, {\n Button: PopoverButton,\n Content: PopoverContent,\n Description: PopoverDescription,\n Header: PopoverHeader,\n Panel: PopoverPanel,\n Title: PopoverTitle,\n Trigger: PopoverTrigger,\n})\n\nexport type {\n PopoverButtonProps,\n PopoverContentProps,\n PopoverDescriptionProps,\n PopoverHeaderProps,\n PopoverPanelProps,\n PopoverProps,\n PopoverTitleProps,\n PopoverTriggerProps,\n} from './popover.types'\nexport { PopoverButton } from './popover-button'\nexport { PopoverDescription } from './popover-description'\nexport { PopoverPanel } from './popover-panel'\nexport { PopoverTitle } from './popover-title'\nexport { PopoverTrigger } from './popover-trigger'\nexport { PopoverHeader } from './popover-header'\nexport { PopoverContent } from './popover-content'\nexport { popoverHandle } from './popover.types'\n\nexport { Popover }\n"],"mappings":";;;;;;;AAIA,SAAgBA,UAAQ,EAAE,GAAG,SAAuB;CAClD,OAAO,oBAACC,QAAY,MAAb,EAAkB,GAAI,MAAQ,CAAA;AACvC;;ACDA,SAAgB,cAAc,EAC5B,SACA,MACA,WACA,UACA,KACA,GAAG,SACkB;CACrB,IAAI,YAAY,WAAW,SAAS,WAClC,OACE,oBAAC,QAAD;EACW;EACH;EACN,WAAW,GAAG,oCAAoC,SAAS;EACtD;EACL,GAAI;EAEH;CACK,CAAA;CAIZ,OACE,oBAAC,QAAD;EAAiB;EAAe;EAAM,WAAW,GAAG,IAAI,SAAS;EAAQ;EAAK,GAAI;EAC/E;CACK,CAAA;AAEZ;;AC5BA,SAAgB,eAAe,EAAE,WAAW,KAAK,GAAG,SAA8B;CAChF,OAAO,oBAAC,OAAD;EAAK,WAAW,GAAG,eAAe,SAAS;EAAQ;EAAK,GAAI;CAAQ,CAAA;AAC7E;;ACAA,SAAgB,mBAAmB,EAAE,WAAW,KAAK,GAAG,SAAkC;CACxF,OACE,oBAACC,QAAY,aAAb;EACE,WAAW,GAAG,uBAAuB,SAAS;EACzC;EACL,GAAI;CACL,CAAA;AAEL;;ACVA,SAAgB,cAAc,EAAE,WAAW,KAAK,GAAG,SAA6B;CAC9E,OAAO,oBAAC,OAAD;EAAK,WAAW,GAAG,uBAAuB,SAAS;EAAQ;EAAK,GAAI;CAAQ,CAAA;AACrF;;ACAA,MAAM,uBAAuB,IACzB,mXACA;CACE,iBAAiB,EACf,WAAW,SACb;CACA,UAAU,EACR,WAAW;EACT,MAAM;EACN,KAAK;EACL,QAAQ;CACV,EACF;AACF,CACF;AACA,MAAA,gBAAgBC,QAAY,aAAkC;;ACfhE,SAAgB,aAAa,EAAE,WAAW,WAAW,KAAK,UAAU,GAAG,SAA4B;CACjG,OACE,oBAACC,QAAY,QAAb,EAAA,UACE,oBAACA,QAAY,YAAb;EACE,WAAW,GACT,wMACF;EACK;EACL,YAAY;EACZ,GAAI;EAEJ,UAAA,qBAACA,QAAY,OAAb;GAAmB,WAAW,qBAAqB;IAAE;IAAW;GAAU,CAAC;GAA3E,UAAA,CACE,oBAACA,QAAY,OAAb,EAAmB,WAAU,0RAA2R,CAAA,GACxT,oBAACA,QAAY,UAAb;IACE,WAAW,GACT,q0CACA,SACF;IAEC;GACmB,CAAA,CACL;;CACG,CAAA,EACN,CAAA;AAExB;;ACzBA,SAAgB,aAAa,EAAE,WAAW,KAAK,GAAG,SAA4B;CAC5E,OACE,oBAACC,QAAY,OAAb;EACE,WAAW,GAAG,iEAAiE,SAAS;EACnF;EACL,GAAI;CACL,CAAA;AAEL;;ACNA,SAAgB,eAAe,EAAE,WAAW,UAAU,KAAK,GAAG,SAA8B;CAC1F,IAAI,SAAmC,KAAA;CACvC,IAAI,eAAe,QAAQ,GACzB,SAAS;CAGX,OACE,oBAACC,QAAY,SAAb;EAAqB,WAAW,GAAG,SAAS,SAAS;EAAQ;EAAa;EAAQ,GAAI;CAAQ,CAAA;AAElG;;ACRA,MAAMC,YAAU,OAAO,OAAOC,WAAa;CACzC,QAAQ;CACR,SAAS;CACT,aAAa;CACb,QAAQ;CACR,OAAO;CACP,OAAO;CACP,SAAS;AACX,CAAC"}
|
package/dist/sidebar/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Badge } from "../index-0ZQzIKoE.js";
|
|
2
|
-
import { t as Button } from "../index-
|
|
3
|
-
import { n as CollapsibleTrigger, r as CollapsiblePanel, t as Collapsible } from "../index-
|
|
2
|
+
import { t as Button } from "../index-uaJUy56Z.js";
|
|
3
|
+
import { n as CollapsibleTrigger, r as CollapsiblePanel, t as Collapsible } from "../index-DXDObRKO.js";
|
|
4
4
|
import React$1 from "react";
|
|
5
5
|
type SidebarToggleProps = Omit<React.ComponentProps<typeof Button>, 'children'> & {
|
|
6
6
|
children: React.ReactNode | ((open?: boolean) => React.ReactNode);
|
package/dist/sidebar/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
2
|
import { n as Icon } from "../icon-D3JWfCa2.js";
|
|
3
|
-
import { t as Button } from "../button-
|
|
3
|
+
import { t as Button } from "../button-DXQvyQyj.js";
|
|
4
4
|
import { t as Badge } from "../badge-Cl-9WTW-.js";
|
|
5
|
-
import { n as CollapsibleTrigger, r as CollapsiblePanel, t as Collapsible } from "../collapsible-
|
|
6
|
-
import { c as PopoverContent, i as PopoverPanel, n as PopoverTrigger, t as Popover } from "../popover-
|
|
5
|
+
import { n as CollapsibleTrigger, r as CollapsiblePanel, t as Collapsible } from "../collapsible-C3OPWY9l.js";
|
|
6
|
+
import { c as PopoverContent, i as PopoverPanel, n as PopoverTrigger, t as Popover } from "../popover-0WDxRi-s.js";
|
|
7
7
|
import { o as useMediaQuery } from "../hooks-DUm-q_ig.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import React, { Children, isValidElement } from "react";
|
|
@@ -164,7 +164,7 @@ function SidebarGroupLabel({ className, ref, ...props }) {
|
|
|
164
164
|
const { open, collapsible } = useSidebar();
|
|
165
165
|
if (!(collapsible === "none" || open)) return;
|
|
166
166
|
return /* @__PURE__ */ jsx("span", {
|
|
167
|
-
className: cn("inline-flex h-md w-full items-center justify-between truncate pr-3xs pl-md style-text-default--1 text-on-surface-variant transition-all duration-200 ease-out", collapsible !== "none" && open && "animate-in fade-in-0 slide-in-from-left-2", className),
|
|
167
|
+
className: cn("inline-flex h-md w-full items-center justify-between truncate pr-3xs pl-[calc(var(--ixia-spacing-md)-1px)] style-text-default--1 text-on-surface-variant transition-all duration-200 ease-out", collapsible !== "none" && open && "animate-in fade-in-0 slide-in-from-left-2", className),
|
|
168
168
|
ref,
|
|
169
169
|
...props
|
|
170
170
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Sidebar","BaseScrollArea","SidebarRoot"],"sources":["../../src/components/sidebar/sidebar-provider.tsx","../../src/components/sidebar/sidebar.tsx","../../src/components/sidebar/sidebar-content.tsx","../../src/components/sidebar/sidebar-footer.tsx","../../src/components/sidebar/sidebar-group.tsx","../../src/components/sidebar/sidebar-group-content.tsx","../../src/components/sidebar/sidebar-group-label.tsx","../../src/components/sidebar/sidebar-header.tsx","../../src/components/sidebar/sidebar-inset.tsx","../../src/components/sidebar/sidebar-menu.tsx","../../src/components/sidebar/sidebar-menu-badge.tsx","../../src/components/sidebar/sidebar-menu-button.tsx","../../src/components/sidebar/sidebar-menu-collapsible.tsx","../../src/components/sidebar/sidebar-menu-collapsible-panel.tsx","../../src/components/sidebar/sidebar-menu-collapsible-trigger.tsx","../../src/components/sidebar/sidebar-menu-item.tsx","../../src/components/sidebar/sidebar-toggle.tsx","../../src/components/sidebar/sidebar.utils.ts","../../src/components/sidebar/index.ts"],"sourcesContent":["import React from 'react'\n\nimport { useMediaQuery } from '@/hooks'\nimport { cn } from '@/utils/cn'\n\ntype SidebarContextProps = React.ComponentProps<'div'> & {\n id: string\n defaultOpen?: boolean\n trigger?: () => void\n open?: boolean\n setOpen?: (open: boolean) => void\n isMobile?: boolean\n side?: 'left' | 'right'\n collapsible?: 'offcanvas' | 'icon' | 'none'\n}\n\n// 7 days in seconds\nconst SIDEBAR_COOKIE_MAX_AGE_SECONDS = 604_800,\n // oxlint-disable-next-line unicorn/no-null\n SidebarContext = React.createContext<SidebarContextProps | null>(null),\n useSidebar = () => {\n const context = React.useContext(SidebarContext)\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider')\n }\n return context\n }\n\nfunction resolveOpenState(\n value: boolean | ((open: boolean) => boolean),\n previous: boolean,\n): boolean {\n if (typeof value === 'function') {\n return value(previous)\n }\n return value\n}\n\nfunction SidebarProvider({\n id,\n defaultOpen = true,\n side = 'left',\n collapsible = 'icon',\n className,\n ref,\n ...props\n}: SidebarContextProps) {\n const cookieName = `sidebar-state-${id}`,\n [openState, setOpenState] = React.useState<boolean>(defaultOpen),\n [mobileOpen, setMobileOpen] = React.useState(false),\n isMobile = useMediaQuery('mobile'),\n setOpen = (value: boolean | ((open: boolean) => boolean)) => {\n if (isMobile) {\n setMobileOpen((prev) => resolveOpenState(value, prev))\n return\n }\n setOpenState((prev) => {\n const nextOpen = resolveOpenState(value, prev)\n\n document.cookie = [\n `${cookieName}=${encodeURIComponent(String(nextOpen))}`,\n 'path=/',\n `max-age=${SIDEBAR_COOKIE_MAX_AGE_SECONDS}`,\n 'samesite=lax',\n ].join('; ')\n\n return nextOpen\n })\n },\n trigger = () => setOpen((prev) => !prev)\n\n React.useEffect(() => {\n if (!isMobile) {\n setMobileOpen(false)\n }\n }, [isMobile])\n\n let effectiveCollapsible = collapsible,\n open = openState\n if (isMobile) {\n effectiveCollapsible = 'offcanvas'\n open = mobileOpen\n }\n\n return (\n <SidebarContext.Provider\n value={{\n collapsible: effectiveCollapsible,\n defaultOpen,\n id,\n isMobile,\n open,\n setOpen,\n side,\n trigger,\n }}\n >\n <div\n className={cn(\n 'relative flex min-h-0 w-full min-w-0 flex-1',\n side === 'left' && 'flex flex-row',\n side === 'right' && 'flex flex-row-reverse',\n className,\n )}\n ref={ref}\n {...props}\n />\n </SidebarContext.Provider>\n )\n}\n\nexport { SidebarProvider, useSidebar }\n","import React from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarProps } from './sidebar.types'\n\nconst DEFAULT_SIDEBAR_WIDTH = 400\n\ninterface SidebarLayoutProps {\n collapsible?: 'offcanvas' | 'icon' | 'none'\n open?: boolean\n isMobile?: boolean\n width: string | number\n}\n\nfunction getOffcanvasWidth(\n open: boolean | undefined,\n isMobile: boolean | undefined,\n fullWidth: React.CSSProperties,\n): React.CSSProperties {\n if (!open) {\n return { width: '0px' }\n }\n if (isMobile) {\n return { width: '33.333333%' }\n }\n return fullWidth\n}\n\nfunction getIconWidth(\n open: boolean | undefined,\n isMobile: boolean | undefined,\n fullWidth: React.CSSProperties,\n): React.CSSProperties {\n if (open) {\n return fullWidth\n }\n if (isMobile) {\n return { width: '0px' }\n }\n return { width: '80px' }\n}\n\nfunction getWidthStyle({\n collapsible,\n open,\n isMobile,\n width,\n}: SidebarLayoutProps): React.CSSProperties {\n const fullWidth: React.CSSProperties = { width: `${width}px` }\n if (collapsible === 'offcanvas') {\n return getOffcanvasWidth(open, isMobile, fullWidth)\n }\n if (collapsible === 'icon') {\n return getIconWidth(open, isMobile, fullWidth)\n }\n return fullWidth\n}\n\nfunction getGapClasses({ collapsible, open }: SidebarLayoutProps) {\n if (collapsible === 'none') {\n return 'gap-lg'\n }\n if (open) {\n return 'gap-lg'\n }\n return 'gap-sm'\n}\n\nfunction getPositionClasses({ collapsible, open, isMobile }: SidebarLayoutProps) {\n if ((collapsible === 'offcanvas' || collapsible === 'icon') && !open && isMobile) {\n return 'absolute z-50 -translate-x-full'\n }\n\n if ((collapsible === 'offcanvas' || collapsible === 'icon') && open && isMobile) {\n return 'absolute z-50'\n }\n\n return ''\n}\n\nexport function Sidebar({\n tone = 'primary',\n width = DEFAULT_SIDEBAR_WIDTH,\n className,\n ...props\n}: SidebarProps) {\n const { open, setOpen, isMobile, collapsible, side } = useSidebar(),\n sidebarRef = React.useRef<HTMLDivElement>(null),\n isHidden = collapsible === 'offcanvas' && !open,\n layout: SidebarLayoutProps = { collapsible, isMobile, open, width }\n\n React.useEffect(() => {\n const handleOutsideClick = (event: MouseEvent) => {\n if (\n sidebarRef.current &&\n event.target instanceof Node &&\n !sidebarRef.current.contains(event.target) &&\n isMobile &&\n open &&\n setOpen\n ) {\n setOpen(false)\n }\n }\n\n document.addEventListener('click', handleOutsideClick)\n\n return () => {\n document.removeEventListener('click', handleOutsideClick)\n }\n }, [open, setOpen, isMobile])\n\n return (\n <div\n className={cn(\n 'sticky left-[0px] flex h-full max-h-dvh min-h-0 shrink-0 flex-col overflow-hidden border-border bg-surface transition-[width,transform] duration-300 ease-in-out',\n className,\n tone === 'primary' && 'bg-surface-background',\n tone === 'secondary' && 'bg-surface',\n tone === 'ghost' && 'bg-transparent',\n getGapClasses(layout),\n getPositionClasses(layout),\n isHidden && 'invisible',\n collapsible === 'offcanvas' && !open && 'border-none',\n open && 'p-md',\n collapsible === 'icon' && !open && 'py-md',\n isMobile && 'border-none',\n side === 'left' && 'border-r',\n side === 'right' && 'border-l',\n )}\n ref={sidebarRef}\n style={getWidthStyle(layout)}\n {...props}\n aria-hidden={isHidden || undefined}\n inert={isHidden}\n />\n )\n}\n","import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area'\n\nimport { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarContentProps } from './sidebar.types'\n\nexport function SidebarContent({ className, children, ref, ...props }: SidebarContentProps) {\n const { open } = useSidebar()\n\n return (\n <BaseScrollArea.Root\n className={cn(\n 'min-h-0 flex-1 overflow-hidden rounded-xl transition-all duration-300 ease-in-out',\n !open && 'w-fit self-center',\n className,\n )}\n ref={ref}\n {...props}\n >\n <BaseScrollArea.Viewport\n className={cn(\n 'flex h-full scrollbar-none flex-col items-center overflow-y-auto overscroll-contain [&::-webkit-scrollbar]:hidden',\n 'before:pointer-events-none before:absolute before:top-0 before:left-0 before:block before:h-[min(40px,var(--scroll-area-overflow-y-start))] before:w-full before:bg-linear-to-b before:from-shadow/35 before:to-transparent before:transition-[height] before:duration-100 before:ease-out before:content-[\"\"] before:[--scroll-area-overflow-y-start:inherit]',\n 'after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:block after:h-[min(40px,var(--scroll-area-overflow-y-end,40px))] after:w-full after:bg-linear-to-t after:from-shadow/35 after:to-transparent after:transition-[height] after:duration-100 after:ease-out after:content-[\"\"] after:[--scroll-area-overflow-y-end:inherit]',\n open && 'gap-md',\n !open && 'gap-xs px-3xs pt-3xs',\n )}\n >\n {children}\n </BaseScrollArea.Viewport>\n </BaseScrollArea.Root>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarFooterProps } from './sidebar.types'\n\nexport function SidebarFooter({ className, children, ref, ...props }: SidebarFooterProps) {\n const { open, collapsible } = useSidebar(),\n isExpanded = collapsible === 'none' || open\n return (\n <div\n className={cn(\n 'flex shrink-0 animate-in items-center truncate p-3xs transition-all duration-300 ease-in-out',\n open && 'justify-start fade-in-0',\n !open && 'justify-center self-center fade-out-0',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children(isExpanded)}\n </div>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { SidebarGroupProps } from './sidebar.types'\n\nexport function SidebarGroup({ className, ref, ...props }: SidebarGroupProps) {\n return (\n <div\n className={cn('flex w-full flex-col items-start gap-2xs not-last-of-type:pb-md', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { SidebarGroupContentProps } from './sidebar.types'\n\nexport function SidebarGroupContent({ className, ref, ...props }: SidebarGroupContentProps) {\n return <div className={cn('flex w-full flex-col gap-3xs', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarGroupLabelProps } from './sidebar.types'\n\nexport function SidebarGroupLabel({ className, ref, ...props }: SidebarGroupLabelProps) {\n const { open, collapsible } = useSidebar(),\n showLabel = collapsible === 'none' || open\n\n if (!showLabel) {\n return undefined\n }\n\n return (\n <span\n className={cn(\n 'inline-flex h-md w-full items-center justify-between truncate pr-3xs pl-md style-text-default--1 text-on-surface-variant transition-all duration-200 ease-out',\n collapsible !== 'none' && open && 'animate-in fade-in-0 slide-in-from-left-2',\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarHeaderProps } from './sidebar.types'\n\nexport function SidebarHeader({ className, children, ref, ...props }: SidebarHeaderProps) {\n const { open, collapsible } = useSidebar(),\n isExpanded = collapsible === 'none' || open\n\n return (\n <div\n className={cn(\n 'flex shrink-0 items-center justify-start gap-xs truncate style-text-strong-1 transition-all duration-200 ease-out',\n !open && 'self-center',\n open && 'h-2xl pr-3xs pl-xs',\n open && 'justify-between',\n collapsible !== 'none' && 'animate-in',\n isExpanded && 'fade-in-0',\n !isExpanded && 'fade-out-0',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children(isExpanded)}\n </div>\n )\n}\n","import { cn } from '@/utils'\n\nimport type { SidebarInsetProps } from './sidebar.types'\n\nexport function SidebarInset({ className, children, ref, ...props }: SidebarInsetProps) {\n return (\n <div className={cn('min-h-0 min-w-0 flex-1 overflow-auto', className)} ref={ref} {...props}>\n {children}\n </div>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { SidebarMenuProps } from './sidebar.types'\n\nexport function SidebarMenu({ className, ref, ...props }: SidebarMenuProps) {\n return (\n <div\n className={cn('flex w-full flex-col items-start gap-3xs p-3xs', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { Badge } from '../badge'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuBadgeProps } from './sidebar.types'\n\nexport function SidebarMenuBadge({ className, ref, ...props }: SidebarMenuBadgeProps) {\n const { open } = useSidebar()\n\n return <Badge className={cn(!open && 'hidden', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuButtonProps } from './sidebar.types'\n\nexport function SidebarMenuButton({ isActive, className, ref, ...props }: SidebarMenuButtonProps) {\n const { open, collapsible } = useSidebar(),\n showText = collapsible === 'none' || open\n\n return (\n <button\n type=\"button\"\n data-active={String(Boolean(isActive))}\n className={cn(\n 'inline-flex cursor-pointer items-center gap-2xs rounded-full border border-transparent style-text-default-0 whitespace-nowrap transition-all duration-200 ease-out select-none active:scale-95 disabled:pointer-events-none disabled:opacity-50 [&>svg]:shrink-0',\n isActive && 'pointer-events-none bg-surface text-on-surface shadow-2xs',\n !isActive &&\n 'text-neutral-default hover:bg-neutral-container hover:text-neutral-on-container',\n isActive && !open && 'bg-neutral-container',\n !showText && 'mx-auto',\n !open && 'size-xl justify-center *:hidden [&>svg]:block',\n open && 'h-xl w-full pl-sm',\n collapsible !== 'none' && open && 'animate-in fade-in-0 slide-in-from-left-2',\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n}\n","import { Children, isValidElement } from 'react'\nimport type { ReactNode } from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport { Collapsible } from '../collapsible'\nimport { Popover } from '../popover'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuCollapsibleProps } from './sidebar.types'\n\nconst hasActiveDescendant = (children: ReactNode): boolean =>\n Children.toArray(children).some((child) => {\n if (!isValidElement<{ isActive?: boolean; children?: ReactNode }>(child)) {\n return false\n }\n\n return child.props.isActive === true || hasActiveDescendant(child.props.children)\n })\n\nexport function SidebarMenuCollapsible({\n className,\n children,\n ref,\n ...props\n}: SidebarMenuCollapsibleProps) {\n const { open } = useSidebar()\n\n if (!open) {\n return <Popover>{children}</Popover>\n }\n\n return (\n <Collapsible\n defaultOpen={hasActiveDescendant(children)}\n className={cn('', className)}\n ref={ref}\n {...props}\n >\n {children}\n </Collapsible>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { CollapsiblePanel } from '../collapsible'\nimport { PopoverContent, PopoverPanel } from '../popover'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuCollapsiblePanelProps } from './sidebar.types'\n\nexport function SidebarMenuCollapsiblePanel({\n className,\n children,\n ref,\n ...props\n}: SidebarMenuCollapsiblePanelProps) {\n const { open } = useSidebar()\n\n if (!open) {\n return (\n <PopoverPanel side=\"right\" className=\"w-fit bg-surface p-[0.5rem_0.5rem]\">\n <PopoverContent className=\"flex gap-3xs\">{children}</PopoverContent>\n </PopoverPanel>\n )\n }\n\n return (\n <CollapsiblePanel className={cn('py-3xs', className)} ref={ref} {...props}>\n {children}\n </CollapsiblePanel>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { CollapsibleTrigger } from '../collapsible'\nimport { Icon } from '../icon'\nimport { PopoverTrigger } from '../popover'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuCollapsibleTriggerProps } from './sidebar.types'\n\nexport function SidebarMenuCollapsibleTrigger({\n className,\n children,\n ref,\n style: _style,\n ...props\n}: SidebarMenuCollapsibleTriggerProps) {\n const { open, collapsible } = useSidebar(),\n showText = collapsible === 'none' || open\n\n if (!open) {\n return (\n <PopoverTrigger>\n <button\n type=\"button\"\n className={cn(\n 'flex size-xl items-center justify-center rounded-full shadow-none! transition-colors *:hidden hover:cursor-pointer hover:bg-neutral-container hover:text-neutral-on-container data-popup-open:bg-neutral-container [&>svg]:block',\n )}\n >\n {children}\n <Icon\n name=\"chevronRight\"\n className=\"absolute right-2xs size-xs text-on-surface-variant\"\n />\n </button>\n </PopoverTrigger>\n )\n }\n\n return (\n <CollapsibleTrigger\n variant=\"ghost\"\n className={cn(\n 'inline-flex! w-full! animate-in! justify-start! overflow-hidden! text-left! whitespace-nowrap! slide-in-from-left-2! [&>svg]:size-sm! [&>svg]:flex-none [&>svg]:shrink-0',\n !showText && 'mx-auto',\n !open && 'size-xl *:hidden [&>svg]:block',\n open && 'h-xl pl-sm',\n collapsible !== 'none' && open && 'animate-in slide-in-from-left-2',\n className,\n )}\n ref={ref}\n style={{ justifyContent: 'flex-start' }}\n {...props}\n >\n <span className=\"flex shrink-0 items-center gap-2xs [&>svg]:size-sm\">{children}</span>\n </CollapsibleTrigger>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { SidebarMenuItemProps } from './sidebar.types'\n\nexport function SidebarMenuItem({ className, ref, ...props }: SidebarMenuItemProps) {\n return (\n <div\n className={cn('flex h-xl w-full items-center justify-between gap-2xs', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarToggleProps } from './sidebar.types'\n\nfunction renderToggleChildren(children: SidebarToggleProps['children'], open?: boolean) {\n if (typeof children === 'function') {\n return children(open)\n }\n return children\n}\n\nexport function SidebarToggle({ className, children, ref, ...props }: SidebarToggleProps) {\n const { trigger, open, collapsible } = useSidebar(),\n handleClick = (event: React.MouseEvent) => {\n event.stopPropagation()\n if (trigger) {\n trigger()\n }\n }\n\n if (!trigger || collapsible === 'none') {\n return undefined\n }\n\n return (\n <Button\n aria-label=\"Toggle sidebar\"\n className={cn('shrink-0 border-none', className)}\n ref={ref}\n size=\"medium\"\n variant=\"ghost\"\n onClick={handleClick}\n {...props}\n >\n {renderToggleChildren(children, open)}\n </Button>\n )\n}\n","export const getStoredSidebarOpen = (id: string, fallback: boolean) => {\n if (typeof document === 'undefined') {\n return fallback\n }\n const match = new RegExp(`(?:^|; )sidebar-state-${id}=(?<value>[^;]*)`).exec(document.cookie)\n if (!match) {\n return fallback\n }\n return decodeURIComponent(match.groups?.value ?? '') === 'true'\n}\n","import { Sidebar as SidebarRoot } from './sidebar'\nimport { SidebarContent } from './sidebar-content'\nimport { SidebarFooter } from './sidebar-footer'\nimport { SidebarGroup } from './sidebar-group'\nimport { SidebarGroupContent } from './sidebar-group-content'\nimport { SidebarGroupLabel } from './sidebar-group-label'\nimport { SidebarHeader } from './sidebar-header'\nimport { SidebarInset } from './sidebar-inset'\nimport { SidebarMenu } from './sidebar-menu'\nimport { SidebarMenuBadge } from './sidebar-menu-badge'\nimport { SidebarMenuButton } from './sidebar-menu-button'\nimport { SidebarMenuCollapsible } from './sidebar-menu-collapsible'\nimport { SidebarMenuCollapsiblePanel } from './sidebar-menu-collapsible-panel'\nimport { SidebarMenuCollapsibleTrigger } from './sidebar-menu-collapsible-trigger'\nimport { SidebarMenuItem } from './sidebar-menu-item'\nimport { SidebarProvider } from './sidebar-provider'\nimport { SidebarToggle } from './sidebar-toggle'\n\nconst Sidebar = Object.assign(SidebarRoot, {\n Content: SidebarContent,\n Footer: SidebarFooter,\n Group: SidebarGroup,\n GroupContent: SidebarGroupContent,\n GroupLabel: SidebarGroupLabel,\n Header: SidebarHeader,\n Inset: SidebarInset,\n Menu: SidebarMenu,\n MenuBadge: SidebarMenuBadge,\n MenuButton: SidebarMenuButton,\n MenuCollapsible: SidebarMenuCollapsible,\n MenuCollapsiblePanel: SidebarMenuCollapsiblePanel,\n MenuCollapsibleTrigger: SidebarMenuCollapsibleTrigger,\n MenuItem: SidebarMenuItem,\n Provider: SidebarProvider,\n Toggle: SidebarToggle,\n})\n\nexport type {\n SidebarContentProps,\n SidebarFooterProps,\n SidebarGroupContentProps,\n SidebarGroupLabelProps,\n SidebarGroupProps,\n SidebarHeaderProps,\n SidebarInsetProps,\n SidebarMenuButtonProps,\n SidebarMenuProps,\n SidebarProps,\n SidebarToggleProps,\n SidebarMenuBadgeProps,\n SidebarMenuCollapsiblePanelProps,\n SidebarMenuCollapsibleProps,\n SidebarMenuCollapsibleTriggerProps,\n SidebarMenuItemProps,\n} from './sidebar.types'\nexport { SidebarContent } from './sidebar-content'\nexport { SidebarFooter } from './sidebar-footer'\nexport { SidebarGroup } from './sidebar-group'\nexport { SidebarGroupContent } from './sidebar-group-content'\nexport { SidebarGroupLabel } from './sidebar-group-label'\nexport { SidebarHeader } from './sidebar-header'\nexport { SidebarInset } from './sidebar-inset'\nexport { SidebarMenu } from './sidebar-menu'\nexport { SidebarProvider, useSidebar } from './sidebar-provider'\nexport { SidebarToggle } from './sidebar-toggle'\nexport { SidebarMenuBadge } from './sidebar-menu-badge'\nexport { SidebarMenuButton } from './sidebar-menu-button'\nexport { SidebarMenuCollapsible } from './sidebar-menu-collapsible'\nexport { SidebarMenuCollapsiblePanel } from './sidebar-menu-collapsible-panel'\nexport { SidebarMenuCollapsibleTrigger } from './sidebar-menu-collapsible-trigger'\nexport { SidebarMenuItem } from './sidebar-menu-item'\nexport { getStoredSidebarOpen } from './sidebar.utils'\n\nexport { Sidebar }\n"],"mappings":";;;;;;;;;;;AAiBA,MAAM,iCAAiC;AAErC,MAAA,iBAAiB,MAAM,cAA0C,IAAI;AACrE,MAAA,mBAAmB;CACjB,MAAM,UAAU,MAAM,WAAW,cAAc;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,kDAAkD;CAEpE,OAAO;AACT;AAEF,SAAS,iBACP,OACA,UACS;CACT,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM,QAAQ;CAEvB,OAAO;AACT;AAEA,SAAS,gBAAgB,EACvB,IACA,cAAc,MACd,OAAO,QACP,cAAc,QACd,WACA,KACA,GAAG,SACmB;CACtB,MAAM,aAAa,iBAAiB,MAClC,CAAC,WAAW,gBAAgB,MAAM,SAAkB,WAAW,GAC/D,CAAC,YAAY,iBAAiB,MAAM,SAAS,KAAK,GAClD,WAAW,cAAc,QAAQ,GACjC,WAAW,UAAkD;EAC3D,IAAI,UAAU;GACZ,eAAe,SAAS,iBAAiB,OAAO,IAAI,CAAC;GACrD;EACF;EACA,cAAc,SAAS;GACrB,MAAM,WAAW,iBAAiB,OAAO,IAAI;GAE7C,SAAS,SAAS;IAChB,GAAG,WAAW,GAAG,mBAAmB,OAAO,QAAQ,CAAC;IACpD;IACA,WAAW;IACX;GACF,CAAC,CAAC,KAAK,IAAI;GAEX,OAAO;EACT,CAAC;CACH,GACA,gBAAgB,SAAS,SAAS,CAAC,IAAI;CAEzC,MAAM,gBAAgB;EACpB,IAAI,CAAC,UACH,cAAc,KAAK;CAEvB,GAAG,CAAC,QAAQ,CAAC;CAEb,IAAI,uBAAuB,aACzB,OAAO;CACT,IAAI,UAAU;EACZ,uBAAuB;EACvB,OAAO;CACT;CAEA,OACE,oBAAC,eAAe,UAAhB;EACE,OAAO;GACL,aAAa;GACb;GACA;GACA;GACA;GACA;GACA;GACA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;EACT,GAAI;EAEH,UAAA,qBAAqB,UAAU,IAAI;CAC9B,CAAA;AAEZ;;ACvCA,MAAa,wBAAwB,IAAY,aAAsB;CACrE,IAAI,OAAO,aAAa,aACtB,OAAO;CAET,MAAM,QAAQ,IAAI,OAAO,yBAAyB,GAAG,iBAAiB,CAAC,CAAC,KAAK,SAAS,MAAM;CAC5F,IAAI,CAAC,OACH,OAAO;CAET,OAAO,mBAAmB,MAAM,QAAQ,SAAS,EAAE,MAAM;AAC3D;;ACSA,MAAM,UAAU,OAAO,OAAOC,WAAa;CACzC,SAAS;CACT,QAAQ;CACR,OAAO;CACP,cAAc;CACd,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,MAAM;CACN,WAAW;CACX,YAAY;CACZ,iBAAiB;CACjB,sBAAsB;CACtB,wBAAwB;CACxB,UAAU;CACV,UAAU;CACV,QAAQ;AACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Sidebar","BaseScrollArea","SidebarRoot"],"sources":["../../src/components/sidebar/sidebar-provider.tsx","../../src/components/sidebar/sidebar.tsx","../../src/components/sidebar/sidebar-content.tsx","../../src/components/sidebar/sidebar-footer.tsx","../../src/components/sidebar/sidebar-group.tsx","../../src/components/sidebar/sidebar-group-content.tsx","../../src/components/sidebar/sidebar-group-label.tsx","../../src/components/sidebar/sidebar-header.tsx","../../src/components/sidebar/sidebar-inset.tsx","../../src/components/sidebar/sidebar-menu.tsx","../../src/components/sidebar/sidebar-menu-badge.tsx","../../src/components/sidebar/sidebar-menu-button.tsx","../../src/components/sidebar/sidebar-menu-collapsible.tsx","../../src/components/sidebar/sidebar-menu-collapsible-panel.tsx","../../src/components/sidebar/sidebar-menu-collapsible-trigger.tsx","../../src/components/sidebar/sidebar-menu-item.tsx","../../src/components/sidebar/sidebar-toggle.tsx","../../src/components/sidebar/sidebar.utils.ts","../../src/components/sidebar/index.ts"],"sourcesContent":["import React from 'react'\n\nimport { useMediaQuery } from '@/hooks'\nimport { cn } from '@/utils/cn'\n\ntype SidebarContextProps = React.ComponentProps<'div'> & {\n id: string\n defaultOpen?: boolean\n trigger?: () => void\n open?: boolean\n setOpen?: (open: boolean) => void\n isMobile?: boolean\n side?: 'left' | 'right'\n collapsible?: 'offcanvas' | 'icon' | 'none'\n}\n\n// 7 days in seconds\nconst SIDEBAR_COOKIE_MAX_AGE_SECONDS = 604_800,\n // oxlint-disable-next-line unicorn/no-null\n SidebarContext = React.createContext<SidebarContextProps | null>(null),\n useSidebar = () => {\n const context = React.useContext(SidebarContext)\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider')\n }\n return context\n }\n\nfunction resolveOpenState(\n value: boolean | ((open: boolean) => boolean),\n previous: boolean,\n): boolean {\n if (typeof value === 'function') {\n return value(previous)\n }\n return value\n}\n\nfunction SidebarProvider({\n id,\n defaultOpen = true,\n side = 'left',\n collapsible = 'icon',\n className,\n ref,\n ...props\n}: SidebarContextProps) {\n const cookieName = `sidebar-state-${id}`,\n [openState, setOpenState] = React.useState<boolean>(defaultOpen),\n [mobileOpen, setMobileOpen] = React.useState(false),\n isMobile = useMediaQuery('mobile'),\n setOpen = (value: boolean | ((open: boolean) => boolean)) => {\n if (isMobile) {\n setMobileOpen((prev) => resolveOpenState(value, prev))\n return\n }\n setOpenState((prev) => {\n const nextOpen = resolveOpenState(value, prev)\n\n document.cookie = [\n `${cookieName}=${encodeURIComponent(String(nextOpen))}`,\n 'path=/',\n `max-age=${SIDEBAR_COOKIE_MAX_AGE_SECONDS}`,\n 'samesite=lax',\n ].join('; ')\n\n return nextOpen\n })\n },\n trigger = () => setOpen((prev) => !prev)\n\n React.useEffect(() => {\n if (!isMobile) {\n setMobileOpen(false)\n }\n }, [isMobile])\n\n let effectiveCollapsible = collapsible,\n open = openState\n if (isMobile) {\n effectiveCollapsible = 'offcanvas'\n open = mobileOpen\n }\n\n return (\n <SidebarContext.Provider\n value={{\n collapsible: effectiveCollapsible,\n defaultOpen,\n id,\n isMobile,\n open,\n setOpen,\n side,\n trigger,\n }}\n >\n <div\n className={cn(\n 'relative flex min-h-0 w-full min-w-0 flex-1',\n side === 'left' && 'flex flex-row',\n side === 'right' && 'flex flex-row-reverse',\n className,\n )}\n ref={ref}\n {...props}\n />\n </SidebarContext.Provider>\n )\n}\n\nexport { SidebarProvider, useSidebar }\n","import React from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarProps } from './sidebar.types'\n\nconst DEFAULT_SIDEBAR_WIDTH = 400\n\ninterface SidebarLayoutProps {\n collapsible?: 'offcanvas' | 'icon' | 'none'\n open?: boolean\n isMobile?: boolean\n width: string | number\n}\n\nfunction getOffcanvasWidth(\n open: boolean | undefined,\n isMobile: boolean | undefined,\n fullWidth: React.CSSProperties,\n): React.CSSProperties {\n if (!open) {\n return { width: '0px' }\n }\n if (isMobile) {\n return { width: '33.333333%' }\n }\n return fullWidth\n}\n\nfunction getIconWidth(\n open: boolean | undefined,\n isMobile: boolean | undefined,\n fullWidth: React.CSSProperties,\n): React.CSSProperties {\n if (open) {\n return fullWidth\n }\n if (isMobile) {\n return { width: '0px' }\n }\n return { width: '80px' }\n}\n\nfunction getWidthStyle({\n collapsible,\n open,\n isMobile,\n width,\n}: SidebarLayoutProps): React.CSSProperties {\n const fullWidth: React.CSSProperties = { width: `${width}px` }\n if (collapsible === 'offcanvas') {\n return getOffcanvasWidth(open, isMobile, fullWidth)\n }\n if (collapsible === 'icon') {\n return getIconWidth(open, isMobile, fullWidth)\n }\n return fullWidth\n}\n\nfunction getGapClasses({ collapsible, open }: SidebarLayoutProps) {\n if (collapsible === 'none') {\n return 'gap-lg'\n }\n if (open) {\n return 'gap-lg'\n }\n return 'gap-sm'\n}\n\nfunction getPositionClasses({ collapsible, open, isMobile }: SidebarLayoutProps) {\n if ((collapsible === 'offcanvas' || collapsible === 'icon') && !open && isMobile) {\n return 'absolute z-50 -translate-x-full'\n }\n\n if ((collapsible === 'offcanvas' || collapsible === 'icon') && open && isMobile) {\n return 'absolute z-50'\n }\n\n return ''\n}\n\nexport function Sidebar({\n tone = 'primary',\n width = DEFAULT_SIDEBAR_WIDTH,\n className,\n ...props\n}: SidebarProps) {\n const { open, setOpen, isMobile, collapsible, side } = useSidebar(),\n sidebarRef = React.useRef<HTMLDivElement>(null),\n isHidden = collapsible === 'offcanvas' && !open,\n layout: SidebarLayoutProps = { collapsible, isMobile, open, width }\n\n React.useEffect(() => {\n const handleOutsideClick = (event: MouseEvent) => {\n if (\n sidebarRef.current &&\n event.target instanceof Node &&\n !sidebarRef.current.contains(event.target) &&\n isMobile &&\n open &&\n setOpen\n ) {\n setOpen(false)\n }\n }\n\n document.addEventListener('click', handleOutsideClick)\n\n return () => {\n document.removeEventListener('click', handleOutsideClick)\n }\n }, [open, setOpen, isMobile])\n\n return (\n <div\n className={cn(\n 'sticky left-[0px] flex h-full max-h-dvh min-h-0 shrink-0 flex-col overflow-hidden border-border bg-surface transition-[width,transform] duration-300 ease-in-out',\n className,\n tone === 'primary' && 'bg-surface-background',\n tone === 'secondary' && 'bg-surface',\n tone === 'ghost' && 'bg-transparent',\n getGapClasses(layout),\n getPositionClasses(layout),\n isHidden && 'invisible',\n collapsible === 'offcanvas' && !open && 'border-none',\n open && 'p-md',\n collapsible === 'icon' && !open && 'py-md',\n isMobile && 'border-none',\n side === 'left' && 'border-r',\n side === 'right' && 'border-l',\n )}\n ref={sidebarRef}\n style={getWidthStyle(layout)}\n {...props}\n aria-hidden={isHidden || undefined}\n inert={isHidden}\n />\n )\n}\n","import { ScrollArea as BaseScrollArea } from '@base-ui/react/scroll-area'\n\nimport { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarContentProps } from './sidebar.types'\n\nexport function SidebarContent({ className, children, ref, ...props }: SidebarContentProps) {\n const { open } = useSidebar()\n\n return (\n <BaseScrollArea.Root\n className={cn(\n 'min-h-0 flex-1 overflow-hidden rounded-xl transition-all duration-300 ease-in-out',\n !open && 'w-fit self-center',\n className,\n )}\n ref={ref}\n {...props}\n >\n <BaseScrollArea.Viewport\n className={cn(\n 'flex h-full scrollbar-none flex-col items-center overflow-y-auto overscroll-contain [&::-webkit-scrollbar]:hidden',\n 'before:pointer-events-none before:absolute before:top-0 before:left-0 before:block before:h-[min(40px,var(--scroll-area-overflow-y-start))] before:w-full before:bg-linear-to-b before:from-shadow/35 before:to-transparent before:transition-[height] before:duration-100 before:ease-out before:content-[\"\"] before:[--scroll-area-overflow-y-start:inherit]',\n 'after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:block after:h-[min(40px,var(--scroll-area-overflow-y-end,40px))] after:w-full after:bg-linear-to-t after:from-shadow/35 after:to-transparent after:transition-[height] after:duration-100 after:ease-out after:content-[\"\"] after:[--scroll-area-overflow-y-end:inherit]',\n open && 'gap-md',\n !open && 'gap-xs px-3xs pt-3xs',\n )}\n >\n {children}\n </BaseScrollArea.Viewport>\n </BaseScrollArea.Root>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarFooterProps } from './sidebar.types'\n\nexport function SidebarFooter({ className, children, ref, ...props }: SidebarFooterProps) {\n const { open, collapsible } = useSidebar(),\n isExpanded = collapsible === 'none' || open\n return (\n <div\n className={cn(\n 'flex shrink-0 animate-in items-center truncate p-3xs transition-all duration-300 ease-in-out',\n open && 'justify-start fade-in-0',\n !open && 'justify-center self-center fade-out-0',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children(isExpanded)}\n </div>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { SidebarGroupProps } from './sidebar.types'\n\nexport function SidebarGroup({ className, ref, ...props }: SidebarGroupProps) {\n return (\n <div\n className={cn('flex w-full flex-col items-start gap-2xs not-last-of-type:pb-md', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { SidebarGroupContentProps } from './sidebar.types'\n\nexport function SidebarGroupContent({ className, ref, ...props }: SidebarGroupContentProps) {\n return <div className={cn('flex w-full flex-col gap-3xs', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarGroupLabelProps } from './sidebar.types'\n\nexport function SidebarGroupLabel({ className, ref, ...props }: SidebarGroupLabelProps) {\n const { open, collapsible } = useSidebar(),\n showLabel = collapsible === 'none' || open\n\n if (!showLabel) {\n return undefined\n }\n\n return (\n <span\n className={cn(\n 'inline-flex h-md w-full items-center justify-between truncate pr-3xs pl-[calc(var(--ixia-spacing-md)-1px)] style-text-default--1 text-on-surface-variant transition-all duration-200 ease-out',\n collapsible !== 'none' && open && 'animate-in fade-in-0 slide-in-from-left-2',\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarHeaderProps } from './sidebar.types'\n\nexport function SidebarHeader({ className, children, ref, ...props }: SidebarHeaderProps) {\n const { open, collapsible } = useSidebar(),\n isExpanded = collapsible === 'none' || open\n\n return (\n <div\n className={cn(\n 'flex shrink-0 items-center justify-start gap-xs truncate style-text-strong-1 transition-all duration-200 ease-out',\n !open && 'self-center',\n open && 'h-2xl pr-3xs pl-xs',\n open && 'justify-between',\n collapsible !== 'none' && 'animate-in',\n isExpanded && 'fade-in-0',\n !isExpanded && 'fade-out-0',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children(isExpanded)}\n </div>\n )\n}\n","import { cn } from '@/utils'\n\nimport type { SidebarInsetProps } from './sidebar.types'\n\nexport function SidebarInset({ className, children, ref, ...props }: SidebarInsetProps) {\n return (\n <div className={cn('min-h-0 min-w-0 flex-1 overflow-auto', className)} ref={ref} {...props}>\n {children}\n </div>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { SidebarMenuProps } from './sidebar.types'\n\nexport function SidebarMenu({ className, ref, ...props }: SidebarMenuProps) {\n return (\n <div\n className={cn('flex w-full flex-col items-start gap-3xs p-3xs', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { Badge } from '../badge'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuBadgeProps } from './sidebar.types'\n\nexport function SidebarMenuBadge({ className, ref, ...props }: SidebarMenuBadgeProps) {\n const { open } = useSidebar()\n\n return <Badge className={cn(!open && 'hidden', className)} ref={ref} {...props} />\n}\n","import { cn } from '@/utils/cn'\n\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuButtonProps } from './sidebar.types'\n\nexport function SidebarMenuButton({ isActive, className, ref, ...props }: SidebarMenuButtonProps) {\n const { open, collapsible } = useSidebar(),\n showText = collapsible === 'none' || open\n\n return (\n <button\n type=\"button\"\n data-active={String(Boolean(isActive))}\n className={cn(\n 'inline-flex cursor-pointer items-center gap-2xs rounded-full border border-transparent style-text-default-0 whitespace-nowrap transition-all duration-200 ease-out select-none active:scale-95 disabled:pointer-events-none disabled:opacity-50 [&>svg]:shrink-0',\n isActive && 'pointer-events-none bg-surface text-on-surface shadow-2xs',\n !isActive &&\n 'text-neutral-default hover:bg-neutral-container hover:text-neutral-on-container',\n isActive && !open && 'bg-neutral-container',\n !showText && 'mx-auto',\n !open && 'size-xl justify-center *:hidden [&>svg]:block',\n open && 'h-xl w-full pl-sm',\n collapsible !== 'none' && open && 'animate-in fade-in-0 slide-in-from-left-2',\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n}\n","import { Children, isValidElement } from 'react'\nimport type { ReactNode } from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport { Collapsible } from '../collapsible'\nimport { Popover } from '../popover'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuCollapsibleProps } from './sidebar.types'\n\nconst hasActiveDescendant = (children: ReactNode): boolean =>\n Children.toArray(children).some((child) => {\n if (!isValidElement<{ isActive?: boolean; children?: ReactNode }>(child)) {\n return false\n }\n\n return child.props.isActive === true || hasActiveDescendant(child.props.children)\n })\n\nexport function SidebarMenuCollapsible({\n className,\n children,\n ref,\n ...props\n}: SidebarMenuCollapsibleProps) {\n const { open } = useSidebar()\n\n if (!open) {\n return <Popover>{children}</Popover>\n }\n\n return (\n <Collapsible\n defaultOpen={hasActiveDescendant(children)}\n className={cn('', className)}\n ref={ref}\n {...props}\n >\n {children}\n </Collapsible>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { CollapsiblePanel } from '../collapsible'\nimport { PopoverContent, PopoverPanel } from '../popover'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuCollapsiblePanelProps } from './sidebar.types'\n\nexport function SidebarMenuCollapsiblePanel({\n className,\n children,\n ref,\n ...props\n}: SidebarMenuCollapsiblePanelProps) {\n const { open } = useSidebar()\n\n if (!open) {\n return (\n <PopoverPanel side=\"right\" className=\"w-fit bg-surface p-[0.5rem_0.5rem]\">\n <PopoverContent className=\"flex gap-3xs\">{children}</PopoverContent>\n </PopoverPanel>\n )\n }\n\n return (\n <CollapsiblePanel className={cn('py-3xs', className)} ref={ref} {...props}>\n {children}\n </CollapsiblePanel>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { CollapsibleTrigger } from '../collapsible'\nimport { Icon } from '../icon'\nimport { PopoverTrigger } from '../popover'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarMenuCollapsibleTriggerProps } from './sidebar.types'\n\nexport function SidebarMenuCollapsibleTrigger({\n className,\n children,\n ref,\n style: _style,\n ...props\n}: SidebarMenuCollapsibleTriggerProps) {\n const { open, collapsible } = useSidebar(),\n showText = collapsible === 'none' || open\n\n if (!open) {\n return (\n <PopoverTrigger>\n <button\n type=\"button\"\n className={cn(\n 'flex size-xl items-center justify-center rounded-full shadow-none! transition-colors *:hidden hover:cursor-pointer hover:bg-neutral-container hover:text-neutral-on-container data-popup-open:bg-neutral-container [&>svg]:block',\n )}\n >\n {children}\n <Icon\n name=\"chevronRight\"\n className=\"absolute right-2xs size-xs text-on-surface-variant\"\n />\n </button>\n </PopoverTrigger>\n )\n }\n\n return (\n <CollapsibleTrigger\n variant=\"ghost\"\n className={cn(\n 'inline-flex! w-full! animate-in! justify-start! overflow-hidden! text-left! whitespace-nowrap! slide-in-from-left-2! [&>svg]:size-sm! [&>svg]:flex-none [&>svg]:shrink-0',\n !showText && 'mx-auto',\n !open && 'size-xl *:hidden [&>svg]:block',\n open && 'h-xl pl-sm',\n collapsible !== 'none' && open && 'animate-in slide-in-from-left-2',\n className,\n )}\n ref={ref}\n style={{ justifyContent: 'flex-start' }}\n {...props}\n >\n <span className=\"flex shrink-0 items-center gap-2xs [&>svg]:size-sm\">{children}</span>\n </CollapsibleTrigger>\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { SidebarMenuItemProps } from './sidebar.types'\n\nexport function SidebarMenuItem({ className, ref, ...props }: SidebarMenuItemProps) {\n return (\n <div\n className={cn('flex h-xl w-full items-center justify-between gap-2xs', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport { Button } from '../button'\nimport { useSidebar } from './sidebar-provider'\nimport type { SidebarToggleProps } from './sidebar.types'\n\nfunction renderToggleChildren(children: SidebarToggleProps['children'], open?: boolean) {\n if (typeof children === 'function') {\n return children(open)\n }\n return children\n}\n\nexport function SidebarToggle({ className, children, ref, ...props }: SidebarToggleProps) {\n const { trigger, open, collapsible } = useSidebar(),\n handleClick = (event: React.MouseEvent) => {\n event.stopPropagation()\n if (trigger) {\n trigger()\n }\n }\n\n if (!trigger || collapsible === 'none') {\n return undefined\n }\n\n return (\n <Button\n aria-label=\"Toggle sidebar\"\n className={cn('shrink-0 border-none', className)}\n ref={ref}\n size=\"medium\"\n variant=\"ghost\"\n onClick={handleClick}\n {...props}\n >\n {renderToggleChildren(children, open)}\n </Button>\n )\n}\n","export const getStoredSidebarOpen = (id: string, fallback: boolean) => {\n if (typeof document === 'undefined') {\n return fallback\n }\n const match = new RegExp(`(?:^|; )sidebar-state-${id}=(?<value>[^;]*)`).exec(document.cookie)\n if (!match) {\n return fallback\n }\n return decodeURIComponent(match.groups?.value ?? '') === 'true'\n}\n","import { Sidebar as SidebarRoot } from './sidebar'\nimport { SidebarContent } from './sidebar-content'\nimport { SidebarFooter } from './sidebar-footer'\nimport { SidebarGroup } from './sidebar-group'\nimport { SidebarGroupContent } from './sidebar-group-content'\nimport { SidebarGroupLabel } from './sidebar-group-label'\nimport { SidebarHeader } from './sidebar-header'\nimport { SidebarInset } from './sidebar-inset'\nimport { SidebarMenu } from './sidebar-menu'\nimport { SidebarMenuBadge } from './sidebar-menu-badge'\nimport { SidebarMenuButton } from './sidebar-menu-button'\nimport { SidebarMenuCollapsible } from './sidebar-menu-collapsible'\nimport { SidebarMenuCollapsiblePanel } from './sidebar-menu-collapsible-panel'\nimport { SidebarMenuCollapsibleTrigger } from './sidebar-menu-collapsible-trigger'\nimport { SidebarMenuItem } from './sidebar-menu-item'\nimport { SidebarProvider } from './sidebar-provider'\nimport { SidebarToggle } from './sidebar-toggle'\n\nconst Sidebar = Object.assign(SidebarRoot, {\n Content: SidebarContent,\n Footer: SidebarFooter,\n Group: SidebarGroup,\n GroupContent: SidebarGroupContent,\n GroupLabel: SidebarGroupLabel,\n Header: SidebarHeader,\n Inset: SidebarInset,\n Menu: SidebarMenu,\n MenuBadge: SidebarMenuBadge,\n MenuButton: SidebarMenuButton,\n MenuCollapsible: SidebarMenuCollapsible,\n MenuCollapsiblePanel: SidebarMenuCollapsiblePanel,\n MenuCollapsibleTrigger: SidebarMenuCollapsibleTrigger,\n MenuItem: SidebarMenuItem,\n Provider: SidebarProvider,\n Toggle: SidebarToggle,\n})\n\nexport type {\n SidebarContentProps,\n SidebarFooterProps,\n SidebarGroupContentProps,\n SidebarGroupLabelProps,\n SidebarGroupProps,\n SidebarHeaderProps,\n SidebarInsetProps,\n SidebarMenuButtonProps,\n SidebarMenuProps,\n SidebarProps,\n SidebarToggleProps,\n SidebarMenuBadgeProps,\n SidebarMenuCollapsiblePanelProps,\n SidebarMenuCollapsibleProps,\n SidebarMenuCollapsibleTriggerProps,\n SidebarMenuItemProps,\n} from './sidebar.types'\nexport { SidebarContent } from './sidebar-content'\nexport { SidebarFooter } from './sidebar-footer'\nexport { SidebarGroup } from './sidebar-group'\nexport { SidebarGroupContent } from './sidebar-group-content'\nexport { SidebarGroupLabel } from './sidebar-group-label'\nexport { SidebarHeader } from './sidebar-header'\nexport { SidebarInset } from './sidebar-inset'\nexport { SidebarMenu } from './sidebar-menu'\nexport { SidebarProvider, useSidebar } from './sidebar-provider'\nexport { SidebarToggle } from './sidebar-toggle'\nexport { SidebarMenuBadge } from './sidebar-menu-badge'\nexport { SidebarMenuButton } from './sidebar-menu-button'\nexport { SidebarMenuCollapsible } from './sidebar-menu-collapsible'\nexport { SidebarMenuCollapsiblePanel } from './sidebar-menu-collapsible-panel'\nexport { SidebarMenuCollapsibleTrigger } from './sidebar-menu-collapsible-trigger'\nexport { SidebarMenuItem } from './sidebar-menu-item'\nexport { getStoredSidebarOpen } from './sidebar.utils'\n\nexport { Sidebar }\n"],"mappings":";;;;;;;;;;;AAiBA,MAAM,iCAAiC;AAErC,MAAA,iBAAiB,MAAM,cAA0C,IAAI;AACrE,MAAA,mBAAmB;CACjB,MAAM,UAAU,MAAM,WAAW,cAAc;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,kDAAkD;CAEpE,OAAO;AACT;AAEF,SAAS,iBACP,OACA,UACS;CACT,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM,QAAQ;CAEvB,OAAO;AACT;AAEA,SAAS,gBAAgB,EACvB,IACA,cAAc,MACd,OAAO,QACP,cAAc,QACd,WACA,KACA,GAAG,SACmB;CACtB,MAAM,aAAa,iBAAiB,MAClC,CAAC,WAAW,gBAAgB,MAAM,SAAkB,WAAW,GAC/D,CAAC,YAAY,iBAAiB,MAAM,SAAS,KAAK,GAClD,WAAW,cAAc,QAAQ,GACjC,WAAW,UAAkD;EAC3D,IAAI,UAAU;GACZ,eAAe,SAAS,iBAAiB,OAAO,IAAI,CAAC;GACrD;EACF;E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AC,OAAD;EACE,WAAW,GAAG,yDAAyD,SAAS;EAC3E;EACL,GAAI;CACL,CAAA;AAEL;;ACNA,SAAS,qBAAqB,UAA0C,MAAgB;CACtF,IAAI,OAAO,aAAa,YACtB,OAAO,SAAS,IAAI;CAEtB,OAAO;AACT;AAEA,SAAgB,cAAc,EAAE,WAAW,UAAU,KAAK,GAAG,SAA6B;CACxF,MAAM,EAAE,SAAS,MAAM,gBAAgB,WAAW,GAChD,eAAe,UAA4B;EACzC,MAAM,gBAAgB;EACtB,IAAI,SACF,QAAQ;CAEZ;CAEF,IAAI,CAAC,WAAW,gBAAgB,QAC9B;CAGF,OACE,oBAAC,QAAD;EACE,cAAW;EACX,WAAW,GAAG,wBAAwB,SAAS;EAC1C;EACL,MAAK;EACL,SAAQ;EACR,SAAS;EACT,GAAI;EAEH,UAAA,qBAAqB,UAAU,IAAI;CAC9B,CAAA;AAEZ;;ACvCA,MAAa,wBAAwB,IAAY,aAAsB;CACrE,IAAI,OAAO,aAAa,aACtB,OAAO;CAET,MAAM,QAAQ,IAAI,OAAO,yBAAyB,GAAG,iBAAiB,CAAC,CAAC,KAAK,SAAS,MAAM;CAC5F,IAAI,CAAC,OACH,OAAO;CAET,OAAO,mBAAmB,MAAM,QAAQ,SAAS,EAAE,MAAM;AAC3D;;ACSA,MAAM,UAAU,OAAO,OAAOC,WAAa;CACzC,SAAS;CACT,QAAQ;CACR,OAAO;CACP,cAAc;CACd,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,MAAM;CACN,WAAW;CACX,YAAY;CACZ,iBAAiB;CACjB,sBAAsB;CACtB,wBAAwB;CACxB,UAAU;CACV,UAAU;CACV,QAAQ;AACV,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
|
-
import { t as Input } from "../input-
|
|
2
|
+
import { t as Input } from "../input-Czt30vp7.js";
|
|
3
3
|
import { t as Slider } from "../slider-D_XlV4OW.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import React, { createContext, useContext, useState } from "react";
|
package/dist/table/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as inputVariants } from "../input.types-816rEVWU.js";
|
|
2
2
|
import { t as Avatar } from "../index-DMaW_XF1.js";
|
|
3
3
|
import { n as BadgeProps } from "../index-0ZQzIKoE.js";
|
|
4
|
-
import { t as Button } from "../index-
|
|
4
|
+
import { t as Button } from "../index-uaJUy56Z.js";
|
|
5
5
|
import { t as Checkbox } from "../index-x4f8gnaI.js";
|
|
6
6
|
import { f as Tabs } from "../index-DyQYoAUf.js";
|
|
7
7
|
import { n as MenuTrigger } from "../index-CQti9gFb.js";
|
package/dist/table/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
2
|
import { t as formatDate } from "../utils-BI2x7nW5.js";
|
|
3
3
|
import { n as Icon } from "../icon-D3JWfCa2.js";
|
|
4
|
-
import { t as Button } from "../button-
|
|
4
|
+
import { t as Button } from "../button-DXQvyQyj.js";
|
|
5
5
|
import { t as Avatar } from "../avatar-Bp4gZh21.js";
|
|
6
6
|
import { t as Badge } from "../badge-Cl-9WTW-.js";
|
|
7
7
|
import { a as SelectPopup, c as SelectIcon, i as SelectTitle, n as SelectValue, o as SelectList, r as SelectTrigger, s as SelectItem, t as Select } from "../select-DncJXYim.js";
|
|
8
8
|
import { t as Checkbox } from "../checkbox-BuUZ1Lly.js";
|
|
9
9
|
import { i as TabsList, n as TabsTab, o as Tabs } from "../tabs-DTC7coap.js";
|
|
10
10
|
import { i as InputGroupAddon, r as InputGroupInput, t as InputGroup } from "../input-group-CgdazGrY.js";
|
|
11
|
-
import { c as PopoverContent, i as PopoverPanel, n as PopoverTrigger, o as PopoverHeader, r as PopoverTitle, t as Popover } from "../popover-
|
|
11
|
+
import { c as PopoverContent, i as PopoverPanel, n as PopoverTrigger, o as PopoverHeader, r as PopoverTitle, t as Popover } from "../popover-0WDxRi-s.js";
|
|
12
12
|
import { t as Meter } from "../meter-HD5taq57.js";
|
|
13
|
-
import { t as Field } from "../field-
|
|
13
|
+
import { t as Field } from "../field-DkMfrmdj.js";
|
|
14
14
|
import { n as Radio } from "../radio-group-Dj43u35Z.js";
|
|
15
|
-
import { d as FormFooter, n as useAppForm, t as Form } from "../form-
|
|
15
|
+
import { d as FormFooter, n as useAppForm, t as Form } from "../form-V2VqHn0D.js";
|
|
16
16
|
import { c as MenuRadioGroup, i as MenuSubmenu, l as MenuPopup, n as MenuTrigger, p as MenuCheckboxItem, r as MenuSubmenuTrigger, s as MenuRadioItem, t as Menu, u as MenuItem } from "../menu-sf13cnGp.js";
|
|
17
17
|
import { cva } from "class-variance-authority";
|
|
18
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
package/dist/toast/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
2
|
import { n as Icon } from "../icon-D3JWfCa2.js";
|
|
3
|
-
import { t as Button } from "../button-
|
|
3
|
+
import { t as Button } from "../button-DXQvyQyj.js";
|
|
4
4
|
import { t as Separator } from "../separator-DgIQp1cB.js";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import React from "react";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-BpUC-R1J.js","names":["Button","BaseButton"],"sources":["../src/components/button/button.types.ts","../src/components/button/button.tsx"],"sourcesContent":["import type { Button as BaseButton } from '@base-ui/react'\nimport { cva } from 'class-variance-authority'\nimport type { VariantProps } from 'class-variance-authority'\n\nexport const buttonVariants = cva(\n 'inline-flex cursor-pointer items-center justify-center rounded-full whitespace-nowrap transition-all select-none disabled:pointer-events-none disabled:opacity-50',\n {\n compoundVariants: [\n {\n className: 'bg-brand-default text-brand-on-default hover:bg-brand-muted',\n tone: 'brand',\n variant: 'fill',\n },\n {\n className: 'bg-accent-default text-accent-on-default hover:bg-accent-muted',\n tone: 'accent',\n variant: 'fill',\n },\n {\n className: 'bg-neutral-default text-neutral-on-default hover:bg-neutral-muted',\n tone: 'neutral',\n variant: 'fill',\n },\n {\n className: 'bg-error-default text-error-on-default hover:bg-error-muted',\n tone: 'error',\n variant: 'fill',\n },\n {\n className: 'bg-info-default text-info-on-default hover:bg-info-muted',\n tone: 'info',\n variant: 'fill',\n },\n {\n className: 'bg-success-default text-success-on-default hover:bg-success-muted',\n tone: 'success',\n variant: 'fill',\n },\n {\n className: 'bg-warning-default text-warning-on-default hover:bg-warning-muted',\n tone: 'warning',\n variant: 'fill',\n },\n {\n className: 'bg-brand-container text-brand-on-container hover:bg-brand-container-high',\n tone: 'brand',\n variant: 'secondary',\n },\n {\n className: 'bg-accent-container text-accent-on-container hover:bg-accent-container-high',\n tone: 'accent',\n variant: 'secondary',\n },\n {\n className: 'bg-neutral-container text-neutral-on-container hover:bg-neutral-container-high',\n tone: 'neutral',\n variant: 'secondary',\n },\n {\n className: 'bg-error-container text-error-on-container hover:bg-error-container-high',\n tone: 'error',\n variant: 'secondary',\n },\n {\n className: 'bg-info-container text-info-on-container hover:bg-info-container-high',\n tone: 'info',\n variant: 'secondary',\n },\n {\n className: 'bg-success-container text-success-on-container hover:bg-success-container-high',\n tone: 'success',\n variant: 'secondary',\n },\n {\n className: 'bg-warning-container text-warning-on-container hover:bg-warning-container-high',\n tone: 'warning',\n variant: 'secondary',\n },\n {\n className:\n 'border-brand-border text-brand-default hover:bg-brand-container hover:text-brand-on-container',\n tone: 'brand',\n variant: 'outline',\n },\n {\n className:\n 'border-accent-border text-accent-default hover:bg-accent-container hover:text-accent-on-container',\n tone: 'accent',\n variant: 'outline',\n },\n {\n className:\n 'border-neutral-border text-neutral-default hover:bg-neutral-container hover:text-neutral-on-container',\n tone: 'neutral',\n variant: 'outline',\n },\n {\n className:\n 'border-error-border text-error-default hover:bg-error-container hover:text-error-on-container',\n tone: 'error',\n variant: 'outline',\n },\n {\n className:\n 'border-info-border text-info-default hover:bg-info-container hover:text-info-on-container',\n tone: 'info',\n variant: 'outline',\n },\n {\n className:\n 'border-success-border text-success-default hover:bg-success-container hover:text-success-on-container',\n tone: 'success',\n variant: 'outline',\n },\n {\n className:\n 'border-warning-border text-warning-default hover:bg-warning-container hover:text-warning-on-container',\n tone: 'warning',\n variant: 'outline',\n },\n {\n className: 'text-brand-default hover:bg-brand-container hover:text-brand-on-container',\n tone: 'brand',\n variant: 'ghost',\n },\n {\n className: 'text-accent-default hover:bg-accent-container hover:text-accent-on-container',\n tone: 'accent',\n variant: 'ghost',\n },\n {\n className:\n 'text-neutral-default hover:bg-neutral-container hover:text-neutral-on-container',\n tone: 'neutral',\n variant: 'ghost',\n },\n {\n className: 'text-error-default hover:bg-error-container hover:text-error-on-container',\n tone: 'error',\n variant: 'ghost',\n },\n {\n className: 'text-info-default hover:bg-info-container hover:text-info-on-container',\n tone: 'info',\n variant: 'ghost',\n },\n {\n className:\n 'text-success-default hover:bg-success-container hover:text-success-on-container',\n tone: 'success',\n variant: 'ghost',\n },\n {\n className:\n 'text-warning-default hover:bg-warning-container hover:text-warning-on-container',\n tone: 'warning',\n variant: 'ghost',\n },\n {\n className:\n 'border-brand-border bg-brand-container text-brand-on-container hover:border-brand-border-strong hover:bg-brand-container-high',\n tone: 'brand',\n variant: 'soft',\n },\n {\n className:\n 'border-accent-border bg-accent-container text-accent-on-container hover:border-accent-border-strong hover:bg-accent-container-high',\n tone: 'accent',\n variant: 'soft',\n },\n {\n className:\n 'border-neutral-border bg-neutral-container text-neutral-on-container hover:border-neutral-border-strong hover:bg-neutral-container-high',\n tone: 'neutral',\n variant: 'soft',\n },\n {\n className:\n 'border-error-border bg-error-container text-error-on-container hover:border-error-border-strong hover:bg-error-container-high',\n tone: 'error',\n variant: 'soft',\n },\n {\n className:\n 'border-info-border bg-info-container text-info-on-container hover:border-info-border-strong hover:bg-info-container-high',\n tone: 'info',\n variant: 'soft',\n },\n {\n className:\n 'border-success-border bg-success-container text-success-on-container hover:border-success-border-strong hover:bg-success-container-high',\n tone: 'success',\n variant: 'soft',\n },\n {\n className:\n 'border-warning-border bg-warning-container text-warning-on-container hover:border-warning-border-strong hover:bg-warning-container-high',\n tone: 'warning',\n variant: 'soft',\n },\n {\n className:\n 'bg-brand-container text-brand-on-container not-active:hover:bg-brand-container-high',\n tone: 'brand',\n variant: 'elevated',\n },\n {\n className:\n 'bg-accent-container text-accent-on-container not-active:hover:bg-accent-container-high',\n tone: 'accent',\n variant: 'elevated',\n },\n {\n className: 'bg-surface-2 text-on-surface not-active:hover:bg-surface-3',\n tone: 'neutral',\n variant: 'elevated',\n },\n {\n className:\n 'bg-error-container text-error-on-container not-active:hover:bg-error-container-high',\n tone: 'error',\n variant: 'elevated',\n },\n {\n className:\n 'bg-info-container text-info-on-container not-active:hover:bg-info-container-high',\n tone: 'info',\n variant: 'elevated',\n },\n {\n className:\n 'bg-success-container text-success-on-container not-active:hover:bg-success-container-high',\n tone: 'success',\n variant: 'elevated',\n },\n {\n className:\n 'bg-warning-container text-warning-on-container not-active:hover:bg-warning-container-high',\n tone: 'warning',\n variant: 'elevated',\n },\n {\n className:\n 'text-brand-default hover:decoration-brand-default [&>svg]:text-brand-default/50 hover:[&>svg]:text-brand-default',\n tone: 'brand',\n variant: 'link',\n },\n {\n className:\n 'text-accent-default hover:decoration-accent-default [&>svg]:text-accent-default/50 hover:[&>svg]:text-accent-default',\n tone: 'accent',\n variant: 'link',\n },\n {\n className:\n 'text-neutral-default hover:decoration-neutral-default [&>svg]:text-neutral-default/50 hover:[&>svg]:text-neutral-default',\n tone: 'neutral',\n variant: 'link',\n },\n {\n className:\n 'text-error-default hover:decoration-error-default [&>svg]:text-error-default/50 hover:[&>svg]:text-error-default',\n tone: 'error',\n variant: 'link',\n },\n {\n className:\n 'text-info-default hover:decoration-info-default [&>svg]:text-info-default/50 hover:[&>svg]:text-info-default',\n tone: 'info',\n variant: 'link',\n },\n {\n className:\n 'text-success-default hover:decoration-success-default [&>svg]:text-success-default/50 hover:[&>svg]:text-success-default',\n tone: 'success',\n variant: 'link',\n },\n {\n className:\n 'text-warning-default hover:decoration-warning-default [&>svg]:text-warning-default/50 hover:[&>svg]:text-warning-default',\n tone: 'warning',\n variant: 'link',\n },\n ],\n defaultVariants: {\n size: 'medium',\n tone: 'brand',\n variant: 'fill',\n },\n variants: {\n size: {\n extraSmall:\n 'h-md gap-3xs px-2xs font-body text-xs leading-none font-medium [&:where([data-icon-only]:has(>svg:only-child))]:size-md [&:where([data-icon-only]:has(>svg:only-child))]:p-0 [&>svg]:size-xs',\n large:\n 'h-2xl min-w-2xl gap-xs px-md font-body text-lg leading-none font-medium [&:where([data-icon-only]:has(>svg:only-child))]:size-2xl [&:where([data-icon-only]:has(>svg:only-child))]:p-0 [&>svg]:size-lg',\n medium:\n 'h-xl min-w-xl gap-2xs px-sm font-body text-base leading-none font-medium [&:where([data-icon-only]:has(>svg:only-child))]:size-xl [&:where([data-icon-only]:has(>svg:only-child))]:p-0 [&>svg]:size-md',\n small:\n 'h-lg min-w-lg gap-3xs px-xs font-body text-sm leading-none font-medium [&:where([data-icon-only]:has(>svg:only-child))]:size-lg [&:where([data-icon-only]:has(>svg:only-child))]:p-0 [&>svg]:size-sm',\n },\n tone: {\n accent: '',\n brand: '',\n error: '',\n info: '',\n neutral: '',\n success: '',\n warning: '',\n },\n variant: {\n elevated: 'shadow-xs not-active:hover:shadow-md',\n fill: 'active:scale-95',\n ghost: 'active:scale-95',\n link: 'size-fit! p-0! underline decoration-transparent underline-offset-2 [&>svg]:transition-colors',\n outline: 'border active:scale-95',\n secondary: 'active:scale-95',\n soft: 'border active:scale-95',\n },\n },\n },\n)\n\nexport type ButtonProps = React.ComponentProps<typeof BaseButton> &\n VariantProps<typeof buttonVariants>\n","import { Button as BaseButton } from '@base-ui/react'\n\nimport { cn } from '@/utils/cn'\nimport { hasSingleElementChild } from '@/utils/has-single-element-child'\nimport { trimTextChildren } from '@/utils/trim-text-children'\n\nimport { buttonVariants } from './button.types'\nimport type { ButtonProps } from './button.types'\n\nexport function Button({ tone, variant, size, className, children, ...props }: ButtonProps) {\n let iconOnly: '' | undefined = undefined\n\n if (hasSingleElementChild(children)) {\n iconOnly = ''\n }\n\n return (\n <BaseButton\n data-icon-only={iconOnly}\n data-size={size}\n className={cn(buttonVariants({ className, size, tone, variant }))}\n {...props}\n >\n {trimTextChildren(children)}\n </BaseButton>\n )\n}\n"],"mappings":";;;;;;;AAIA,MAAa,iBAAiB,IAC5B,qKACA;CACE,kBAAkB;EAChB;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WAAW;GACX,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;EACA;GACE,WACE;GACF,MAAM;GACN,SAAS;EACX;CACF;CACA,iBAAiB;EACf,MAAM;EACN,MAAM;EACN,SAAS;CACX;CACA,UAAU;EACR,MAAM;GACJ,YACE;GACF,OACE;GACF,QACE;GACF,OACE;EACJ;EACA,MAAM;GACJ,QAAQ;GACR,OAAO;GACP,OAAO;GACP,MAAM;GACN,SAAS;GACT,SAAS;GACT,SAAS;EACX;EACA,SAAS;GACP,UAAU;GACV,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,WAAW;GACX,MAAM;EACR;CACF;AACF,CACF;;ACvTA,SAAgBA,SAAO,EAAE,MAAM,SAAS,MAAM,WAAW,UAAU,GAAG,SAAsB;CAC1F,IAAI,WAA2B,KAAA;CAE/B,IAAI,sBAAsB,QAAQ,GAChC,WAAW;CAGb,OACE,oBAACC,QAAD;EACE,kBAAgB;EAChB,aAAW;EACX,WAAW,GAAG,eAAe;GAAE;GAAW;GAAM;GAAM;EAAQ,CAAC,CAAC;EAChE,GAAI;EAEH,UAAA,iBAAiB,QAAQ;CAChB,CAAA;AAEhB"}
|