@bigbinary/neeto-atoms 1.0.43 → 1.0.45
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/{ColorPicker-D7Y1gZNn.js → ColorPicker-ClnRUq9y.js} +2 -2
- package/dist/{ColorPicker-D7Y1gZNn.js.map → ColorPicker-ClnRUq9y.js.map} +1 -1
- package/dist/{DataTable-B6QeW254.js → DataTable-DZYQUYKJ.js} +171 -34
- package/dist/DataTable-DZYQUYKJ.js.map +1 -0
- package/dist/{DatePicker-CV3nsugu.js → DatePicker-D-0HMiNG.js} +17 -5
- package/dist/DatePicker-D-0HMiNG.js.map +1 -0
- package/dist/{Input-xjYQfsaz.js → Input-DrpfsLAw.js} +22 -6
- package/dist/Input-DrpfsLAw.js.map +1 -0
- package/dist/{MultiEmailInput-L-QJg0hh.js → MultiEmailInput-DhjSEXbS.js} +6 -5
- package/dist/MultiEmailInput-DhjSEXbS.js.map +1 -0
- package/dist/{Select-o0yJaN0P.js → Select-BiyQTuiQ.js} +20 -12
- package/dist/Select-BiyQTuiQ.js.map +1 -0
- package/dist/{TimePicker-XE0sCXE6.js → TimePicker-CSjiggpr.js} +17 -5
- package/dist/TimePicker-CSjiggpr.js.map +1 -0
- package/dist/{TreeSelect-Dk299XMv.js → TreeSelect-BwF2rY6f.js} +7 -4
- package/dist/{TreeSelect-Dk299XMv.js.map → TreeSelect-BwF2rY6f.js.map} +1 -1
- package/dist/cjs/{ColorPicker-Co1Gffsu.js → ColorPicker-rhCnblTv.js} +2 -2
- package/dist/cjs/{ColorPicker-Co1Gffsu.js.map → ColorPicker-rhCnblTv.js.map} +1 -1
- package/dist/cjs/{DataTable-D6PwbV2u.js → DataTable-D4suNizi.js} +170 -33
- package/dist/cjs/DataTable-D4suNizi.js.map +1 -0
- package/dist/cjs/{DatePicker-CqnlwzLe.js → DatePicker-JhQ7D2bu.js} +17 -5
- package/dist/cjs/DatePicker-JhQ7D2bu.js.map +1 -0
- package/dist/cjs/{Input-CpuJXazH.js → Input-Lc77SV8e.js} +22 -6
- package/dist/cjs/Input-Lc77SV8e.js.map +1 -0
- package/dist/cjs/{MultiEmailInput-CPXODFvs.js → MultiEmailInput-BZtzoX7D.js} +6 -5
- package/dist/cjs/MultiEmailInput-BZtzoX7D.js.map +1 -0
- package/dist/cjs/{Select-DbfPhEu0.js → Select-DC23xcMU.js} +20 -12
- package/dist/cjs/Select-DC23xcMU.js.map +1 -0
- package/dist/cjs/{TimePicker-BGWNGfVR.js → TimePicker-CU7qJpoT.js} +17 -5
- package/dist/cjs/TimePicker-CU7qJpoT.js.map +1 -0
- package/dist/cjs/{TreeSelect-Cmm5yYq3.js → TreeSelect-qLtRIP-s.js} +7 -4
- package/dist/cjs/{TreeSelect-Cmm5yYq3.js.map → TreeSelect-qLtRIP-s.js.map} +1 -1
- package/dist/cjs/components/ColorPicker.js +1 -1
- package/dist/cjs/components/DataTable.js +1 -1
- package/dist/cjs/components/DatePicker.js +1 -1
- package/dist/cjs/components/Input.js +2 -1
- package/dist/cjs/components/Input.js.map +1 -1
- package/dist/cjs/components/MultiEmailInput.js +2 -1
- package/dist/cjs/components/MultiEmailInput.js.map +1 -1
- package/dist/cjs/components/Select.js +1 -1
- package/dist/cjs/components/TimePicker.js +1 -1
- package/dist/cjs/components/TreeSelect.js +1 -1
- package/dist/cjs/components/index.js +9 -8
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/formik/Input.js +2 -1
- package/dist/cjs/formik/Input.js.map +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +2 -1
- package/dist/cjs/formik/MultiEmailInput.js.map +1 -1
- package/dist/cjs/formik/Select.js +1 -1
- package/dist/cjs/formik/TreeSelect.js +1 -1
- package/dist/cjs/formik/index.js +5 -4
- package/dist/cjs/formik/index.js.map +1 -1
- package/dist/cjs/index.js +9 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/withIconSize-BKUwVY6t.js +19 -0
- package/dist/cjs/withIconSize-BKUwVY6t.js.map +1 -0
- package/dist/components/ColorPicker.js +1 -1
- package/dist/components/DataTable/components/ResizeHandle.d.ts +2 -1
- package/dist/components/DataTable/hooks/useColumnResize.d.ts +16 -0
- package/dist/components/DataTable/utils.d.ts +9 -0
- package/dist/components/DataTable.js +1 -1
- package/dist/components/DatePicker/constants.d.ts +7 -4
- package/dist/components/DatePicker.js +1 -1
- package/dist/components/Input/constants.d.ts +3 -0
- package/dist/components/Input.js +2 -1
- package/dist/components/Input.js.map +1 -1
- package/dist/components/MultiEmailInput.js +2 -1
- package/dist/components/MultiEmailInput.js.map +1 -1
- package/dist/components/Select/MultiSelectCombobox.types.d.ts +1 -0
- package/dist/components/Select/SelectCombobox.types.d.ts +1 -0
- package/dist/components/Select/constants.d.ts +1 -0
- package/dist/components/Select.js +1 -1
- package/dist/components/TimePicker.js +1 -1
- package/dist/components/TreeSelect.js +1 -1
- package/dist/components/index.js +9 -8
- package/dist/components/index.js.map +1 -1
- package/dist/formik/Input.js +2 -1
- package/dist/formik/Input.js.map +1 -1
- package/dist/formik/MultiEmailInput.js +2 -1
- package/dist/formik/MultiEmailInput.js.map +1 -1
- package/dist/formik/Select.js +1 -1
- package/dist/formik/TreeSelect.js +1 -1
- package/dist/formik/index.js +5 -4
- package/dist/formik/index.js.map +1 -1
- package/dist/hooks/useMultiSelectState.d.ts +1 -0
- package/dist/hooks/useSelectState.d.ts +1 -0
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/utils/withIconSize.d.ts +12 -0
- package/dist/withIconSize-Czt1EelO.js +13 -0
- package/dist/withIconSize-Czt1EelO.js.map +1 -0
- package/package.json +1 -1
- package/dist/DataTable-B6QeW254.js.map +0 -1
- package/dist/DatePicker-CV3nsugu.js.map +0 -1
- package/dist/Input-xjYQfsaz.js.map +0 -1
- package/dist/MultiEmailInput-L-QJg0hh.js.map +0 -1
- package/dist/Select-o0yJaN0P.js.map +0 -1
- package/dist/TimePicker-XE0sCXE6.js.map +0 -1
- package/dist/cjs/DataTable-D6PwbV2u.js.map +0 -1
- package/dist/cjs/DatePicker-CqnlwzLe.js.map +0 -1
- package/dist/cjs/Input-CpuJXazH.js.map +0 -1
- package/dist/cjs/MultiEmailInput-CPXODFvs.js.map +0 -1
- package/dist/cjs/Select-DbfPhEu0.js.map +0 -1
- package/dist/cjs/TimePicker-BGWNGfVR.js.map +0 -1
|
@@ -386,7 +386,7 @@ const ColorPicker = forwardRef(
|
|
|
386
386
|
"data-testid": "colorpicker-editable-input-textbox",
|
|
387
387
|
onChange: onColorInputChange,
|
|
388
388
|
onBlur,
|
|
389
|
-
className: "h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-
|
|
389
|
+
className: "h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-base outline-none focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-primary/15 md:text-sm"
|
|
390
390
|
}
|
|
391
391
|
)
|
|
392
392
|
}
|
|
@@ -434,4 +434,4 @@ const ColorPicker = forwardRef(
|
|
|
434
434
|
ColorPicker.displayName = "ColorPicker";
|
|
435
435
|
|
|
436
436
|
export { ColorPicker as C };
|
|
437
|
-
//# sourceMappingURL=ColorPicker-
|
|
437
|
+
//# sourceMappingURL=ColorPicker-ClnRUq9y.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker-D7Y1gZNn.js","sources":["../node_modules/lucide-react/dist/esm/icons/pipette.js","../src/components/ColorPicker/hooks/useEyeDropper.ts","../src/components/ColorPicker/constants.ts","../src/components/ColorPicker/hooks/useRecentlyUsedColors.ts","../src/components/ColorPicker/utils.ts","../src/components/ColorPicker/Palette.tsx","../src/components/ColorPicker/Target.tsx","../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12\",\n key: \"1y3wsu\"\n }\n ],\n [\n \"path\",\n {\n d: \"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z\",\n key: \"110lr1\"\n }\n ],\n [\"path\", { d: \"m2 22 .414-.414\", key: \"jhxm08\" }]\n];\nconst Pipette = createLucideIcon(\"pipette\", __iconNode);\n\nexport { __iconNode, Pipette as default };\n//# sourceMappingURL=pipette.js.map\n","import { useCallback } from \"react\";\n\ninterface EyeDropperResult {\n sRGBHex: string;\n}\n\ndeclare global {\n interface Window {\n EyeDropper?: new () => { open: () => Promise<EyeDropperResult> };\n }\n}\n\nconst isSupported = typeof window !== \"undefined\" && \"EyeDropper\" in window;\n\nexport const useEyeDropper = () => {\n const open = useCallback(async (): Promise<string> => {\n if (!window.EyeDropper) throw new Error(\"EyeDropper API not supported\");\n\n const dropper = new window.EyeDropper();\n const result = await dropper.open();\n\n return result.sRGBHex;\n }, []);\n\n return { isSupported, open };\n};\n","export const DEFAULT_PALETTE_COLORS = [\n { hex: \"#FFFFFF\" },\n { hex: \"#D6D6D6\" },\n { hex: \"#0A0E13\" },\n { hex: \"#FECE1E\" },\n { hex: \"#F32E48\" },\n { hex: \"#02C39A\" },\n { hex: \"#2A79C4\" },\n { hex: \"#B3E5FC\" },\n { hex: \"#C3C6F9\" },\n { hex: \"#8064CE\" },\n { hex: \"#FE861E\" },\n { hex: \"#FF7DC9\" },\n { hex: \"#028090\" },\n { hex: \"#095482\" },\n];\n\nexport const RECENTLY_USED_STORAGE_KEY = \"recently-used-colors\";\n\nexport const TARGET_SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n} as const;\n\nexport const PICKER_HEIGHT: Record<string, string> = {\n small: \"100px\",\n medium: \"120px\",\n large: \"140px\",\n};\n","import { useSyncExternalStore } from \"react\";\n\nimport { RECENTLY_USED_STORAGE_KEY } from \"../constants\";\n\ninterface ColorValue {\n hex: string;\n rgb: string | { r: number; g: number; b: number; a?: number };\n}\n\nconst getFromStorage = (key: string, fallback: ColorValue[]): ColorValue[] => {\n try {\n const stored = localStorage.getItem(key);\n\n return stored ? JSON.parse(stored) : fallback;\n } catch {\n return fallback;\n }\n};\n\nconst setToStorage = (key: string, value: ColorValue[]) => {\n try {\n localStorage.setItem(key, JSON.stringify(value));\n } catch {\n // Silently fail if storage is unavailable\n }\n};\n\nconst createSyncedStore = (storageKey: string) => {\n const listeners = new Set<() => void>();\n\n const store = {\n value: getFromStorage(storageKey, []),\n getSnapshot: () => store.value,\n getServerSnapshot: () => [] as ColorValue[],\n setValue: (newValue: ColorValue[]) => {\n store.value = newValue;\n setToStorage(storageKey, newValue);\n listeners.forEach(listener => listener());\n },\n subscribe: (callback: () => void) => {\n listeners.add(callback);\n\n const storageEventHandler = (event: StorageEvent) => {\n if (event.key !== storageKey) return;\n store.value = getFromStorage(storageKey, []);\n listeners.forEach(listener => listener());\n };\n\n if (listeners.size === 1) {\n window.addEventListener(\"storage\", storageEventHandler);\n }\n\n return () => {\n listeners.delete(callback);\n if (listeners.size === 0) {\n window.removeEventListener(\"storage\", storageEventHandler);\n }\n };\n },\n };\n\n return store;\n};\n\nconst store = createSyncedStore(RECENTLY_USED_STORAGE_KEY);\n\nexport const useRecentlyUsedColors = (): [\n ColorValue[],\n (value: ColorValue[]) => void,\n] => [\n useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot\n ),\n store.setValue,\n];\n","/**\n * Validates a hex color string (3, 4, 6, or 8 digits with optional #).\n */\nexport const isValidHex = (hex: string): boolean =>\n /^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{4}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(hex);\n\n/**\n * Parses a hex color string into RGBA components.\n * Returns { r: 0, g: 0, b: 0, a: 1 } for invalid inputs.\n */\nexport const hexToRgb = (\n hex: string\n): { r: number; g: number; b: number; a: number } => {\n const raw = hex.replace(/^#/, \"\");\n\n if (\n !/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{4}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(raw)\n ) {\n return { r: 0, g: 0, b: 0, a: 1 };\n }\n\n let r: number,\n g: number,\n b: number,\n a = 255;\n if (raw.length === 3 || raw.length === 4) {\n r = parseInt(raw[0] + raw[0], 16);\n g = parseInt(raw[1] + raw[1], 16);\n b = parseInt(raw[2] + raw[2], 16);\n if (raw.length === 4) a = parseInt(raw[3] + raw[3], 16);\n } else {\n r = parseInt(raw.slice(0, 2), 16);\n g = parseInt(raw.slice(2, 4), 16);\n b = parseInt(raw.slice(4, 6), 16);\n if (raw.length === 8) a = parseInt(raw.slice(6, 8), 16);\n }\n\n return { r, g, b, a: Math.round((a / 255) * 100) / 100 };\n};\n\n/**\n * Converts a hex color to an 8-digit hex string (#RRGGBBAA).\n */\nexport const hexToHex8 = (hex: string): string => {\n const { r, g, b, a } = hexToRgb(hex);\n const alpha = Math.round(a * 255);\n\n return `#${[r, g, b, alpha].map(channel => channel.toString(16).padStart(2, \"0\")).join(\"\")}`;\n};\n\n/**\n * Converts a color value to a normalized { hex, rgb } object.\n * Handles transparency and validity checks.\n */\nexport const getColor = (\n colorValue: string,\n showTransparencyControl: boolean\n): { hex: string; rgb: { r: number; g: number; b: number; a: number } } => {\n if (!isValidHex(colorValue)) {\n return { hex: colorValue, rgb: { r: 0, g: 0, b: 0, a: 1 } };\n }\n\n const rgb = hexToRgb(colorValue);\n\n if (rgb.a === 0) {\n return { hex: colorValue, rgb };\n }\n\n const hex = showTransparencyControl\n ? hexToHex8(colorValue)\n : `#${colorValue.replace(/^#/, \"\").slice(0, 6)}`;\n\n return { hex, rgb: hexToRgb(hex) };\n};\n","import React, { forwardRef } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\n\nimport { isValidHex } from \"./utils\";\nimport { DEFAULT_PALETTE_COLORS } from \"./constants\";\nimport type { PaletteColor } from \"./types\";\n\nexport interface PaletteProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n \"onChange\"\n> {\n /** Currently selected color. */\n color?: string;\n /** List of colors to render. */\n colorList?: PaletteColor[];\n /** Callback when a color swatch is clicked. */\n onChange?: (color: string) => void;\n}\n\nconst Palette = forwardRef<HTMLDivElement, PaletteProps>(\n (\n {\n color,\n colorList = DEFAULT_PALETTE_COLORS,\n onChange,\n className,\n ...otherProps\n },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(\n \"flex flex-row flex-wrap items-start justify-start gap-1\",\n className\n )}\n {...otherProps}\n >\n {colorList.map(item => {\n const rgbValue =\n \"rgb\" in item && typeof item.rgb === \"string\" ? item.rgb : undefined;\n const value = item.hex ?? rgbValue ?? \"\";\n const isActive =\n !!color && !!value && color.toLowerCase() === value.toLowerCase();\n\n return (\n <button\n type=\"button\"\n key={value}\n data-testid=\"color-palette-item\"\n className={cn(\n \"size-6 rounded-[5px] border cursor-pointer overflow-hidden transition-colors\",\n isActive\n ? \"border-muted-foreground\"\n : \"border-border hover:border-muted-foreground/50\"\n )}\n onClick={() => onChange?.(value)}\n >\n <span\n className={cn(\n \"block size-full\",\n isValidHex(value)\n ? \"\"\n : \"bg-[repeating-conic-gradient(#ccc_0_25%,transparent_0_50%)] bg-[length:8px_8px]\"\n )}\n style={isValidHex(value) ? { backgroundColor: value } : undefined}\n />\n </button>\n );\n })}\n </div>\n )\n);\n\nPalette.displayName = \"ColorPicker.Palette\";\n\nexport { Palette };\n","import React, { forwardRef } from \"react\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\n\nconst targetVariants = cva(\n \"inline-flex items-center justify-between rounded-md border border-input bg-background transition-colors hover:border-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-primary/15 cursor-pointer\",\n {\n variants: {\n size: {\n small: \"h-7 p-0.5 gap-2\",\n medium: \"h-8 p-1 gap-2\",\n large: \"h-10 p-1.5 gap-3\",\n },\n },\n defaultVariants: {\n size: \"large\",\n },\n }\n);\n\nexport interface TargetProps\n extends\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"size\">,\n VariantProps<typeof targetVariants> {\n /** Show hex code text beside the color swatch. */\n showHexValue?: boolean;\n /** The original color prop value. */\n color?: string;\n /** The resolved color value to display. */\n colorValue?: string;\n}\n\nconst Target = forwardRef<HTMLButtonElement, TargetProps>(\n (\n { size = \"large\", showHexValue, color, colorValue, className, ...props },\n ref\n ) => (\n <button\n ref={ref}\n type=\"button\"\n data-testid=\"color-picker-target\"\n className={cn(targetVariants({ size }), className)}\n {...props}\n >\n {showHexValue && (\n <span className=\"text-sm font-medium text-foreground min-w-[4.5rem] ps-1\">\n {color}\n </span>\n )}\n <span className=\"inline-flex items-center gap-2\">\n <span\n className=\"block size-5 rounded-md border border-border\"\n style={{ backgroundColor: colorValue }}\n />\n <ChevronDown className=\"size-4 text-muted-foreground\" />\n </span>\n </button>\n )\n);\n\nTarget.displayName = \"ColorPicker.Target\";\n\nexport { Target };\n","import { forwardRef, useState, useRef } from \"react\";\n\nimport { Pipette } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n HexColorPicker,\n HexColorInput,\n HexAlphaColorPicker,\n} from \"react-colorful\";\nimport { Button } from \"src/primitives/Button\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"src/primitives/Popover\";\nimport { cn } from \"src/shadcn/lib/utils\";\n\nimport { useEyeDropper } from \"./hooks/useEyeDropper\";\nimport { useRecentlyUsedColors } from \"./hooks/useRecentlyUsedColors\";\nimport { Palette } from \"./Palette\";\nimport { Target } from \"./Target\";\nimport { PICKER_HEIGHT } from \"./constants\";\nimport type { ColorPickerProps } from \"./types\";\nimport { getColor } from \"./utils\";\n\nconst ColorPicker = forwardRef<HTMLDivElement, ColorPickerProps>(\n (\n {\n color = \"\",\n size = \"large\",\n onChange,\n dropdownProps,\n showEyeDropper = true,\n showHexValue = false,\n showTransparencyControl = false,\n showPicker = true,\n showHexPicker = true,\n colorPalette,\n showRecentlyUsedColors = showPicker,\n className,\n },\n ref\n ) => {\n const { t } = useTranslation();\n const [colorInternal, setColorInternal] = useState(color);\n const [isColorSelected, setIsColorSelected] = useState(false);\n const [open, setOpen] = useState(false);\n const hexColorInputValue = useRef(\"\");\n const { isSupported: eyeDropperSupported, open: openEyeDropper } =\n useEyeDropper();\n const [recentlyUsedColors, setRecentlyUsedColors] = useRecentlyUsedColors();\n\n const PickerComponent = showTransparencyControl\n ? HexAlphaColorPicker\n : HexColorPicker;\n\n const colorValue = color ?? colorInternal ?? \"\";\n\n const onColorChange = (value: string) => {\n setIsColorSelected(true);\n\n if (onChange) {\n onChange(getColor(value, showTransparencyControl));\n } else {\n setColorInternal(value);\n }\n };\n\n const onColorInputChange = (hex: string) => {\n hexColorInputValue.current = hex;\n const expectedLength = showTransparencyControl ? 9 : 7;\n if (hex.length !== expectedLength) return;\n\n onColorChange(hex);\n hexColorInputValue.current = \"\";\n };\n\n const onBlur = () => {\n if (!hexColorInputValue.current) return;\n\n onColorChange(hexColorInputValue.current);\n hexColorInputValue.current = \"\";\n };\n\n const pickColor = async () => {\n try {\n const hex = await openEyeDropper();\n onColorChange(hex);\n } catch {\n // User cancelled or API unavailable\n }\n };\n\n const onOpenChange = (nextOpen: boolean) => {\n if (!nextOpen && showRecentlyUsedColors && isColorSelected) {\n const newColor = getColor(colorValue, showTransparencyControl);\n const filtered = recentlyUsedColors.filter(\n ({ hex }) => hex !== newColor.hex\n );\n const updated = [newColor, ...filtered];\n if (updated.length > 14) updated.pop();\n\n setRecentlyUsedColors(updated);\n setIsColorSelected(false);\n }\n\n setOpen(nextOpen);\n };\n\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <PopoverTrigger asChild>\n <Target\n color={color}\n colorValue={colorValue}\n showHexValue={showHexValue}\n size={size}\n />\n </PopoverTrigger>\n <PopoverContent\n ref={ref}\n align=\"start\"\n side=\"bottom\"\n className={cn(\"w-auto p-3\", className)}\n {...dropdownProps}\n >\n <div className=\"flex flex-col gap-3 w-56\">\n {showPicker && (\n <>\n {showHexPicker && (\n <div\n data-testid=\"neeto-color-picker-section\"\n style={{\n [\"--react-colorful-height\" as string]:\n PICKER_HEIGHT[size] ?? \"140px\",\n }}\n >\n <PickerComponent\n color={colorValue}\n onChange={onColorChange}\n style={{\n width: \"100%\",\n height: PICKER_HEIGHT[size] ?? \"140px\",\n }}\n />\n </div>\n )}\n <div className=\"flex items-center justify-center gap-2\">\n {showEyeDropper && eyeDropperSupported && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={pickColor}\n aria-label={t(\n \"neetoatoms.colorPicker.pickColor\",\n \"Pick color from screen\"\n )}\n >\n <Pipette className=\"size-4\" />\n </Button>\n )}\n <div\n className=\"flex-1\"\n data-testid=\"colorpicker-editable-input\"\n >\n <HexColorInput\n prefixed\n alpha={!!showTransparencyControl}\n color={colorValue}\n data-testid=\"colorpicker-editable-input-textbox\"\n onChange={onColorInputChange}\n onBlur={onBlur}\n className=\"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-primary/15\"\n />\n </div>\n </div>\n </>\n )}\n <div\n data-testid=\"color-palette\"\n className={cn(showPicker && \"border-t border-border pt-3\")}\n >\n <Palette\n color={color}\n colorList={colorPalette}\n onChange={onColorChange}\n />\n </div>\n {showRecentlyUsedColors && recentlyUsedColors.length > 0 && (\n <div\n className=\"border-t border-border pt-3\"\n data-testid=\"color-palette-recently-used\"\n >\n <p className=\"text-xs font-medium text-muted-foreground mb-2\">\n {t(\"neetoatoms.colorPicker.recentlyUsed\", \"Recently used\")}\n </p>\n <Palette\n colorList={recentlyUsedColors}\n onChange={onColorChange}\n />\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\n\nColorPicker.displayName = \"ColorPicker\";\n\nexport { ColorPicker };\n"],"names":["store"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,qHAAqH;AAC9H,MAAM,GAAG,EAAE;AACX;AACA,GAAG;AACH,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,6EAA6E;AACtF,MAAM,GAAG,EAAE;AACX;AACA,GAAG;AACH,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,GAAG,EAAE,QAAQ,EAAE;AAClD,CAAC;AACD,MAAM,OAAO,GAAG,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC;;ACdvD,MAAM,WAAA,GAAc,OAAO,MAAA,KAAW,WAAA,IAAe,YAAA,IAAgB,MAAA;AAE9D,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,IAAA,GAAO,YAAY,YAA6B;AACpD,IAAA,IAAI,CAAC,MAAA,CAAO,UAAA,EAAY,MAAM,IAAI,MAAM,8BAA8B,CAAA;AAEtE,IAAA,MAAM,OAAA,GAAU,IAAI,MAAA,CAAO,UAAA,EAAW;AACtC,IAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,IAAA,EAAK;AAElC,IAAA,OAAO,MAAA,CAAO,OAAA;AAAA,EAChB,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,EAAE,aAAa,IAAA,EAAK;AAC7B,CAAA;;ACzBO,MAAM,sBAAA,GAAyB;AAAA,EACpC,EAAE,KAAK,SAAA,EAAU;AAAA,EACjB,EAAE,KAAK,SAAA,EAAU;AAAA,EACjB,EAAE,KAAK,SAAA,EAAU;AAAA,EACjB,EAAE,KAAK,SAAA,EAA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EF,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,aAAA,EAAY,eAAA;AAAA,gBACZ,SAAA,EAAW,EAAA,CAAG,UAAA,IAAc,6BAA6B,CAAA;AAAA,gBAEzD,QAAA,kBAAA,GAAA;AAAA,kBAAC,OAAA;AAAA,kBAAA;AAAA,oBACC,KAAA;AAAA,oBACA,SAAA,EAAW,YAAA;AAAA,oBACX,QAAA,EAAU;AAAA;AAAA;AACZ;AAAA,aACF;AAAA,YACC,sBAAA,IAA0B,kBAAA,CAAmB,MAAA,GAAS,CAAA,oBACrD,IAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAU,6BAAA;AAAA,gBACV,aAAA,EAAY,6BAAA;AAAA,gBAEZ,QAAA,EAAA;AAAA,kCAAA,GAAA,CAAC,OAAE,SAAA,EAAU,gDAAA,EACV,QAAA,EAAA,CAAA,CAAE,qCAAA,EAAuC,eAAe,CAAA,EAC3D,CAAA;AAAA,kCACA,GAAA;AAAA,oBAAC,OAAA;AAAA,oBAAA;AAAA,sBACC,SAAA,EAAW,kBAAA;AAAA,sBACX,QAAA,EAAU;AAAA;AAAA;AACZ;AAAA;AAAA;AACF,WAAA,EAEJ;AAAA;AAAA;AACF,KAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"ColorPicker-ClnRUq9y.js","sources":["../node_modules/lucide-react/dist/esm/icons/pipette.js","../src/components/ColorPicker/hooks/useEyeDropper.ts","../src/components/ColorPicker/constants.ts","../src/components/ColorPicker/hooks/useRecentlyUsedColors.ts","../src/components/ColorPicker/utils.ts","../src/components/ColorPicker/Palette.tsx","../src/components/ColorPicker/Target.tsx","../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12\",\n key: \"1y3wsu\"\n }\n ],\n [\n \"path\",\n {\n d: \"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z\",\n key: \"110lr1\"\n }\n ],\n [\"path\", { d: \"m2 22 .414-.414\", key: \"jhxm08\" }]\n];\nconst Pipette = createLucideIcon(\"pipette\", __iconNode);\n\nexport { __iconNode, Pipette as default };\n//# sourceMappingURL=pipette.js.map\n","import { useCallback } from \"react\";\n\ninterface EyeDropperResult {\n sRGBHex: string;\n}\n\ndeclare global {\n interface Window {\n EyeDropper?: new () => { open: () => Promise<EyeDropperResult> };\n }\n}\n\nconst isSupported = typeof window !== \"undefined\" && \"EyeDropper\" in window;\n\nexport const useEyeDropper = () => {\n const open = useCallback(async (): Promise<string> => {\n if (!window.EyeDropper) throw new Error(\"EyeDropper API not supported\");\n\n const dropper = new window.EyeDropper();\n const result = await dropper.open();\n\n return result.sRGBHex;\n }, []);\n\n return { isSupported, open };\n};\n","export const DEFAULT_PALETTE_COLORS = [\n { hex: \"#FFFFFF\" },\n { hex: \"#D6D6D6\" },\n { hex: \"#0A0E13\" },\n { hex: \"#FECE1E\" },\n { hex: \"#F32E48\" },\n { hex: \"#02C39A\" },\n { hex: \"#2A79C4\" },\n { hex: \"#B3E5FC\" },\n { hex: \"#C3C6F9\" },\n { hex: \"#8064CE\" },\n { hex: \"#FE861E\" },\n { hex: \"#FF7DC9\" },\n { hex: \"#028090\" },\n { hex: \"#095482\" },\n];\n\nexport const RECENTLY_USED_STORAGE_KEY = \"recently-used-colors\";\n\nexport const TARGET_SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n} as const;\n\nexport const PICKER_HEIGHT: Record<string, string> = {\n small: \"100px\",\n medium: \"120px\",\n large: \"140px\",\n};\n","import { useSyncExternalStore } from \"react\";\n\nimport { RECENTLY_USED_STORAGE_KEY } from \"../constants\";\n\ninterface ColorValue {\n hex: string;\n rgb: string | { r: number; g: number; b: number; a?: number };\n}\n\nconst getFromStorage = (key: string, fallback: ColorValue[]): ColorValue[] => {\n try {\n const stored = localStorage.getItem(key);\n\n return stored ? JSON.parse(stored) : fallback;\n } catch {\n return fallback;\n }\n};\n\nconst setToStorage = (key: string, value: ColorValue[]) => {\n try {\n localStorage.setItem(key, JSON.stringify(value));\n } catch {\n // Silently fail if storage is unavailable\n }\n};\n\nconst createSyncedStore = (storageKey: string) => {\n const listeners = new Set<() => void>();\n\n const store = {\n value: getFromStorage(storageKey, []),\n getSnapshot: () => store.value,\n getServerSnapshot: () => [] as ColorValue[],\n setValue: (newValue: ColorValue[]) => {\n store.value = newValue;\n setToStorage(storageKey, newValue);\n listeners.forEach(listener => listener());\n },\n subscribe: (callback: () => void) => {\n listeners.add(callback);\n\n const storageEventHandler = (event: StorageEvent) => {\n if (event.key !== storageKey) return;\n store.value = getFromStorage(storageKey, []);\n listeners.forEach(listener => listener());\n };\n\n if (listeners.size === 1) {\n window.addEventListener(\"storage\", storageEventHandler);\n }\n\n return () => {\n listeners.delete(callback);\n if (listeners.size === 0) {\n window.removeEventListener(\"storage\", storageEventHandler);\n }\n };\n },\n };\n\n return store;\n};\n\nconst store = createSyncedStore(RECENTLY_USED_STORAGE_KEY);\n\nexport const useRecentlyUsedColors = (): [\n ColorValue[],\n (value: ColorValue[]) => void,\n] => [\n useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot\n ),\n store.setValue,\n];\n","/**\n * Validates a hex color string (3, 4, 6, or 8 digits with optional #).\n */\nexport const isValidHex = (hex: string): boolean =>\n /^#?([0-9A-Fa-f]{3}|[0-9A-Fa-f]{4}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(hex);\n\n/**\n * Parses a hex color string into RGBA components.\n * Returns { r: 0, g: 0, b: 0, a: 1 } for invalid inputs.\n */\nexport const hexToRgb = (\n hex: string\n): { r: number; g: number; b: number; a: number } => {\n const raw = hex.replace(/^#/, \"\");\n\n if (\n !/^([0-9A-Fa-f]{3}|[0-9A-Fa-f]{4}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(raw)\n ) {\n return { r: 0, g: 0, b: 0, a: 1 };\n }\n\n let r: number,\n g: number,\n b: number,\n a = 255;\n if (raw.length === 3 || raw.length === 4) {\n r = parseInt(raw[0] + raw[0], 16);\n g = parseInt(raw[1] + raw[1], 16);\n b = parseInt(raw[2] + raw[2], 16);\n if (raw.length === 4) a = parseInt(raw[3] + raw[3], 16);\n } else {\n r = parseInt(raw.slice(0, 2), 16);\n g = parseInt(raw.slice(2, 4), 16);\n b = parseInt(raw.slice(4, 6), 16);\n if (raw.length === 8) a = parseInt(raw.slice(6, 8), 16);\n }\n\n return { r, g, b, a: Math.round((a / 255) * 100) / 100 };\n};\n\n/**\n * Converts a hex color to an 8-digit hex string (#RRGGBBAA).\n */\nexport const hexToHex8 = (hex: string): string => {\n const { r, g, b, a } = hexToRgb(hex);\n const alpha = Math.round(a * 255);\n\n return `#${[r, g, b, alpha].map(channel => channel.toString(16).padStart(2, \"0\")).join(\"\")}`;\n};\n\n/**\n * Converts a color value to a normalized { hex, rgb } object.\n * Handles transparency and validity checks.\n */\nexport const getColor = (\n colorValue: string,\n showTransparencyControl: boolean\n): { hex: string; rgb: { r: number; g: number; b: number; a: number } } => {\n if (!isValidHex(colorValue)) {\n return { hex: colorValue, rgb: { r: 0, g: 0, b: 0, a: 1 } };\n }\n\n const rgb = hexToRgb(colorValue);\n\n if (rgb.a === 0) {\n return { hex: colorValue, rgb };\n }\n\n const hex = showTransparencyControl\n ? hexToHex8(colorValue)\n : `#${colorValue.replace(/^#/, \"\").slice(0, 6)}`;\n\n return { hex, rgb: hexToRgb(hex) };\n};\n","import React, { forwardRef } from \"react\";\n\nimport { cn } from \"src/shadcn/lib/utils\";\n\nimport { isValidHex } from \"./utils\";\nimport { DEFAULT_PALETTE_COLORS } from \"./constants\";\nimport type { PaletteColor } from \"./types\";\n\nexport interface PaletteProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n \"onChange\"\n> {\n /** Currently selected color. */\n color?: string;\n /** List of colors to render. */\n colorList?: PaletteColor[];\n /** Callback when a color swatch is clicked. */\n onChange?: (color: string) => void;\n}\n\nconst Palette = forwardRef<HTMLDivElement, PaletteProps>(\n (\n {\n color,\n colorList = DEFAULT_PALETTE_COLORS,\n onChange,\n className,\n ...otherProps\n },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(\n \"flex flex-row flex-wrap items-start justify-start gap-1\",\n className\n )}\n {...otherProps}\n >\n {colorList.map(item => {\n const rgbValue =\n \"rgb\" in item && typeof item.rgb === \"string\" ? item.rgb : undefined;\n const value = item.hex ?? rgbValue ?? \"\";\n const isActive =\n !!color && !!value && color.toLowerCase() === value.toLowerCase();\n\n return (\n <button\n type=\"button\"\n key={value}\n data-testid=\"color-palette-item\"\n className={cn(\n \"size-6 rounded-[5px] border cursor-pointer overflow-hidden transition-colors\",\n isActive\n ? \"border-muted-foreground\"\n : \"border-border hover:border-muted-foreground/50\"\n )}\n onClick={() => onChange?.(value)}\n >\n <span\n className={cn(\n \"block size-full\",\n isValidHex(value)\n ? \"\"\n : \"bg-[repeating-conic-gradient(#ccc_0_25%,transparent_0_50%)] bg-[length:8px_8px]\"\n )}\n style={isValidHex(value) ? { backgroundColor: value } : undefined}\n />\n </button>\n );\n })}\n </div>\n )\n);\n\nPalette.displayName = \"ColorPicker.Palette\";\n\nexport { Palette };\n","import React, { forwardRef } from \"react\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"src/shadcn/lib/utils\";\n\nconst targetVariants = cva(\n \"inline-flex items-center justify-between rounded-md border border-input bg-background transition-colors hover:border-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-primary/15 cursor-pointer\",\n {\n variants: {\n size: {\n small: \"h-7 p-0.5 gap-2\",\n medium: \"h-8 p-1 gap-2\",\n large: \"h-10 p-1.5 gap-3\",\n },\n },\n defaultVariants: {\n size: \"large\",\n },\n }\n);\n\nexport interface TargetProps\n extends\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"size\">,\n VariantProps<typeof targetVariants> {\n /** Show hex code text beside the color swatch. */\n showHexValue?: boolean;\n /** The original color prop value. */\n color?: string;\n /** The resolved color value to display. */\n colorValue?: string;\n}\n\nconst Target = forwardRef<HTMLButtonElement, TargetProps>(\n (\n { size = \"large\", showHexValue, color, colorValue, className, ...props },\n ref\n ) => (\n <button\n ref={ref}\n type=\"button\"\n data-testid=\"color-picker-target\"\n className={cn(targetVariants({ size }), className)}\n {...props}\n >\n {showHexValue && (\n <span className=\"text-sm font-medium text-foreground min-w-[4.5rem] ps-1\">\n {color}\n </span>\n )}\n <span className=\"inline-flex items-center gap-2\">\n <span\n className=\"block size-5 rounded-md border border-border\"\n style={{ backgroundColor: colorValue }}\n />\n <ChevronDown className=\"size-4 text-muted-foreground\" />\n </span>\n </button>\n )\n);\n\nTarget.displayName = \"ColorPicker.Target\";\n\nexport { Target };\n","import { forwardRef, useState, useRef } from \"react\";\n\nimport { Pipette } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n HexColorPicker,\n HexColorInput,\n HexAlphaColorPicker,\n} from \"react-colorful\";\nimport { Button } from \"src/primitives/Button\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"src/primitives/Popover\";\nimport { cn } from \"src/shadcn/lib/utils\";\n\nimport { useEyeDropper } from \"./hooks/useEyeDropper\";\nimport { useRecentlyUsedColors } from \"./hooks/useRecentlyUsedColors\";\nimport { Palette } from \"./Palette\";\nimport { Target } from \"./Target\";\nimport { PICKER_HEIGHT } from \"./constants\";\nimport type { ColorPickerProps } from \"./types\";\nimport { getColor } from \"./utils\";\n\nconst ColorPicker = forwardRef<HTMLDivElement, ColorPickerProps>(\n (\n {\n color = \"\",\n size = \"large\",\n onChange,\n dropdownProps,\n showEyeDropper = true,\n showHexValue = false,\n showTransparencyControl = false,\n showPicker = true,\n showHexPicker = true,\n colorPalette,\n showRecentlyUsedColors = showPicker,\n className,\n },\n ref\n ) => {\n const { t } = useTranslation();\n const [colorInternal, setColorInternal] = useState(color);\n const [isColorSelected, setIsColorSelected] = useState(false);\n const [open, setOpen] = useState(false);\n const hexColorInputValue = useRef(\"\");\n const { isSupported: eyeDropperSupported, open: openEyeDropper } =\n useEyeDropper();\n const [recentlyUsedColors, setRecentlyUsedColors] = useRecentlyUsedColors();\n\n const PickerComponent = showTransparencyControl\n ? HexAlphaColorPicker\n : HexColorPicker;\n\n const colorValue = color ?? colorInternal ?? \"\";\n\n const onColorChange = (value: string) => {\n setIsColorSelected(true);\n\n if (onChange) {\n onChange(getColor(value, showTransparencyControl));\n } else {\n setColorInternal(value);\n }\n };\n\n const onColorInputChange = (hex: string) => {\n hexColorInputValue.current = hex;\n const expectedLength = showTransparencyControl ? 9 : 7;\n if (hex.length !== expectedLength) return;\n\n onColorChange(hex);\n hexColorInputValue.current = \"\";\n };\n\n const onBlur = () => {\n if (!hexColorInputValue.current) return;\n\n onColorChange(hexColorInputValue.current);\n hexColorInputValue.current = \"\";\n };\n\n const pickColor = async () => {\n try {\n const hex = await openEyeDropper();\n onColorChange(hex);\n } catch {\n // User cancelled or API unavailable\n }\n };\n\n const onOpenChange = (nextOpen: boolean) => {\n if (!nextOpen && showRecentlyUsedColors && isColorSelected) {\n const newColor = getColor(colorValue, showTransparencyControl);\n const filtered = recentlyUsedColors.filter(\n ({ hex }) => hex !== newColor.hex\n );\n const updated = [newColor, ...filtered];\n if (updated.length > 14) updated.pop();\n\n setRecentlyUsedColors(updated);\n setIsColorSelected(false);\n }\n\n setOpen(nextOpen);\n };\n\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <PopoverTrigger asChild>\n <Target\n color={color}\n colorValue={colorValue}\n showHexValue={showHexValue}\n size={size}\n />\n </PopoverTrigger>\n <PopoverContent\n ref={ref}\n align=\"start\"\n side=\"bottom\"\n className={cn(\"w-auto p-3\", className)}\n {...dropdownProps}\n >\n <div className=\"flex flex-col gap-3 w-56\">\n {showPicker && (\n <>\n {showHexPicker && (\n <div\n data-testid=\"neeto-color-picker-section\"\n style={{\n [\"--react-colorful-height\" as string]:\n PICKER_HEIGHT[size] ?? \"140px\",\n }}\n >\n <PickerComponent\n color={colorValue}\n onChange={onColorChange}\n style={{\n width: \"100%\",\n height: PICKER_HEIGHT[size] ?? \"140px\",\n }}\n />\n </div>\n )}\n <div className=\"flex items-center justify-center gap-2\">\n {showEyeDropper && eyeDropperSupported && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={pickColor}\n aria-label={t(\n \"neetoatoms.colorPicker.pickColor\",\n \"Pick color from screen\"\n )}\n >\n <Pipette className=\"size-4\" />\n </Button>\n )}\n <div\n className=\"flex-1\"\n data-testid=\"colorpicker-editable-input\"\n >\n <HexColorInput\n prefixed\n alpha={!!showTransparencyControl}\n color={colorValue}\n data-testid=\"colorpicker-editable-input-textbox\"\n onChange={onColorInputChange}\n onBlur={onBlur}\n className=\"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-base outline-none focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-primary/15 md:text-sm\"\n />\n </div>\n </div>\n </>\n )}\n <div\n data-testid=\"color-palette\"\n className={cn(showPicker && \"border-t border-border pt-3\")}\n >\n <Palette\n color={color}\n colorList={colorPalette}\n onChange={onColorChange}\n />\n </div>\n {showRecentlyUsedColors && recentlyUsedColors.length > 0 && (\n <div\n className=\"border-t border-border pt-3\"\n data-testid=\"color-palette-recently-used\"\n >\n <p className=\"text-xs font-medium text-muted-foreground mb-2\">\n {t(\"neetoatoms.colorPicker.recentlyUsed\", \"Recently used\")}\n </p>\n <Palette\n colorList={recentlyUsedColors}\n onChange={onColorChange}\n />\n </div>\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n }\n);\n\nColorPicker.displayName = \"ColorPicker\";\n\nexport { ColorPicker };\n"],"names":["store"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAIA,MAAM,UAAU,GAAG;AACnB,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,qHAAqH;AAC9H,MAAM,GAAG,EAAE;AACX;AACA,GAAG;AACH,EAAE;AACF,IAAI,MAAM;AACV,IAAI;AACJ,MAAM,CAAC,EAAE,6EAA6E;AACtF,MAAM,GAAG,EAAE;AACX;AACA,GAAG;AACH,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,GAAG,EAAE,QAAQ,EAAE;AAClD,CAAC;AACD,MAAM,OAAO,GAAG,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC;;ACdvD,MAAM,WAAA,GAAc,OAAO,MAAA,KAAW,WAAA,IAAe,YAAA,IAAgB,MAAA;AAE9D,MAAM,gBAAgB,MAAM;AACjC,EAAA,MAAM,IAAA,GAAO,YAAY,YAA6B;AACpD,IAAA,IAAI,CAAC,MAAA,CAAO,UAAA,EAAY,MAAM,IAAI,MAAM,8BAA8B,CAAA;AAEtE,IAAA,MAAM,OAAA,GAAU,IAAI,MAAA,CAAO,UAAA,EAAW;AACtC,IAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,IAAA,EAAK;AAElC,IAAA,OAAO,MAAA,CAAO,OAAA;AAAA,EAChB,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,EAAE,aAAa,IAAA,EAAK;AAC7B,CAAA;;ACzBO,MAAM,sBAAA,GAAyB;AAAA,EACpC,EAAE,KAAK,SAAA,EAAU;AAAA,EACjB,EAAE,KAAK,SAAA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AAU;AAAA;AAAA;AACZ;AAAA;AACF,eAAA,EACF;AAAA,aAAA,EACF,CAAA;AAAA,4BAEF,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,aAAA,EAAY,eAAA;AAAA,gBACZ,SAAA,EAAW,EAAA,CAAG,UAAA,IAAc,6BAA6B,CAAA;AAAA,gBAEzD,QAAA,kBAAA,GAAA;AAAA,kBAAC,OAAA;AAAA,kBAAA;AAAA,oBACC,KAAA;AAAA,oBACA,SAAA,EAAW,YAAA;AAAA,oBACX,QAAA,EAAU;AAAA;AAAA;AACZ;AAAA,aACF;AAAA,YACC,sBAAA,IAA0B,kBAAA,CAAmB,MAAA,GAAS,CAAA,oBACrD,IAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAU,6BAAA;AAAA,gBACV,aAAA,EAAY,6BAAA;AAAA,gBAEZ,QAAA,EAAA;AAAA,kCAAA,GAAA,CAAC,OAAE,SAAA,EAAU,gDAAA,EACV,QAAA,EAAA,CAAA,CAAE,qCAAA,EAAuC,eAAe,CAAA,EAC3D,CAAA;AAAA,kCACA,GAAA;AAAA,oBAAC,OAAA;AAAA,oBAAA;AAAA,sBACC,SAAA,EAAW,kBAAA;AAAA,sBACX,QAAA,EAAU;AAAA;AAAA;AACZ;AAAA;AAAA;AACF,WAAA,EAEJ;AAAA;AAAA;AACF,KAAA,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,WAAA,CAAY,WAAA,GAAc,aAAA;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { useState, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { useState, useCallback, useEffect, useMemo, useRef, useLayoutEffect } from 'react';
|
|
4
4
|
import { TableRow, TableCell, Table, TableHeader, TableHead, TableBody } from './primitives/Table.js';
|
|
5
5
|
import { c as cn } from './utils-BJnb9o5c.js';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
@@ -3226,6 +3226,24 @@ const writeToLocalStorage = (key, value) => {
|
|
|
3226
3226
|
} catch {
|
|
3227
3227
|
}
|
|
3228
3228
|
};
|
|
3229
|
+
const getResizeColumnStyle = ({
|
|
3230
|
+
size,
|
|
3231
|
+
isSelectionCol,
|
|
3232
|
+
isLastDataCol,
|
|
3233
|
+
enableResize,
|
|
3234
|
+
pinned,
|
|
3235
|
+
pinnedStart,
|
|
3236
|
+
pinnedEnd
|
|
3237
|
+
}) => ({
|
|
3238
|
+
width: isSelectionCol ? 0 : isLastDataCol ? void 0 : size,
|
|
3239
|
+
...enableResize && !isSelectionCol ? {
|
|
3240
|
+
minWidth: size,
|
|
3241
|
+
...isLastDataCol ? {} : { maxWidth: size },
|
|
3242
|
+
overflow: "hidden"
|
|
3243
|
+
} : {},
|
|
3244
|
+
...pinned === "left" ? { left: pinnedStart } : {},
|
|
3245
|
+
...pinned === "right" ? { right: pinnedEnd } : {}
|
|
3246
|
+
});
|
|
3229
3247
|
const getPageNumbers = (current, total) => {
|
|
3230
3248
|
if (total <= 7) {
|
|
3231
3249
|
return Array.from({ length: total }, (_, i) => i + 1);
|
|
@@ -3586,6 +3604,100 @@ const useColumnOrdering = ({
|
|
|
3586
3604
|
};
|
|
3587
3605
|
};
|
|
3588
3606
|
|
|
3607
|
+
const useColumnResize = ({
|
|
3608
|
+
enabled,
|
|
3609
|
+
table,
|
|
3610
|
+
columnVisibility,
|
|
3611
|
+
hasSelectionColumn,
|
|
3612
|
+
scrollContainerRef,
|
|
3613
|
+
columnSizing,
|
|
3614
|
+
setColumnSizing
|
|
3615
|
+
}) => {
|
|
3616
|
+
const [containerWidth, setContainerWidth] = useState(0);
|
|
3617
|
+
const userResizedColumnsRef = useRef(/* @__PURE__ */ new Set());
|
|
3618
|
+
const columns = table.options.columns;
|
|
3619
|
+
const clearUserResized = useCallback((columnId) => {
|
|
3620
|
+
userResizedColumnsRef.current.delete(columnId);
|
|
3621
|
+
}, []);
|
|
3622
|
+
const trackUserResize = useCallback(
|
|
3623
|
+
(updaterOrValue) => {
|
|
3624
|
+
setColumnSizing((prev) => {
|
|
3625
|
+
const next = typeof updaterOrValue === "function" ? updaterOrValue(prev) : updaterOrValue;
|
|
3626
|
+
for (const id of Object.keys(next)) {
|
|
3627
|
+
if (next[id] !== prev[id]) {
|
|
3628
|
+
userResizedColumnsRef.current.add(id);
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
return next;
|
|
3632
|
+
});
|
|
3633
|
+
},
|
|
3634
|
+
[setColumnSizing]
|
|
3635
|
+
);
|
|
3636
|
+
useEffect(() => {
|
|
3637
|
+
const container = scrollContainerRef.current;
|
|
3638
|
+
if (!container || !enabled) return;
|
|
3639
|
+
let rafId;
|
|
3640
|
+
const observer = new ResizeObserver((entries) => {
|
|
3641
|
+
cancelAnimationFrame(rafId);
|
|
3642
|
+
rafId = requestAnimationFrame(() => {
|
|
3643
|
+
setContainerWidth(Math.round(entries[0].contentRect.width));
|
|
3644
|
+
});
|
|
3645
|
+
});
|
|
3646
|
+
observer.observe(container);
|
|
3647
|
+
return () => {
|
|
3648
|
+
cancelAnimationFrame(rafId);
|
|
3649
|
+
observer.disconnect();
|
|
3650
|
+
};
|
|
3651
|
+
}, [enabled, scrollContainerRef]);
|
|
3652
|
+
useLayoutEffect(() => {
|
|
3653
|
+
if (!enabled || containerWidth === 0) return;
|
|
3654
|
+
const leafColumns = table.getAllLeafColumns().filter((col) => col.id !== "_selection");
|
|
3655
|
+
let reservedWidth = 0;
|
|
3656
|
+
if (hasSelectionColumn) {
|
|
3657
|
+
const firstTh = scrollContainerRef.current?.querySelector("thead th");
|
|
3658
|
+
if (firstTh) {
|
|
3659
|
+
reservedWidth = firstTh.getBoundingClientRect().width;
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
const availableWidth = containerWidth - reservedWidth;
|
|
3663
|
+
let userResizedTotal = 0;
|
|
3664
|
+
let autoDefaultTotal = 0;
|
|
3665
|
+
const visibleIds = new Set(leafColumns.map((col) => col.id));
|
|
3666
|
+
for (const id of userResizedColumnsRef.current) {
|
|
3667
|
+
if (!visibleIds.has(id)) userResizedColumnsRef.current.delete(id);
|
|
3668
|
+
}
|
|
3669
|
+
leafColumns.forEach((col) => {
|
|
3670
|
+
if (userResizedColumnsRef.current.has(col.id)) {
|
|
3671
|
+
userResizedTotal += columnSizing[col.id] ?? col.columnDef.size ?? 150;
|
|
3672
|
+
} else {
|
|
3673
|
+
autoDefaultTotal += col.columnDef.size ?? 150;
|
|
3674
|
+
}
|
|
3675
|
+
});
|
|
3676
|
+
if (autoDefaultTotal === 0) return;
|
|
3677
|
+
const autoAvailable = availableWidth - userResizedTotal;
|
|
3678
|
+
const scale = autoAvailable > 0 ? autoAvailable / autoDefaultTotal : 0;
|
|
3679
|
+
const newSizing = {};
|
|
3680
|
+
let changed = false;
|
|
3681
|
+
leafColumns.forEach((col) => {
|
|
3682
|
+
if (userResizedColumnsRef.current.has(col.id)) {
|
|
3683
|
+
newSizing[col.id] = columnSizing[col.id] ?? col.columnDef.size ?? 150;
|
|
3684
|
+
} else {
|
|
3685
|
+
const defaultSize = col.columnDef.size ?? 150;
|
|
3686
|
+
const newSize = scale > 0 ? Math.floor(defaultSize * scale) : defaultSize;
|
|
3687
|
+
if (newSize !== (columnSizing[col.id] ?? -1)) changed = true;
|
|
3688
|
+
newSizing[col.id] = newSize;
|
|
3689
|
+
}
|
|
3690
|
+
});
|
|
3691
|
+
if (changed) setColumnSizing((prev) => ({ ...prev, ...newSizing }));
|
|
3692
|
+
}, [containerWidth, enabled, columns, columnVisibility, hasSelectionColumn]);
|
|
3693
|
+
const lastDataColumnId = enabled ? (() => {
|
|
3694
|
+
const dataCols = table.getVisibleLeafColumns().filter((col) => col.id !== "_selection");
|
|
3695
|
+
const lastNonPinned = dataCols.filter((col) => !col.getIsPinned()).at(-1);
|
|
3696
|
+
return (lastNonPinned ?? dataCols.at(-1))?.id;
|
|
3697
|
+
})() : void 0;
|
|
3698
|
+
return { trackUserResize, lastDataColumnId, clearUserResized };
|
|
3699
|
+
};
|
|
3700
|
+
|
|
3589
3701
|
const LoadingOverlay = () => /* @__PURE__ */ jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-background/50", children: /* @__PURE__ */ jsx(Spinner, { className: "size-6" }) });
|
|
3590
3702
|
|
|
3591
3703
|
const EmptyState = ({ colSpan, message }) => {
|
|
@@ -3612,14 +3724,20 @@ const SortIndicator = ({
|
|
|
3612
3724
|
return null;
|
|
3613
3725
|
};
|
|
3614
3726
|
|
|
3615
|
-
const ResizeHandle = ({
|
|
3727
|
+
const ResizeHandle = ({
|
|
3728
|
+
header,
|
|
3729
|
+
onReset
|
|
3730
|
+
}) => {
|
|
3616
3731
|
if (!header.column.getCanResize()) return null;
|
|
3617
3732
|
return /* @__PURE__ */ jsx(
|
|
3618
3733
|
"div",
|
|
3619
3734
|
{
|
|
3620
3735
|
onMouseDown: header.getResizeHandler(),
|
|
3621
3736
|
onTouchStart: header.getResizeHandler(),
|
|
3622
|
-
onDoubleClick: () =>
|
|
3737
|
+
onDoubleClick: () => {
|
|
3738
|
+
header.column.resetSize();
|
|
3739
|
+
onReset?.(header.column.id);
|
|
3740
|
+
},
|
|
3623
3741
|
className: cn(
|
|
3624
3742
|
"absolute top-0 end-0 h-full w-1 cursor-col-resize select-none touch-none",
|
|
3625
3743
|
header.column.getIsResizing() ? "bg-primary" : "bg-border opacity-0 group-hover/head:opacity-100"
|
|
@@ -3961,11 +4079,15 @@ const DataTable = ({
|
|
|
3961
4079
|
});
|
|
3962
4080
|
const showHeaderMenu = enableHeaderMenu ?? (enableColumnFreeze || enableAddColumn || !!onColumnHideProp || !!onColumnDelete || !!onColumnUpdate || !!onMoreActionClick);
|
|
3963
4081
|
const allColumns = useMemo(() => {
|
|
4082
|
+
const cols = enableColumnResize ? columns.map((col) => ({
|
|
4083
|
+
...col,
|
|
4084
|
+
minSize: col.minSize ?? col.size ?? 150
|
|
4085
|
+
})) : columns;
|
|
3964
4086
|
if (selectionColumn) {
|
|
3965
|
-
return [selectionColumn, ...
|
|
4087
|
+
return [selectionColumn, ...cols];
|
|
3966
4088
|
}
|
|
3967
|
-
return
|
|
3968
|
-
}, [columns, selectionColumn]);
|
|
4089
|
+
return cols;
|
|
4090
|
+
}, [columns, selectionColumn, enableColumnResize]);
|
|
3969
4091
|
const resolvedColumnOrder = useMemo(() => {
|
|
3970
4092
|
if (columnOrder.length === 0) return [];
|
|
3971
4093
|
if (selectionColumn && !columnOrder.includes("_selection")) {
|
|
@@ -3979,6 +4101,8 @@ const DataTable = ({
|
|
|
3979
4101
|
if (left.includes("_selection")) return columnPinning;
|
|
3980
4102
|
return { ...columnPinning, left: ["_selection", ...left] };
|
|
3981
4103
|
}, [columnPinning, selectionColumn, enableColumnFreeze]);
|
|
4104
|
+
const scrollContainerRef = useRef(null);
|
|
4105
|
+
const [columnSizing, setColumnSizing] = useState({});
|
|
3982
4106
|
const table = useReactTable({
|
|
3983
4107
|
data,
|
|
3984
4108
|
columns: allColumns,
|
|
@@ -3992,7 +4116,8 @@ const DataTable = ({
|
|
|
3992
4116
|
rowSelection,
|
|
3993
4117
|
columnPinning: resolvedColumnPinning,
|
|
3994
4118
|
columnVisibility,
|
|
3995
|
-
columnOrder: resolvedColumnOrder
|
|
4119
|
+
columnOrder: resolvedColumnOrder,
|
|
4120
|
+
columnSizing
|
|
3996
4121
|
},
|
|
3997
4122
|
onSortingChange,
|
|
3998
4123
|
manualPagination: true,
|
|
@@ -4007,6 +4132,19 @@ const DataTable = ({
|
|
|
4007
4132
|
onColumnVisibilityChange,
|
|
4008
4133
|
onColumnOrderChange
|
|
4009
4134
|
});
|
|
4135
|
+
const { trackUserResize, lastDataColumnId, clearUserResized } = useColumnResize({
|
|
4136
|
+
enabled: enableColumnResize,
|
|
4137
|
+
table,
|
|
4138
|
+
columnVisibility,
|
|
4139
|
+
hasSelectionColumn: !!selectionColumn,
|
|
4140
|
+
scrollContainerRef,
|
|
4141
|
+
columnSizing,
|
|
4142
|
+
setColumnSizing
|
|
4143
|
+
});
|
|
4144
|
+
table.setOptions((prev) => ({
|
|
4145
|
+
...prev,
|
|
4146
|
+
onColumnSizingChange: trackUserResize
|
|
4147
|
+
}));
|
|
4010
4148
|
const [bulkSelectedAllRows, setBulkSelectedAllRowsInternal] = useState(false);
|
|
4011
4149
|
const isAutoSelectingRef = useRef(false);
|
|
4012
4150
|
const bulkSelectedRef = useRef(false);
|
|
@@ -4033,7 +4171,6 @@ const DataTable = ({
|
|
|
4033
4171
|
table.toggleAllPageRowsSelected(false);
|
|
4034
4172
|
onRowSelect?.([], []);
|
|
4035
4173
|
};
|
|
4036
|
-
const scrollContainerRef = useRef(null);
|
|
4037
4174
|
const [scrollState, setScrollState] = useState({
|
|
4038
4175
|
scrolledStart: false,
|
|
4039
4176
|
scrolledEnd: false
|
|
@@ -4093,10 +4230,6 @@ const DataTable = ({
|
|
|
4093
4230
|
const dataHeaders = headerGroup.headers.filter(
|
|
4094
4231
|
(header) => header.column.id !== "_selection"
|
|
4095
4232
|
);
|
|
4096
|
-
const totalDataSize = dataHeaders.reduce(
|
|
4097
|
-
(sum, header) => sum + header.getSize(),
|
|
4098
|
-
0
|
|
4099
|
-
);
|
|
4100
4233
|
return /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-muted", children: headerGroup.headers.map((header, headerIndex) => {
|
|
4101
4234
|
const isPinned = header.column.getIsPinned();
|
|
4102
4235
|
const isSelectionCol = header.column.id === "_selection";
|
|
@@ -4114,16 +4247,15 @@ const DataTable = ({
|
|
|
4114
4247
|
isPinned === "left" && "after:pointer-events-none after:absolute after:inset-y-0 after:-right-2 after:w-2 after:bg-gradient-to-r after:from-black/6 after:to-transparent after:opacity-0 after:transition-opacity after:duration-200 after:content-[''] group-data-[scrolled-start]/scroll:after:opacity-100 dark:after:from-white/6",
|
|
4115
4248
|
isPinned === "right" && "before:pointer-events-none before:absolute before:inset-y-0 before:-left-2 before:w-2 before:bg-gradient-to-l before:from-black/6 before:to-transparent before:opacity-0 before:transition-opacity before:duration-200 before:content-[''] group-data-[scrolled-end]/scroll:before:opacity-100 dark:before:from-white/6"
|
|
4116
4249
|
),
|
|
4117
|
-
style: {
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
},
|
|
4250
|
+
style: getResizeColumnStyle({
|
|
4251
|
+
size: header.getSize(),
|
|
4252
|
+
isSelectionCol,
|
|
4253
|
+
isLastDataCol: header.column.id === lastDataColumnId,
|
|
4254
|
+
enableResize: enableColumnResize,
|
|
4255
|
+
pinned: isPinned,
|
|
4256
|
+
pinnedStart: header.column.getStart("left"),
|
|
4257
|
+
pinnedEnd: header.column.getAfter("right")
|
|
4258
|
+
}),
|
|
4127
4259
|
onClick: header.column.getCanSort() ? header.column.getToggleSortingHandler() : void 0,
|
|
4128
4260
|
children: [
|
|
4129
4261
|
header.isPlaceholder ? null : /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -4154,7 +4286,13 @@ const DataTable = ({
|
|
|
4154
4286
|
}
|
|
4155
4287
|
)
|
|
4156
4288
|
] }),
|
|
4157
|
-
enableColumnResize && /* @__PURE__ */ jsx(
|
|
4289
|
+
enableColumnResize && /* @__PURE__ */ jsx(
|
|
4290
|
+
ResizeHandle,
|
|
4291
|
+
{
|
|
4292
|
+
header,
|
|
4293
|
+
onReset: clearUserResized
|
|
4294
|
+
}
|
|
4295
|
+
)
|
|
4158
4296
|
]
|
|
4159
4297
|
},
|
|
4160
4298
|
header.id
|
|
@@ -4182,16 +4320,15 @@ const DataTable = ({
|
|
|
4182
4320
|
isPinned === "left" && "after:pointer-events-none after:absolute after:inset-y-0 after:-right-2 after:w-2 after:bg-gradient-to-r after:from-black/6 after:to-transparent after:opacity-0 after:transition-opacity after:duration-200 after:content-[''] group-data-[scrolled-start]/scroll:after:opacity-100 dark:after:from-white/6",
|
|
4183
4321
|
isPinned === "right" && "before:pointer-events-none before:absolute before:inset-y-0 before:-left-2 before:w-2 before:bg-gradient-to-l before:from-black/6 before:to-transparent before:opacity-0 before:transition-opacity before:duration-200 before:content-[''] group-data-[scrolled-end]/scroll:before:opacity-100 dark:before:from-white/6"
|
|
4184
4322
|
),
|
|
4185
|
-
style: {
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
},
|
|
4323
|
+
style: getResizeColumnStyle({
|
|
4324
|
+
size: cell.column.getSize(),
|
|
4325
|
+
isSelectionCol: isSelCell,
|
|
4326
|
+
isLastDataCol: cell.column.id === lastDataColumnId,
|
|
4327
|
+
enableResize: enableColumnResize,
|
|
4328
|
+
pinned: isPinned,
|
|
4329
|
+
pinnedStart: cell.column.getStart("left"),
|
|
4330
|
+
pinnedEnd: cell.column.getAfter("right")
|
|
4331
|
+
}),
|
|
4195
4332
|
children: flexRender(
|
|
4196
4333
|
cell.column.columnDef.cell,
|
|
4197
4334
|
cell.getContext()
|
|
@@ -4218,4 +4355,4 @@ const DataTable = ({
|
|
|
4218
4355
|
};
|
|
4219
4356
|
|
|
4220
4357
|
export { DataTable as D, useColumnPinning as a, useColumnVisibility as b, useTablePagination as c, useTableSelection as d, useTableSort as e, useColumnOrdering as u };
|
|
4221
|
-
//# sourceMappingURL=DataTable-
|
|
4358
|
+
//# sourceMappingURL=DataTable-DZYQUYKJ.js.map
|