@namroodinc/liquid-editorial 0.6.0 → 0.6.2
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/README.md +27 -3
- package/UPGRADING.md +109 -0
- package/dist/chunks/Avatar-BTKqaJLP.cjs +2 -0
- package/dist/chunks/Avatar-BTKqaJLP.cjs.map +1 -0
- package/dist/chunks/Avatar-C1q2AUD-.js +149 -0
- package/dist/chunks/Avatar-C1q2AUD-.js.map +1 -0
- package/dist/chunks/{ColourField-Doew1hLw.js → ColourField-BmHHxU6T.js} +119 -162
- package/dist/chunks/ColourField-BmHHxU6T.js.map +1 -0
- package/dist/chunks/ColourField-DWdc4d9E.cjs +2 -0
- package/dist/chunks/ColourField-DWdc4d9E.cjs.map +1 -0
- package/dist/chunks/{DatePicker-DmeWUsOS.js → DatePicker-CFYwk6eA.js} +2 -1
- package/dist/chunks/{DatePicker-DmeWUsOS.js.map → DatePicker-CFYwk6eA.js.map} +1 -1
- package/dist/chunks/{DatePicker-C0-609Zx.cjs → DatePicker-D5-LzTXS.cjs} +2 -2
- package/dist/chunks/{DatePicker-C0-609Zx.cjs.map → DatePicker-D5-LzTXS.cjs.map} +1 -1
- package/dist/chunks/FormEditor-B-XLNrub.cjs +2 -0
- package/dist/chunks/FormEditor-B-XLNrub.cjs.map +1 -0
- package/dist/chunks/{FormEditor-DTnFO4oS.js → FormEditor-_gqfxL_g.js} +4 -3
- package/dist/chunks/{FormEditor-DTnFO4oS.js.map → FormEditor-_gqfxL_g.js.map} +1 -1
- package/dist/chunks/colour-BmtxDlWF.cjs +2 -0
- package/dist/chunks/colour-BmtxDlWF.cjs.map +1 -0
- package/dist/chunks/colour-CYEF4Q_n.js +48 -0
- package/dist/chunks/colour-CYEF4Q_n.js.map +1 -0
- package/dist/chunks/isComposing-8bRWyiLF.js +8 -0
- package/dist/chunks/isComposing-8bRWyiLF.js.map +1 -0
- package/dist/chunks/isComposing-BrBcAANm.cjs +2 -0
- package/dist/chunks/isComposing-BrBcAANm.cjs.map +1 -0
- package/dist/chunks/transitionDuration-B4UnScFc.cjs +2 -0
- package/dist/chunks/transitionDuration-B4UnScFc.cjs.map +1 -0
- package/dist/chunks/transitionDuration-BIBA3V7G.js +8 -0
- package/dist/chunks/transitionDuration-BIBA3V7G.js.map +1 -0
- package/dist/chunks/useModalDialog-Cgus9408.cjs +2 -0
- package/dist/chunks/useModalDialog-Cgus9408.cjs.map +1 -0
- package/dist/chunks/useModalDialog-Dh-_6A0j.js +85 -0
- package/dist/chunks/useModalDialog-Dh-_6A0j.js.map +1 -0
- package/dist/chunks/useTooltip-CCf79zE9.cjs +2 -0
- package/dist/chunks/useTooltip-CCf79zE9.cjs.map +1 -0
- package/dist/chunks/useTooltip-D6cJji8v.js +73 -0
- package/dist/chunks/useTooltip-D6cJji8v.js.map +1 -0
- package/dist/components/Avatar/colour.d.cts +6 -0
- package/dist/components/Avatar/colour.d.cts.map +1 -0
- package/dist/components/Avatar/colour.d.ts +6 -0
- package/dist/components/Avatar/colour.d.ts.map +1 -0
- package/dist/components/Avatar/index.cjs +1 -2
- package/dist/components/Avatar/index.d.cts +16 -9
- package/dist/components/Avatar/index.d.cts.map +1 -1
- package/dist/components/Avatar/index.d.ts +16 -9
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Avatar/index.js +1 -43
- package/dist/components/Avatar/style.css +65 -16
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.d.cts.map +1 -1
- package/dist/components/ColourField/index.d.ts.map +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.d.cts.map +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.cjs.map +1 -1
- package/dist/components/Drawer/index.d.cts.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +37 -36
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Field/style.css +2 -0
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/style.css +0 -1
- package/dist/components/Menu/index.cjs +1 -1
- package/dist/components/Menu/index.cjs.map +1 -1
- package/dist/components/Menu/index.d.cts.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +2 -1
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts +2 -2
- package/dist/components/Popover/index.d.cts.map +1 -1
- package/dist/components/Popover/index.d.ts +2 -2
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +69 -53
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Popover/style.css +33 -1
- package/dist/components/Popover/useTooltip.d.cts +33 -0
- package/dist/components/Popover/useTooltip.d.cts.map +1 -0
- package/dist/components/Popover/useTooltip.d.ts +33 -0
- package/dist/components/Popover/useTooltip.d.ts.map +1 -0
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.d.cts.map +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Time/index.cjs +1 -1
- package/dist/components/Time/index.cjs.map +1 -1
- package/dist/components/Time/index.d.cts.map +1 -1
- package/dist/components/Time/index.d.ts.map +1 -1
- package/dist/components/Time/index.js +25 -42
- package/dist/components/Time/index.js.map +1 -1
- package/dist/components/Time/style.css +1 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/internal/isComposing.d.cts +3 -0
- package/dist/internal/isComposing.d.cts.map +1 -0
- package/dist/internal/isComposing.d.ts +3 -0
- package/dist/internal/isComposing.d.ts.map +1 -0
- package/dist/internal/transitionDuration.d.cts +3 -0
- package/dist/internal/transitionDuration.d.cts.map +1 -0
- package/dist/internal/transitionDuration.d.ts +3 -0
- package/dist/internal/transitionDuration.d.ts.map +1 -0
- package/dist/internal/useModalDialog.d.cts.map +1 -1
- package/dist/internal/useModalDialog.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/ColourField-BQ4a5tAV.cjs +0 -2
- package/dist/chunks/ColourField-BQ4a5tAV.cjs.map +0 -1
- package/dist/chunks/ColourField-Doew1hLw.js.map +0 -1
- package/dist/chunks/FormEditor-DfQLJnsO.cjs +0 -2
- package/dist/chunks/FormEditor-DfQLJnsO.cjs.map +0 -1
- package/dist/chunks/useModalDialog-BVaG--b3.js +0 -87
- package/dist/chunks/useModalDialog-BVaG--b3.js.map +0 -1
- package/dist/chunks/useModalDialog-Ctu270Dp.cjs +0 -2
- package/dist/chunks/useModalDialog-Ctu270Dp.cjs.map +0 -1
- package/dist/components/Avatar/index.cjs.map +0 -1
- package/dist/components/Avatar/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","useRef","useState","useId","_Fragment","Popover","require_components_Popover_index","react","react_jsx_runtime","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","describedBy","rest","anchorRef","isOpen","setIsOpen","tooltipId","setTick","format","id","t","refreshInterval","label","isTipped","hasTooltip","node","ref","className","tabIndex","title","onMouseEnter","event","onMouseLeave","onFocus","onBlur","onKeyDown"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useId, useRef, useState, type HTMLAttributes } from \"react\";\nimport { Popover } from \"../Popover\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nconst MINUTE = 60_000;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\n\nfunction pad(value: number) {\n return String(value).padStart(2, \"0\");\n}\n\n/** Day before month, one order everywhere: `12 Jun 2026`. */\nexport function formatAbsoluteDate(date: Date, options: { hasYear?: boolean } = {}) {\n const { hasYear = true } = options;\n const stem = `${date.getDate()} ${MONTHS[date.getMonth()]}`;\n return hasYear ? `${stem} ${date.getFullYear()}` : stem;\n}\n\n/** The tooltip form: `6 Aug 2026, 11:05`, with the reader's zone appended. */\nexport function formatAbsoluteTime(date: Date, options: { hasTimeZone?: boolean } = {}) {\n const { hasTimeZone = true } = options;\n const stamp = `${formatAbsoluteDate(date)}, ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n if (!hasTimeZone) {\n return stamp;\n }\n const zone = new Intl.DateTimeFormat(undefined, { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((part) => part.type === \"timeZoneName\")?.value;\n return zone ? `${stamp} ${zone}` : stamp;\n}\n\n/**\n * Relative up to a week, absolute after. Future dates are always absolute — a\n * scheduled publish reads `12 Jun`, never `in 3 days`.\n */\nexport function formatRelativeTime(date: Date, now: Date = new Date()) {\n const delta = now.getTime() - date.getTime();\n if (delta < 0) {\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n }\n if (delta < MINUTE) {\n return \"Just now\";\n }\n if (delta < HOUR) {\n return `${Math.floor(delta / MINUTE)}m ago`;\n }\n if (delta < DAY) {\n return `${Math.floor(delta / HOUR)}h ago`;\n }\n if (delta < WEEK) {\n const days = Math.floor(delta / DAY);\n return `${days} ${days === 1 ? \"day\" : \"days\"} ago`;\n }\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n}\n\nexport type TimeFormat = \"auto\" | \"relative\" | \"absolute\";\n\nexport interface TimeProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n /** The instant to print — Date, epoch ms, or an ISO string. */\n value: Date | string | number;\n /** `auto` ages the value; `absolute` always prints the date. */\n format?: TimeFormat;\n /** Show the absolute stamp on hover and focus. */\n hasTooltip?: boolean;\n /** Append the reader's time zone to the tooltip. */\n hasTimeZone?: boolean;\n /** Pin \"now\" — useful for tests and stories. */\n now?: Date;\n /** Re-render interval in ms while the value is still relative. */\n refreshInterval?: number;\n}\n\n/**\n * A machine-readable `<time>` that ages itself. One form per cell: relative or\n * absolute, never both side by side.\n */\nexport const Time = forwardRef<HTMLTimeElement, TimeProps>(function Time(\n {\n value,\n format = \"auto\",\n hasTooltip = true,\n hasTimeZone = true,\n now,\n refreshInterval = 30_000,\n className,\n tabIndex,\n title,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onKeyDown,\n \"aria-describedby\": describedBy,\n ...rest\n },\n ref,\n) {\n const date = value instanceof Date ? value : new Date(value);\n const anchorRef = useRef<HTMLTimeElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n const tooltipId = useId();\n const [, setTick] = useState(0);\n\n useEffect(() => {\n if (format === \"absolute\" || now) {\n return;\n }\n const id = window.setInterval(() => setTick((t) => t + 1), refreshInterval);\n return () => window.clearInterval(id);\n }, [format, now, refreshInterval]);\n\n if (Number.isNaN(date.getTime())) {\n return null;\n }\n\n const reference = now ?? new Date();\n const label =\n format === \"absolute\" ? formatAbsoluteDate(date) : formatRelativeTime(date, reference);\n const stamp = formatAbsoluteTime(date, { hasTimeZone });\n const isTipped = hasTooltip && label !== stamp;\n\n return (\n <>\n <time\n ref={(node) => {\n anchorRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n dateTime={date.toISOString()}\n suppressHydrationWarning\n className={cx(\"ds-time\", !isTipped && \"ds-time--plain\", className)}\n tabIndex={tabIndex ?? (isTipped ? 0 : undefined)}\n aria-describedby={\n [describedBy, isTipped && isOpen && tooltipId].filter(Boolean).join(\" \") || undefined\n }\n title={title ?? (isTipped ? undefined : stamp)}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (isTipped && !event.defaultPrevented) {\n setIsOpen(true);\n }\n }}\n onMouseLeave={(event) => {\n onMouseLeave?.(event);\n if (isTipped && !event.defaultPrevented) {\n setIsOpen(false);\n }\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (isTipped && !event.defaultPrevented) {\n setIsOpen(true);\n }\n }}\n onBlur={(event) => {\n onBlur?.(event);\n if (isTipped && !event.defaultPrevented) {\n setIsOpen(false);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (isTipped && !event.defaultPrevented && event.key === \"Escape\") {\n setIsOpen(false);\n }\n }}\n {...rest}\n >\n {label}\n </time>\n {isTipped && (\n <Popover\n anchorRef={anchorRef}\n isOpen={isOpen}\n id={tooltipId}\n role=\"tooltip\"\n className=\"ds-surface-raised ds-time-tooltip\"\n >\n {stamp}\n </Popover>\n )}\n </>\n );\n});\n"],"mappings":"A,iKAIA,SAASS,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAEA,IAAMC,EAAS,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EAE5FC,EAAS,IACTC,EAAO,GAAKD,EACZE,EAAM,GAAKD,EACXE,EAAO,EAAID,EAEjB,SAASE,EAAI,EAAe,CAC1B,OAAO,OAAOC,CAAK,CAAC,CAAC,SAAS,EAAG,GAAG,CACtC,CAGA,SAAgBC,EAAmB,EAAY,EAAiC,CAAC,EAAG,CAClF,GAAM,CAAE,UAAU,IAASC,EACrBC,EAAO,GAAGC,EAAK,QAAQ,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CAAC,KAAK,GAAG,GAAK,IAAA,GAE9E,MAAOa,IAAUN,EAAW,IAAA,GAAYrB,GACxC,aAAe,GAAU,CACvB4B,IAAeC,CAAK,EAChBR,GAAY,CAACQ,EAAM,kBACrBhB,EAAU,EAAI,CAElB,EACA,aAAe,GAAU,CACvBiB,IAAeD,CAAK,EAChBR,GAAY,CAACQ,EAAM,kBACrBhB,EAAU,EAAK,CAEnB,EACA,QAAU,GAAU,CAClBkB,IAAUF,CAAK,EACXR,GAAY,CAACQ,EAAM,kBACrBhB,EAAU,EAAI,CAElB,EACA,OAAS,GAAU,CACjBmB,IAASH,CAAK,EACVR,GAAY,CAACQ,EAAM,kBACrBhB,EAAU,EAAK,CAEnB,EACA,UAAY,GAAU,CACpBoB,IAAYJ,CAAK,EACbR,GAAY,CAACQ,EAAM,kBAAoBA,EAAM,MAAQ,UACvDhB,EAAU,EAAK,CAEnB,EACA,GAAIH,EAEH,SAAAU,CACG,CAAA,EACLC,IACC,EAAArC,EAAA,IAAA,CAACH,EAAAA,QAAD,CACa,YACH,SACR,GAAIiC,EACJ,KAAK,UACL,UAAU,oCAET,SAAAd,CACM,CAAA,CAEX,CAAA,CAAA,CAEN,CAAC,E"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","useState","useTooltip","useMemo","mergeRefs","_Fragment","require_mergeRefs","require_useTooltip","react","react_jsx_runtime","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","describedBy","rest","isValid","setTick","format","id","t","refreshInterval","label","isTipped","hasTooltip","timeRef","anchorRef","ref","className","tabIndex","description","title","triggerProps","panel"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useMemo, useState, type HTMLAttributes } from \"react\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useTooltip } from \"../Popover/useTooltip\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nconst MINUTE = 60_000;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\n\nfunction pad(value: number) {\n return String(value).padStart(2, \"0\");\n}\n\n/** Day before month, one order everywhere: `12 Jun 2026`. */\nexport function formatAbsoluteDate(date: Date, options: { hasYear?: boolean } = {}) {\n const { hasYear = true } = options;\n const stem = `${date.getDate()} ${MONTHS[date.getMonth()]}`;\n return hasYear ? `${stem} ${date.getFullYear()}` : stem;\n}\n\n/** The tooltip form: `6 Aug 2026, 11:05`, with the reader's zone appended. */\nexport function formatAbsoluteTime(date: Date, options: { hasTimeZone?: boolean } = {}) {\n const { hasTimeZone = true } = options;\n const stamp = `${formatAbsoluteDate(date)}, ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n if (!hasTimeZone) {\n return stamp;\n }\n const zone = new Intl.DateTimeFormat(undefined, { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((part) => part.type === \"timeZoneName\")?.value;\n return zone ? `${stamp} ${zone}` : stamp;\n}\n\n/**\n * Relative up to a week, absolute after. Future dates are always absolute — a\n * scheduled publish reads `12 Jun`, never `in 3 days`.\n */\nexport function formatRelativeTime(date: Date, now: Date = new Date()) {\n const delta = now.getTime() - date.getTime();\n if (delta < 0) {\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n }\n if (delta < MINUTE) {\n return \"Just now\";\n }\n if (delta < HOUR) {\n return `${Math.floor(delta / MINUTE)}m ago`;\n }\n if (delta < DAY) {\n return `${Math.floor(delta / HOUR)}h ago`;\n }\n if (delta < WEEK) {\n const days = Math.floor(delta / DAY);\n return `${days} ${days === 1 ? \"day\" : \"days\"} ago`;\n }\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n}\n\nexport type TimeFormat = \"auto\" | \"relative\" | \"absolute\";\n\nexport interface TimeProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n /** The instant to print — Date, epoch ms, or an ISO string. */\n value: Date | string | number;\n /** `auto` ages the value; `absolute` always prints the date. */\n format?: TimeFormat;\n /** Show the absolute stamp on hover and focus. */\n hasTooltip?: boolean;\n /** Append the reader's time zone to the tooltip. */\n hasTimeZone?: boolean;\n /** Pin \"now\" — useful for tests and stories. */\n now?: Date;\n /** Re-render interval in ms while the value is still relative. */\n refreshInterval?: number;\n}\n\n/**\n * A machine-readable `<time>` that ages itself. One form per cell: relative or\n * absolute, never both side by side.\n */\nexport const Time = forwardRef<HTMLTimeElement, TimeProps>(function Time(\n {\n value,\n format = \"auto\",\n hasTooltip = true,\n hasTimeZone = true,\n now,\n refreshInterval = 30_000,\n className,\n tabIndex,\n title,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n \"aria-describedby\": describedBy,\n ...rest\n },\n ref,\n) {\n const date = value instanceof Date ? value : new Date(value);\n const isValid = !Number.isNaN(date.getTime());\n const [, setTick] = useState(0);\n\n useEffect(() => {\n if (format === \"absolute\" || now) {\n return;\n }\n const id = window.setInterval(() => setTick((t) => t + 1), refreshInterval);\n return () => window.clearInterval(id);\n }, [format, now, refreshInterval]);\n\n const reference = now ?? new Date();\n const label = !isValid\n ? \"\"\n : format === \"absolute\"\n ? formatAbsoluteDate(date)\n : formatRelativeTime(date, reference);\n const stamp = isValid ? formatAbsoluteTime(date, { hasTimeZone }) : \"\";\n const isTipped = isValid && hasTooltip && label !== stamp;\n const { anchorRef, description, triggerProps, panel } = useTooltip<HTMLTimeElement>(\n isTipped && stamp,\n { className: \"ds-time-tooltip\" },\n );\n const timeRef = useMemo(() => mergeRefs(anchorRef, ref), [anchorRef, ref]);\n\n if (!isValid) {\n return null;\n }\n\n return (\n <>\n <time\n ref={timeRef}\n dateTime={date.toISOString()}\n suppressHydrationWarning\n className={cx(\"ds-time\", !isTipped && \"ds-time--plain\", className)}\n tabIndex={tabIndex ?? (isTipped ? 0 : undefined)}\n aria-describedby={[describedBy, description].filter(Boolean).join(\" \") || undefined}\n title={title ?? (isTipped ? undefined : stamp)}\n {...triggerProps({ onMouseEnter, onMouseLeave, onFocus, onBlur })}\n {...rest}\n >\n {label}\n </time>\n {panel}\n </>\n );\n});\n"],"mappings":"A,kOAKA,SAASU,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAEA,IAAMC,EAAS,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EAE5FC,EAAS,IACTC,EAAO,GAAKD,EACZE,EAAM,GAAKD,EACXE,EAAO,EAAID,EAEjB,SAASE,EAAI,EAAe,CAC1B,OAAO,OAAOC,CAAK,CAAC,CAAC,SAAS,EAAG,GAAG,CACtC,CAGA,SAAgBC,EAAmB,EAAY,EAAiC,CAAC,EAAG,CAClF,GAAM,CAAE,UAAU,IAASC,EACrBC,EAAO,GAAGC,EAAK,QAAQ,EAAE,GAAGV,EAAOU,EAAK,SAAS,KACvD,OAAOC,EAAU,GAAGF,EAAK,GAAGC,EAAK,YAAY,IAAMD,CACrD,CAGA,SAAgBG,EAAmB,EAAY,EAAqC,CAAC,EAAG,CACtF,GAAM,CAAE,cAAc,IAASJ,EACzBK,EAAQ,GAAGN,EAAmBG,CAAI,EAAE,IAAIL,EAAIK,EAAK,SAAS,CAAC,EAAE,GAAGL,EAAIK,EAAK,WAAW,CAAC,IAC3F,GAAI,CAACI,EACH,OAAOD,EAET,IAAME,EAAO,IAAI,KAAK,eAAe,IAAA,GAAW,CAAE,aAAc,OAAQ,CAAC,CAAC,CACvE,cAAcL,CAAI,CAAC,CACnB,KAAM,GAASM,EAAK,OAAS,cAAc,CAAC,EA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Ae,CAAC,EAGjC,IAAMC,EAASN,EAEXE,IAAW,WACTnB,EAAmBG,CAAI,EACvBO,EAAmBP,EALPS,GAAO,IAAI,IAKW,EAHpC,GAIEN,EAAQW,EAAUZ,EAAmBF,EAAM,CAAE,aAAY,CAAC,EAAI,GAC9DqB,EAAWP,GAAWQ,GAAcF,IAAUjB,EAC9C,CAAE,YAAW,cAAa,eAAc,SAAUvB,EAAAA,EACtDyC,GAAYlB,EACZ,CAAE,UAAW,iBAAkB,CACjC,EACMoB,GAAA,EAAU1C,EAAAA,QAAAA,KAAcC,EAAAA,EAAU0C,EAAWC,CAAG,EAAG,CAACD,EAAWC,CAAG,CAAC,EAMzE,OAJKX,GAKH,EAAA3B,EAAA,KAAA,CAAAJ,EAAAA,SAAA,CAAA,SAAA,EACE,EAAAI,EAAA,IAAA,CAAC,OAAD,CACE,IAAKoC,EACL,SAAUvB,EAAK,YAAY,EAC3B,yBAAA,GACA,UAAWZ,EAAG,UAAW,CAACiC,GAAY,iBAAkBK,CAAS,EACjE,SAAUC,IAAaN,EAAW,EAAI,IAAA,IACtC,mBAAkB,CAACT,EAAagB,CAAW,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,GAAK,IAAA,GAC1E,MAAOC,IAAUR,EAAW,IAAA,GAAYlB,GACxC,GAAI2B,EAAa,CAAE,eAAc,eAAc,UAAS,QAAO,CAAC,EAChE,GAAIjB,EAEH,SAAAO,CACG,CAAA,EACLW,CACD,CAAA,CAAA,EAnBK,IAqBX,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Time/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Time/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGtF,OAAO,aAAa,CAAC;AAiBrB,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,UAIjF;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,UAUrF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,GAAE,IAAiB,UAmBpE;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IAC9E,+DAA+D;IAC/D,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,gEAAgE;IAChE,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,uGAoEf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Time/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Time/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGtF,OAAO,aAAa,CAAC;AAiBrB,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,UAIjF;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,UAUrF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,GAAE,IAAiB,UAmBpE;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IAC9E,+DAA+D;IAC/D,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,gEAAgE;IAChE,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,uGAoEf,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as e } from "../../chunks/mergeRefs-DGM402mE.js";
|
|
2
|
+
import { t } from "../../chunks/useTooltip-D6cJji8v.js";
|
|
3
|
+
import { forwardRef as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
4
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/Time/index.tsx
|
|
5
6
|
function l(...e) {
|
|
@@ -44,53 +45,35 @@ function v(e, t = /* @__PURE__ */ new Date()) {
|
|
|
44
45
|
}
|
|
45
46
|
return g(e, { hasYear: e.getFullYear() !== t.getFullYear() });
|
|
46
47
|
}
|
|
47
|
-
var y =
|
|
48
|
-
let
|
|
49
|
-
|
|
48
|
+
var y = n(function({ value: n, format: u = "auto", hasTooltip: d = !0, hasTimeZone: f = !0, now: p, refreshInterval: m = 3e4, className: h, tabIndex: y, title: b, onMouseEnter: x, onMouseLeave: S, onFocus: C, onBlur: w, "aria-describedby": T, ...E }, D) {
|
|
49
|
+
let O = n instanceof Date ? n : new Date(n), k = !Number.isNaN(O.getTime()), [, A] = a(0);
|
|
50
|
+
r(() => {
|
|
50
51
|
if (u === "absolute" || p) return;
|
|
51
|
-
let e = window.setInterval(() =>
|
|
52
|
+
let e = window.setInterval(() => A((e) => e + 1), m);
|
|
52
53
|
return () => window.clearInterval(e);
|
|
53
54
|
}, [
|
|
54
55
|
u,
|
|
55
56
|
p,
|
|
56
57
|
m
|
|
57
|
-
])
|
|
58
|
-
let
|
|
59
|
-
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("time", {
|
|
60
|
-
ref:
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
dateTime: k.toISOString(),
|
|
58
|
+
]);
|
|
59
|
+
let j = k ? u === "absolute" ? g(O) : v(O, p ?? /* @__PURE__ */ new Date()) : "", M = k ? _(O, { hasTimeZone: f }) : "", N = k && d && j !== M, { anchorRef: P, description: F, triggerProps: I, panel: L } = t(N && M, { className: "ds-time-tooltip" }), R = i(() => e(P, D), [P, D]);
|
|
60
|
+
return k ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("time", {
|
|
61
|
+
ref: R,
|
|
62
|
+
dateTime: O.toISOString(),
|
|
64
63
|
suppressHydrationWarning: !0,
|
|
65
|
-
className: l("ds-time", !
|
|
66
|
-
tabIndex: y ?? (
|
|
67
|
-
"aria-describedby": [
|
|
68
|
-
title: b ?? (
|
|
69
|
-
|
|
70
|
-
x
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
onBlur: (e) => {
|
|
79
|
-
w?.(e), L && !e.defaultPrevented && M(!1);
|
|
80
|
-
},
|
|
81
|
-
onKeyDown: (e) => {
|
|
82
|
-
T?.(e), L && !e.defaultPrevented && e.key === "Escape" && M(!1);
|
|
83
|
-
},
|
|
84
|
-
...D,
|
|
85
|
-
children: F
|
|
86
|
-
}), L && /* @__PURE__ */ s(e, {
|
|
87
|
-
anchorRef: A,
|
|
88
|
-
isOpen: j,
|
|
89
|
-
id: N,
|
|
90
|
-
role: "tooltip",
|
|
91
|
-
className: "ds-surface-raised ds-time-tooltip",
|
|
92
|
-
children: I
|
|
93
|
-
})] });
|
|
64
|
+
className: l("ds-time", !N && "ds-time--plain", h),
|
|
65
|
+
tabIndex: y ?? (N ? 0 : void 0),
|
|
66
|
+
"aria-describedby": [T, F].filter(Boolean).join(" ") || void 0,
|
|
67
|
+
title: b ?? (N ? void 0 : M),
|
|
68
|
+
...I({
|
|
69
|
+
onMouseEnter: x,
|
|
70
|
+
onMouseLeave: S,
|
|
71
|
+
onFocus: C,
|
|
72
|
+
onBlur: w
|
|
73
|
+
}),
|
|
74
|
+
...E,
|
|
75
|
+
children: j
|
|
76
|
+
}), L] }) : null;
|
|
94
77
|
});
|
|
95
78
|
//#endregion
|
|
96
79
|
export { y as Time, g as formatAbsoluteDate, _ as formatAbsoluteTime, v as formatRelativeTime };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Fragment","Fragment$1","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","forwardRef","describedBy","rest","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Fragment","mergeRefs","Fragment$1","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","forwardRef","describedBy","rest","isValid","setTick","useState","format","id","t","refreshInterval","label","isTipped","hasTooltip","useTooltip","timeRef","useMemo","anchorRef","ref","className","tabIndex","description","title","triggerProps","panel"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useMemo, useState, type HTMLAttributes } from \"react\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { useTooltip } from \"../Popover/useTooltip\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nconst MINUTE = 60_000;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\n\nfunction pad(value: number) {\n return String(value).padStart(2, \"0\");\n}\n\n/** Day before month, one order everywhere: `12 Jun 2026`. */\nexport function formatAbsoluteDate(date: Date, options: { hasYear?: boolean } = {}) {\n const { hasYear = true } = options;\n const stem = `${date.getDate()} ${MONTHS[date.getMonth()]}`;\n return hasYear ? `${stem} ${date.getFullYear()}` : stem;\n}\n\n/** The tooltip form: `6 Aug 2026, 11:05`, with the reader's zone appended. */\nexport function formatAbsoluteTime(date: Date, options: { hasTimeZone?: boolean } = {}) {\n const { hasTimeZone = true } = options;\n const stamp = `${formatAbsoluteDate(date)}, ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n if (!hasTimeZone) {\n return stamp;\n }\n const zone = new Intl.DateTimeFormat(undefined, { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((part) => part.type === \"timeZoneName\")?.value;\n return zone ? `${stamp} ${zone}` : stamp;\n}\n\n/**\n * Relative up to a week, absolute after. Future dates are always absolute — a\n * scheduled publish reads `12 Jun`, never `in 3 days`.\n */\nexport function formatRelativeTime(date: Date, now: Date = new Date()) {\n const delta = now.getTime() - date.getTime();\n if (delta < 0) {\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n }\n if (delta < MINUTE) {\n return \"Just now\";\n }\n if (delta < HOUR) {\n return `${Math.floor(delta / MINUTE)}m ago`;\n }\n if (delta < DAY) {\n return `${Math.floor(delta / HOUR)}h ago`;\n }\n if (delta < WEEK) {\n const days = Math.floor(delta / DAY);\n return `${days} ${days === 1 ? \"day\" : \"days\"} ago`;\n }\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n}\n\nexport type TimeFormat = \"auto\" | \"relative\" | \"absolute\";\n\nexport interface TimeProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n /** The instant to print — Date, epoch ms, or an ISO string. */\n value: Date | string | number;\n /** `auto` ages the value; `absolute` always prints the date. */\n format?: TimeFormat;\n /** Show the absolute stamp on hover and focus. */\n hasTooltip?: boolean;\n /** Append the reader's time zone to the tooltip. */\n hasTimeZone?: boolean;\n /** Pin \"now\" — useful for tests and stories. */\n now?: Date;\n /** Re-render interval in ms while the value is still relative. */\n refreshInterval?: number;\n}\n\n/**\n * A machine-readable `<time>` that ages itself. One form per cell: relative or\n * absolute, never both side by side.\n */\nexport const Time = forwardRef<HTMLTimeElement, TimeProps>(function Time(\n {\n value,\n format = \"auto\",\n hasTooltip = true,\n hasTimeZone = true,\n now,\n refreshInterval = 30_000,\n className,\n tabIndex,\n title,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n \"aria-describedby\": describedBy,\n ...rest\n },\n ref,\n) {\n const date = value instanceof Date ? value : new Date(value);\n const isValid = !Number.isNaN(date.getTime());\n const [, setTick] = useState(0);\n\n useEffect(() => {\n if (format === \"absolute\" || now) {\n return;\n }\n const id = window.setInterval(() => setTick((t) => t + 1), refreshInterval);\n return () => window.clearInterval(id);\n }, [format, now, refreshInterval]);\n\n const reference = now ?? new Date();\n const label = !isValid\n ? \"\"\n : format === \"absolute\"\n ? formatAbsoluteDate(date)\n : formatRelativeTime(date, reference);\n const stamp = isValid ? formatAbsoluteTime(date, { hasTimeZone }) : \"\";\n const isTipped = isValid && hasTooltip && label !== stamp;\n const { anchorRef, description, triggerProps, panel } = useTooltip<HTMLTimeElement>(\n isTipped && stamp,\n { className: \"ds-time-tooltip\" },\n );\n const timeRef = useMemo(() => mergeRefs(anchorRef, ref), [anchorRef, ref]);\n\n if (!isValid) {\n return null;\n }\n\n return (\n <>\n <time\n ref={timeRef}\n dateTime={date.toISOString()}\n suppressHydrationWarning\n className={cx(\"ds-time\", !isTipped && \"ds-time--plain\", className)}\n tabIndex={tabIndex ?? (isTipped ? 0 : undefined)}\n aria-describedby={[describedBy, description].filter(Boolean).join(\" \") || undefined}\n title={title ?? (isTipped ? undefined : stamp)}\n {...triggerProps({ onMouseEnter, onMouseLeave, onFocus, onBlur })}\n {...rest}\n >\n {label}\n </time>\n {panel}\n </>\n );\n});\n"],"mappings":";;;;;AAKA,SAASG,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAEA,IAAMC,IAAS;CAAC;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK,GAE5FC,IAAS,KACTC,IAAO,KAAKD,GACZE,IAAM,KAAKD,GACXE,IAAO,IAAID;AAEjB,SAASE,EAAI,GAAe;CAC1B,OAAO,OAAOC,CAAK,CAAC,CAAC,SAAS,GAAG,GAAG;AACtC;AAGA,SAAgBC,EAAmB,GAAY,IAAiC,CAAC,GAAG;CAClF,IAAM,EAAE,aAAU,OAASC,GACrBC,IAAO,GAAGC,EAAK,QAAQ,EAAE,GAAGV,EAAOU,EAAK,SAAS;CACvD,OAAOC,IAAU,GAAGF,EAAK,GAAGC,EAAK,YAAY,MAAMD;AACrD;AAGA,SAAgBG,EAAmB,GAAY,IAAqC,CAAC,GAAG;CACtF,IAAM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come from the shared .ds-tooltip surface. */
|
|
22
23
|
.ds-time-tooltip {
|
|
23
|
-
padding: var(--space-2) var(--space-3);
|
|
24
|
-
color: var(--color-text);
|
|
25
|
-
font-size: var(--font-size-xs);
|
|
26
24
|
white-space: nowrap;
|
|
27
25
|
font-variant-numeric: tabular-nums;
|
|
28
26
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./chunks/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./chunks/Icon-D38lQXNe.cjs"),t=require("./components/Button/index.cjs"),n=require("./components/Drawer/index.cjs"),r=require("./components/SideNav/index.cjs"),i=require("./components/TopNav/index.cjs"),a=require("./components/AppShell/index.cjs"),o=require("./components/ButtonGroup/index.cjs"),s=require("./components/Badge/index.cjs"),c=require("./components/Field/index.cjs"),l=require("./components/Modal/index.cjs"),u=require("./components/TextField/index.cjs"),d=require("./chunks/RichTextEditor-Ddk7qaqg.cjs"),f=require("./components/Container/index.cjs"),p=require("./components/FieldAffix/index.cjs"),m=require("./components/SearchField/index.cjs"),h=require("./components/SortableList/index.cjs"),g=require("./components/EntryPicker/index.cjs"),_=require("./components/NumberField/index.cjs"),v=require("./components/Popover/index.cjs"),y=require("./components/Select/index.cjs"),b=require("./components/Switch/index.cjs"),x=require("./chunks/ColourField-DWdc4d9E.cjs"),S=require("./chunks/Slider-k8weRl34.cjs"),C=require("./chunks/DatePicker-D5-LzTXS.cjs"),w=require("./components/TagsInput/index.cjs"),T=require("./components/Grid/index.cjs"),E=require("./components/Choice/index.cjs"),D=require("./components/SelectionCard/index.cjs"),O=require("./chunks/FormEditor-B-XLNrub.cjs"),k=require("./chunks/Board-BPA6mVhf.cjs"),A=require("./chunks/Avatar-BTKqaJLP.cjs"),j=require("./components/Table/index.cjs"),M=require("./components/Menu/index.cjs"),N=require("./components/Toast/index.cjs"),P=require("./components/Skeleton/index.cjs"),F=require("./components/SubNav/index.cjs"),I=require("./components/Stepper/index.cjs"),L=require("./components/AssetCard/index.cjs"),R=require("./components/AssetGrid/index.cjs"),z=require("./components/ImageCropper/index.cjs"),B=require("./components/Time/index.cjs"),V=require("./components/Pagination/index.cjs"),H=require("./components/EditLayout/index.cjs");exports.AppShell=a.AppShell,exports.AssetCard=L.AssetCard,exports.AssetTile=L.AssetCard,exports.AssetCardSkeleton=L.AssetCardSkeleton,exports.AssetTileSkeleton=L.AssetCardSkeleton,exports.AssetGrid=R.AssetGrid,exports.AssetGridEmpty=R.AssetGridEmpty,exports.Avatar=A.t,exports.AvatarGroup=A.n,exports.Badge=s.Badge,exports.Board=k.t,exports.BoardCard=k.n,exports.BoardColumn=k.r,exports.Button=t.Button,exports.ButtonGroup=o.ButtonGroup,exports.Calendar=C.t,exports.Checkbox=E.Checkbox,exports.CheckboxCard=D.CheckboxCard,exports.ChoiceGroup=E.ChoiceGroup,exports.ColourField=x.t,exports.ColourPanel=x.n,exports.Container=f.Container,exports.DateField=C.n,exports.DateRangeField=C.r,exports.Drawer=n.Drawer,exports.EditLayout=H.EditLayout,exports.EntryPicker=g.EntryPicker,exports.Field=c.Field,exports.FieldAffix=p.FieldAffix,exports.FormEditor=O.t,exports.Grid=T.Grid,exports.GridItem=T.GridItem,exports.Icon=e.t,exports.ImageCropper=z.ImageCropper,exports.Menu=M.Menu,exports.MenuItem=M.MenuItem,exports.MenuLabel=M.MenuLabel,exports.MenuSeparator=M.MenuSeparator,exports.Modal=l.Modal,exports.NumberField=_.NumberField,exports.NumberRangeField=_.NumberRangeField,exports.Pagination=V.Pagination,exports.Popover=v.Popover,exports.Radio=E.Radio,exports.RadioCard=D.RadioCard,exports.RangeSlider=S.t,exports.RichTextEditor=d.t,exports.SearchField=m.SearchField,exports.Select=y.Select,exports.SelectionCardGroup=D.SelectionCardGroup,exports.SideNav=r.SideNav,exports.SideNavFooter=r.SideNavFooter,exports.SideNavHeader=r.SideNavHeader,exports.SideNavItem=r.SideNavItem,exports.SideNavSection=r.SideNavSection,exports.Skeleton=P.Skeleton,exports.SkeletonText=P.SkeletonText,exports.Slider=S.n,exports.SortableList=h.SortableList,exports.SortableListItem=h.SortableListItem,exports.Stack=T.Stack,exports.Stepper=I.Stepper,exports.SubNav=F.SubNav,exports.SubNavButton=F.SubNavButton,exports.SubNavItem=F.SubNavItem,exports.Switch=b.Switch,exports.Table=j.Table,exports.TableBody=j.TableBody,exports.TableCell=j.TableCell,exports.TableEmpty=j.TableEmpty,exports.TableFrame=j.TableFrame,exports.TableHead=j.TableHead,exports.TableHeaderCell=j.TableHeaderCell,exports.TableRow=j.TableRow,exports.TableToolbar=j.TableToolbar,exports.TagsInput=w.TagsInput,exports.TextArea=u.TextArea,exports.TextField=u.TextField,exports.Time=B.Time,exports.Toast=N.Toast,exports.ToastProvider=N.ToastProvider,exports.TopNav=i.TopNav,exports.TopNavItem=i.TopNavItem,exports.cropToBlob=z.cropToBlob,exports.formatAbsoluteDate=B.formatAbsoluteDate,exports.formatAbsoluteTime=B.formatAbsoluteTime,exports.formatIsoDate=C.i,exports.formatRelativeTime=B.formatRelativeTime,exports.iconNames=e.n,exports.icons=e.r,exports.useSideNavCollapsed=r.useSideNavCollapsed,exports.useToast=N.useToast,exports.validateFormValues=O.n;
|
package/dist/index.js
CHANGED
|
@@ -19,16 +19,16 @@ import { NumberField as T, NumberRangeField as E } from "./components/NumberFiel
|
|
|
19
19
|
import { Popover as D } from "./components/Popover/index.js";
|
|
20
20
|
import { Select as O } from "./components/Select/index.js";
|
|
21
21
|
import { Switch as k } from "./components/Switch/index.js";
|
|
22
|
-
import { n as A, t as j } from "./chunks/ColourField-
|
|
22
|
+
import { n as A, t as j } from "./chunks/ColourField-BmHHxU6T.js";
|
|
23
23
|
import { n as M, t as N } from "./chunks/Slider-vdMFLX-H.js";
|
|
24
|
-
import { i as P, n as F, r as I, t as L } from "./chunks/DatePicker-
|
|
24
|
+
import { i as P, n as F, r as I, t as L } from "./chunks/DatePicker-CFYwk6eA.js";
|
|
25
25
|
import { TagsInput as R } from "./components/TagsInput/index.js";
|
|
26
26
|
import { Grid as z, GridItem as B, Stack as V } from "./components/Grid/index.js";
|
|
27
27
|
import { Checkbox as H, ChoiceGroup as U, Radio as W } from "./components/Choice/index.js";
|
|
28
28
|
import { CheckboxCard as G, RadioCard as K, SelectionCardGroup as q } from "./components/SelectionCard/index.js";
|
|
29
|
-
import { n as J, t as ne } from "./chunks/FormEditor-
|
|
29
|
+
import { n as J, t as ne } from "./chunks/FormEditor-_gqfxL_g.js";
|
|
30
30
|
import { n as Y, r as X, t as Z } from "./chunks/Board-CcIF7jS0.js";
|
|
31
|
-
import {
|
|
31
|
+
import { n as re, t as ie } from "./chunks/Avatar-C1q2AUD-.js";
|
|
32
32
|
import { Table as ae, TableBody as oe, TableCell as se, TableEmpty as ce, TableFrame as le, TableHead as ue, TableHeaderCell as de, TableRow as fe, TableToolbar as pe } from "./components/Table/index.js";
|
|
33
33
|
import { Menu as me, MenuItem as he, MenuLabel as ge, MenuSeparator as _e } from "./components/Menu/index.js";
|
|
34
34
|
import { Toast as ve, ToastProvider as ye, useToast as be } from "./components/Toast/index.js";
|
|
@@ -41,4 +41,4 @@ import { ImageCropper as ke, cropToBlob as Ae } from "./components/ImageCropper/
|
|
|
41
41
|
import { Time as je, formatAbsoluteDate as Me, formatAbsoluteTime as Ne, formatRelativeTime as Pe } from "./components/Time/index.js";
|
|
42
42
|
import { Pagination as Fe } from "./components/Pagination/index.js";
|
|
43
43
|
import { EditLayout as Ie } from "./components/EditLayout/index.js";
|
|
44
|
-
export { d as AppShell, Q as AssetCard, Q as AssetTile, $ as AssetCardSkeleton, $ as AssetTileSkeleton, De as AssetGrid, Oe as AssetGridEmpty,
|
|
44
|
+
export { d as AppShell, Q as AssetCard, Q as AssetTile, $ as AssetCardSkeleton, $ as AssetTileSkeleton, De as AssetGrid, Oe as AssetGridEmpty, ie as Avatar, re as AvatarGroup, p as Badge, Z as Board, Y as BoardCard, X as BoardColumn, te as Button, f as ButtonGroup, L as Calendar, H as Checkbox, G as CheckboxCard, U as ChoiceGroup, j as ColourField, A as ColourPanel, y as Container, F as DateField, I as DateRangeField, n as Drawer, Ie as EditLayout, w as EntryPicker, m as Field, b as FieldAffix, ne as FormEditor, z as Grid, B as GridItem, ee as Icon, ke as ImageCropper, me as Menu, he as MenuItem, ge as MenuLabel, _e as MenuSeparator, h as Modal, T as NumberField, E as NumberRangeField, Fe as Pagination, D as Popover, W as Radio, K as RadioCard, N as RangeSlider, v as RichTextEditor, x as SearchField, O as Select, q as SelectionCardGroup, r as SideNav, i as SideNavFooter, a as SideNavHeader, o as SideNavItem, s as SideNavSection, xe as Skeleton, Se as SkeletonText, M as Slider, S as SortableList, C as SortableListItem, V as Stack, Ee as Stepper, Ce as SubNav, we as SubNavButton, Te as SubNavItem, k as Switch, ae as Table, oe as TableBody, se as TableCell, ce as TableEmpty, le as TableFrame, ue as TableHead, de as TableHeaderCell, fe as TableRow, pe as TableToolbar, R as TagsInput, g as TextArea, _ as TextField, je as Time, ve as Toast, ye as ToastProvider, l as TopNav, u as TopNavItem, Ae as cropToBlob, Me as formatAbsoluteDate, Ne as formatAbsoluteTime, P as formatIsoDate, Pe as formatRelativeTime, e as iconNames, t as icons, c as useSideNavCollapsed, be as useToast, J as validateFormValues };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isComposing.d.cts","sourceRoot":"","sources":["../../src/internal/isComposing.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,WAE/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isComposing.d.ts","sourceRoot":"","sources":["../../src/internal/isComposing.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,WAE/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitionDuration.d.cts","sourceRoot":"","sources":["../../src/internal/transitionDuration.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,UAOpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitionDuration.d.ts","sourceRoot":"","sources":["../../src/internal/transitionDuration.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,UAOpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModalDialog.d.cts","sourceRoot":"","sources":["../../src/internal/useModalDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useModalDialog.d.cts","sourceRoot":"","sources":["../../src/internal/useModalDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACxC,kGAAkG;IAClG,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qHAAqH;IACrH,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACpD,kFAAkF;IAClF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,aAAqB,EACrB,SAAS,GACV,EAAE,kBAAkB;8BA0Dc,UAAU;EAO5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModalDialog.d.ts","sourceRoot":"","sources":["../../src/internal/useModalDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useModalDialog.d.ts","sourceRoot":"","sources":["../../src/internal/useModalDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACxC,kGAAkG;IAClG,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qHAAqH;IACrH,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACpD,kFAAkF;IAClF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,aAAqB,EACrB,SAAS,GACV,EAAE,kBAAkB;8BA0Dc,UAAU;EAO5C"}
|
package/dist/styles.css
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
@import "./elements.css";
|
|
5
5
|
|
|
6
6
|
/* Components follow the components they compose, so their overrides win ties. */
|
|
7
|
-
@import "./components/Avatar/style.css";
|
|
8
7
|
@import "./components/Badge/style.css";
|
|
9
8
|
@import "./components/Container/style.css";
|
|
10
9
|
@import "./components/FieldAffix/style.css";
|
|
@@ -41,6 +40,7 @@
|
|
|
41
40
|
@import "./components/TagsInput/style.css";
|
|
42
41
|
@import "./components/TextField/style.css";
|
|
43
42
|
@import "./components/ColourField/style.css";
|
|
43
|
+
@import "./components/Avatar/style.css";
|
|
44
44
|
@import "./components/RichTextEditor/style.css";
|
|
45
45
|
@import "./components/FormEditor/style.css";
|
|
46
46
|
@import "./components/Time/style.css";
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));const c=require("./Icon-D38lQXNe.cjs"),l=require("../components/Button/index.cjs"),u=require("./mergeRefs-Bc3qS0Tt.cjs"),d=require("./portalScope-BVA1-Ypu.cjs"),f=require("../components/TextField/index.cjs"),p=require("../components/FieldAffix/index.cjs"),m=require("../components/Popover/index.cjs"),h=require("./Slider-k8weRl34.cjs");let g=require("react"),_=require("react/jsx-runtime"),v=require("colord"),y=require("colord/plugins/names");y=s(y,1),(0,v.extend)([y.default]);var b={h:0,s:100,v:0,a:1};function x(e){let t=e.trim();if(!t)return null;let n=t.replace(/^#/,``),r=n.length<5?[...n].map(e=>e+e).join(``):n,i=/^(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.test(n)?(0,v.colord)({r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16),a:r.length===8?parseInt(r.slice(6),16)/255:1}):(0,v.colord)(t);return i.isValid()?i:null}function S(e){return(0,v.colord)(e).toHex().toUpperCase()}function C(e){return x(e)?.toHex().toUpperCase()??``}function w(e,t=b){let n=x(e);if(!n||n.toHex().toUpperCase()===S(t))return t;let{r,g:i,b:a,a:o}=n.rgba,s=Math.max(r,i,a),c=s-Math.min(r,i,a),l=c===0?t.h:s===r?(i-a)/c*60:s===i?((a-r)/c+2)*60:((r-i)/c+4)*60;l<0&&(l+=360);let u={h:l,s:s?c/s*100:0,v:s/255*100,a:o};return{...u,h:u.s===0?t.h:u.h,s:u.v===0?t.s:u.s}}function T(e){let t=e.closest(`[aria-modal='true']`)??document.body,n=d.s(t).filter(e=>!e.closest(`.ds-popover`));(n[n.map(t=>e.contains(t)).lastIndexOf(!0)+1]??n[0])?.focus({preventScroll:!0})}function E(e){return Math.max(0,Math.min(100,e))}function D({colour:e,isDisabled:t,onChange:n}){let r=(0,g.useRef)(null),i=t=>{let r=t.currentTarget.getBoundingClientRect();r.width&&r.height&&n({...e,s:E((t.clientX-r.left)/r.width*100),v:E((1-(t.clientY-r.top)/r.height)*100)})};return(0,_.jsx)(`div`,{className:`ds-colour-panel__square`,role:`slider`,tabIndex:t?-1:0,"aria-label":`Saturation and brightness`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.s),"aria-valuetext":`Saturation ${Math.round(e.s)}%, brightness ${Math.round(e.v)}%`,"aria-disabled":t||void 0,onKeyDown:r=>{if(t)return;let i=r.shiftKey?10:1,a={ArrowLeft:{s:E(e.s-i)},ArrowRight:{s:E(e.s+i)},ArrowDown:{v:E(e.v-i)},ArrowUp:{v:E(e.v+i)},Home:{s:0},End:{s:100}}[r.key];a&&(r.preventDefault(),n({...e,...a}))},onPointerDown:e=>{t||e.button!==0||(e.preventDefault(),e.currentTarget.focus(),r.current=e.pointerId,e.currentTarget.setPointerCapture(e.pointerId),i(e))},onPointerMove:e=>{!t&&r.current===e.pointerId&&i(e)},onPointerUp:e=>{r.current===e.pointerId&&(r.current=null,e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{r.current=null},onLostPointerCapture:()=>{r.current=null},children:(0,_.jsx)(`span`,{className:`ds-colour-panel__thumb`,style:{left:`${e.s}%`,top:`${100-e.v}%`}})})}function O({value:e,defaultValue:t=``,onValueChange:n}){let[r,i]=(0,g.useState)(t),a=e??r,[o,s]=(0,g.useState)(()=>({source:a,colour:w(a)})),c=o.colour;return o.source!==a&&(c=w(a,c),s({source:a,colour:c})),{current:a,colour:c,commit:t=>{let r=typeof t==`string`?C(t):S(t);s({source:r,colour:typeof t==`string`?w(t,c):t}),e===void 0&&i(r),n?.(r)}}}function k(e,t){let[n,r]=(0,g.useState)(null);return n&&n.source!==e&&n.text===e&&r({source:e,text:e}),{text:n?.source===e?n.text:t||e,type:(t,n)=>r({source:n?C(t):e,text:t}),discard:()=>r(null)}}function A(){return window.EyeDropper}var j=()=>()=>{},M=[],N=8;function P(e,t,n){let r=t%N,i=r+Math.floor((n-1-r)/N)*N;switch(e){case`Home`:return 0;case`End`:return n-1;case`ArrowRight`:return(t+1)%n;case`ArrowLeft`:return(t-1+n)%n;case`ArrowDown`:return t+N<n?t+N:r;case`ArrowUp`:return t>=N?t-N:i;default:return}}var F=(0,g.forwardRef)(function({value:e,defaultValue:t,onValueChange:n,...r},i){let{current:a,colour:o,commit:s}=O({value:e,defaultValue:t,onValueChange:n});return(0,_.jsx)(I,{...r,ref:i,colour:o,current:a,onColourChange:s})}),I=(0,g.forwardRef)(function({colour:e,current:t,onColourChange:n,presets:r=M,showPresets:i=!0,picker:a=`custom`,isDisabled:o=!1,className:s,style:u,...d},f){let p=(0,g.useRef)(null),m=(0,g.useRef)(!0),v=(0,g.useRef)(o),[y,b]=(0,g.useState)(!1),[T,E]=(0,g.useState)(``),O=(0,g.useSyncExternalStore)(j,()=>!!A(),()=>!1),k=(0,g.useId)(),F=C(t),I=S({...e,a:1}),L=(0,g.useMemo)(()=>{let e=new Map;for(let t of r){let n=C(t);n&&!e.has(n)&&e.set(n,t)}return[...e].map(([e,t])=>({normalised:e,preset:t}))},[r]),R=L.findIndex(e=>e.normalised===F);(0,g.useEffect)(()=>{v.current=o},[o]),(0,g.useEffect)(()=>(m.current=!0,()=>{m.current=!1}),[]);let z=async()=>{let t=A();if(!(!t||o||y)){b(!0),E(``);try{let r=await new t().open();m.current&&!v.current&&x(r.sRGBHex)&&n({...w(r.sRGBHex,e),a:e.a})}catch(e){m.current&&!(e instanceof DOMException&&e.name===`AbortError`)&&E(`Unable to pick a colour from the screen. Try again.`)}finally{m.current&&b(!1)}}};return(0,_.jsxs)(`div`,{...d,ref:f,className:[`ds-colour-panel`,s].filter(Boolean).join(` `),"data-disabled":o||void 0,style:{...u,"--colour-hue":`hsl(${e.h} 100% 50%)`,"--colour-rgb":I,"--colour-rgba":S(e)},children:[(0,_.jsxs)(`div`,{className:`ds-colour-panel__head`,children:[(0,_.jsx)(`span`,{children:`Colour`}),(0,_.jsx)(`span`,{className:`ds-colour-panel__value`,children:F||`No colour`})]}),a===`custom`?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(D,{colour:e,isDisabled:o,onChange:n}),(0,_.jsxs)(`div`,{className:`ds-colour-panel__hue-row`,children:[O&&(0,_.jsx)(l.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`pipette`,"aria-label":`Pick from screen`,isDisabled:o,"aria-busy":y||void 0,onClick:()=>void z()}),(0,_.jsx)(h.n,{className:`ds-colour-panel__hue`,value:e.h,min:0,max:360,step:1,hasValueLabel:!1,"aria-label":`Hue`,"aria-valuetext":`${Math.round(e.h)} degrees`,isDisabled:o,onValueChange:t=>n({...e,h:t}),onKeyDown:t=>{if(!t.shiftKey||![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(t.key))return;t.preventDefault();let r=t.key===`ArrowRight`||t.key===`ArrowUp`?15:-15;n({...e,h:Math.max(0,Math.min(360,e.h+r))})}})]})]}):(0,_.jsxs)(`div`,{className:`ds-colour-panel__native`,children:[(0,_.jsx)(`input`,{ref:p,type:`color`,value:I,tabIndex:-1,"aria-hidden":`true`,disabled:o,onChange:t=>{x(t.target.value)&&n({...w(t.target.value,e),a:e.a})}}),(0,_.jsx)(l.Button,{variant:`neutral`,size:`sm`,iconStart:`pipette`,isDisabled:o,onClick:()=>{let e=p.current;if(e)try{e.showPicker?e.showPicker():e.click()}catch{e.click()}},children:`Custom colour…`})]}),(0,_.jsxs)(`div`,{className:`ds-colour-panel__opacity`,children:[(0,_.jsx)(`label`,{htmlFor:`${k}-opacity`,children:`Opacity`}),(0,_.jsx)(h.n,{id:`${k}-opacity`,className:`ds-colour-panel__alpha`,value:Math.round(e.a*100),min:0,max:100,step:1,suffix:`%`,isDisabled:o,onValueChange:t=>n({...e,a:t/100})})]}),i&&L.length>0&&(0,_.jsxs)(`div`,{className:`ds-colour-panel__presets`,children:[(0,_.jsx)(`span`,{id:k,className:`ds-colour-panel__presets-label`,children:`Presets`}),(0,_.jsx)(`div`,{className:`ds-colour-panel__grid`,role:`radiogroup`,"aria-labelledby":k,style:{"--colour-preset-columns":N},onKeyDown:e=>{let t=Array.from(e.currentTarget.querySelectorAll(`[role='radio']`)),n=t.indexOf(e.target),r=n<0?void 0:P(e.key,n,t.length);r!==void 0&&(e.preventDefault(),t[r]?.focus(),t[r]?.click())},children:L.map(({normalised:e,preset:t},r)=>{let i=r===R;return(0,_.jsx)(l.Button,{variant:`simple`,size:`xs`,isIconOnly:!0,role:`radio`,"aria-checked":i,"aria-label":t,title:t,tabIndex:r===Math.max(0,R)?0:-1,isDisabled:o,className:`ds-colour-panel__preset`,onClick:()=>n(t),children:(0,_.jsx)(`span`,{className:`ds-colour-swatch`,style:{"--colour-swatch":e},children:i&&(0,_.jsx)(c.t,{name:`check`,size:16,strokeWidth:3})})},e)})})]}),T&&(0,_.jsx)(`span`,{className:`ds-colour-panel__error`,role:`status`,children:T})]})}),L=(0,g.forwardRef)(function({value:e,defaultValue:t,onValueChange:n,onValidityChange:r,presets:i,showPresets:a,picker:o,placement:s,isDisabled:c=!1,disabled:h,readOnly:v,isInvalid:y,"aria-invalid":b,id:S,className:w,onBlur:E,onKeyDown:D,...A},j){let{current:M,colour:N,commit:P}=O({value:e,defaultValue:t,onValueChange:n}),[F,L]=(0,g.useState)(!1),R=(0,g.useRef)(null),z=(0,g.useRef)(null),B=(0,g.useRef)(null),V=(0,g.useRef)(null),H=(0,g.useId)(),U=S??`${H}-input`,W=C(M),{text:G,type:K,discard:q}=k(M,W),J=!(!G.trim()||x(G)),Y=c||h;F&&(Y||v)&&L(!1);let X=F&&!Y&&!v;(0,g.useEffect)(()=>{r?.(!J),z.current?.setCustomValidity(J?`Enter a colour, such as #0052CC or rebeccapurple.`:``)},[J,r]),(0,g.useEffect)(()=>{if(!X)return;V.current&&d.s(V.current)[0]?.focus({preventScroll:!0});let e=e=>{let t=e.target;t&&!R.current?.contains(t)&&!V.current?.contains(t)&&L(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[X]);let Z=e=>{B.current=e,L(!X)},Q=()=>{L(!1),B.current?.focus({preventScroll:!0})},$={"aria-label":X?`Close colour picker`:`Open colour picker`,"aria-haspopup":`dialog`,"aria-expanded":X,"aria-controls":X?H:void 0,isDisabled:Y||v};return(0,_.jsxs)(`div`,{className:`ds-colour-field`,ref:R,onBlur:e=>{let t=e.relatedTarget;t&&!R.current?.contains(t)&&!V.current?.contains(t)&&L(!1)},onKeyDown:e=>{if(X&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Q()),!X||e.key!==`Tab`||!V.current?.contains(e.target))return;let t=d.s(V.current);(e.shiftKey?e.target===t[0]:e.target===t.at(-1))&&(e.preventDefault(),e.stopPropagation(),L(!1),e.shiftKey?B.current?.focus({preventScroll:!0}):R.current&&T(R.current))},children:[(0,_.jsx)(p.FieldAffix,{isLeadInteractive:!0,isTrailInteractive:!0,lead:(0,_.jsx)(l.Button,{"aria-hidden":`true`,tabIndex:-1,isDisabled:$.isDisabled,variant:`simple`,size:`xs`,isIconOnly:!0,onMouseDown:e=>e.preventDefault(),onClick:()=>{B.current=z.current,X?Q():L(!0)},children:(0,_.jsx)(`span`,{className:`ds-colour-swatch ds-colour-field__swatch`,style:{"--colour-swatch":W||`transparent`}})}),trail:(0,_.jsx)(l.Button,{...$,variant:`simple`,size:`xs`,isIconOnly:!0,iconStart:`chevron-down`,onClick:e=>Z(e.currentTarget)}),children:(0,_.jsx)(f.TextField,{...A,ref:u.t(z,j),id:U,disabled:Y,readOnly:v,spellCheck:!1,autoComplete:`off`,value:G,"aria-invalid":J||y||b||void 0,"aria-haspopup":`dialog`,"aria-controls":X?H:void 0,className:[`ds-colour-field__input`,w].filter(Boolean).join(` `),onChange:e=>{let t=e.target.value,n=!t.trim()||!!x(t);K(t,n),n&&P(t)},onBlur:e=>{J||q(),E?.(e)},onKeyDown:e=>{D?.(e),!e.defaultPrevented&&(e.key===`Enter`&&!J&&(e.preventDefault(),q()),e.key===`ArrowDown`&&!Y&&!v&&(e.preventDefault(),B.current=e.currentTarget,L(!0)))}})}),(0,_.jsx)(m.Popover,{anchorRef:z,anchorId:U,isOpen:X,placement:s,panelRef:V,id:H,role:`dialog`,"aria-label":`Choose a colour`,tabIndex:-1,className:`ds-colour-field__popover`,children:(0,_.jsx)(I,{colour:N,current:W,presets:i,showPresets:a,picker:o,onColourChange:e=>{q(),P(e)}})})]})});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return L}});
|
|
2
|
-
//# sourceMappingURL=ColourField-BQ4a5tAV.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColourField-BQ4a5tAV.cjs","names":["extend","namesPlugin","tabbableControls","useRef","useState","forwardRef","useRef","useState","useSyncExternalStore","useId","useMemo","_Fragment","Button","Slider","Icon","forwardRef","useState","useRef","useId","tabbableControls","FieldAffix","Button","TextField","mergeRefs","Popover","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__copyProps","from","keys","i","n","key","to","except","k","desc","__toESM","mod","isNodeMode","target","require_Icon","require_components_Button_index","require_mergeRefs","require_portalScope","require_components_TextField_index","require_components_FieldAffix_index","require_components_Popover_index","require_Slider","react","react_jsx_runtime","colord","colord_plugins_names","emptyColour","parseColour","text","value","hex","digits","digit","colour","colourHex","normaliseColour","colourState","parsed","previous","max","g","b","delta","h","next","focusAfterField","boundary","root","controls","element","clamp","ColourSquare","dragging","update","rect","event","onChange","isDisabled","step","change","useColourValue","internal","setInternal","defaultValue","current","selection","setSelection","onValueChange","useColourDraft","draft","setDraft","isValid","eyeDropperConstructor","subscribe","noPresets","presetColumns","presetTarget","column","index","lastInColumn","count","ColourPanel","rest","ColourPanelContent","commit","inputRef","active","disabledRef","isPicking","setPicking","pickerError","setPickerError","hasEyeDropper","presetsId","rgb","swatches","unique","preset","presets","normalised","selectedIndex","swatch","pickFromScreen","EyeDropper","result","onColourChange","error","className","style","picker","input","a","showPresets","radios","selected","ColourField","ariaInvalid","isOpen","setOpen","rootRef","openerRef","panelRef","panelId","fieldId","id","invalid","effectiveDisabled","disabled","readOnly","visible","onValidityChange","outside","toggle","opener","close","triggerProps","ref","isInvalid","valid","type","discard","onBlur","onKeyDown"],"sources":["../../src/components/ColourField/colour.ts","../../src/components/ColourField/focus.ts","../../src/components/ColourField/square.tsx","../../src/components/ColourField/value.ts","../../src/components/ColourField/panel.tsx","../../src/components/ColourField/index.tsx"],"sourcesContent":["import { colord, extend } from \"colord\";\nimport namesPlugin from \"colord/plugins/names\";\n\nextend([namesPlugin]);\n\nexport interface Colour {\n h: number;\n s: number;\n v: number;\n a: number;\n}\n\nconst emptyColour: Colour = { h: 0, s: 100, v: 0, a: 1 };\n\nexport function parseColour(value: string) {\n const text = value.trim();\n if (!text) {\n return null;\n }\n const hex = text.replace(/^#/, \"\");\n // Colord's string hex parser rounds alpha to two decimals. Decode hex bytes\n // first so a typed alpha survives normalisation and later opacity edits.\n const digits = hex.length < 5 ? [...hex].map((digit) => digit + digit).join(\"\") : hex;\n const colour = /^(?:[\\da-f]{3,4}|[\\da-f]{6}|[\\da-f]{8})$/i.test(hex)\n ? colord({\n r: parseInt(digits.slice(0, 2), 16),\n g: parseInt(digits.slice(2, 4), 16),\n b: parseInt(digits.slice(4, 6), 16),\n a: digits.length === 8 ? parseInt(digits.slice(6), 16) / 255 : 1,\n })\n : colord(text);\n return colour.isValid() ? colour : null;\n}\n\nexport function colourHex(colour: Colour) {\n return colord(colour).toHex().toUpperCase();\n}\n\nexport function normaliseColour(value: string) {\n return parseColour(value)?.toHex().toUpperCase() ?? \"\";\n}\n\n/** Preserve latent hue in greys, and saturation in black, including parent echoes. */\nexport function colourState(value: string, previous = emptyColour): Colour {\n const parsed = parseColour(value);\n if (!parsed || parsed.toHex().toUpperCase() === colourHex(previous)) {\n return previous;\n }\n // Keep full HSV precision: changing opacity must not quantise the RGB value.\n const { r, g, b, a } = parsed.rgba;\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n let h =\n delta === 0\n ? previous.h\n : max === r\n ? ((g - b) / delta) * 60\n : max === g\n ? ((b - r) / delta + 2) * 60\n : ((r - g) / delta + 4) * 60;\n if (h < 0) {\n h += 360;\n }\n const next = { h, s: max ? (delta / max) * 100 : 0, v: (max / 255) * 100, a };\n return { ...next, h: next.s === 0 ? previous.h : next.h, s: next.v === 0 ? previous.s : next.s };\n}\n","import { tabbableControls } from \"../../internal/dialogFocus\";\n\n/** Continue after the composed field, respecting an enclosing modal's focus boundary. */\nexport function focusAfterField(root: HTMLElement) {\n const boundary = root.closest<HTMLElement>(\"[aria-modal='true']\") ?? document.body;\n const controls = tabbableControls(boundary).filter((element) => !element.closest(\".ds-popover\"));\n const last = controls.map((element) => root.contains(element)).lastIndexOf(true);\n const next = controls[last + 1] ?? controls[0];\n next?.focus({ preventScroll: true });\n}\n","import { useRef, type KeyboardEvent, type PointerEvent } from \"react\";\nimport type { Colour } from \"./colour\";\n\ninterface ColourSquareProps {\n colour: Colour;\n isDisabled: boolean;\n onChange: (colour: Colour) => void;\n}\n\nfunction clamp(value: number) {\n return Math.max(0, Math.min(100, value));\n}\n\nexport function ColourSquare({ colour, isDisabled, onChange }: ColourSquareProps) {\n const dragging = useRef<number | null>(null);\n const update = (event: PointerEvent<HTMLDivElement>) => {\n const rect = event.currentTarget.getBoundingClientRect();\n if (!rect.width || !rect.height) {\n return;\n }\n onChange({\n ...colour,\n s: clamp(((event.clientX - rect.left) / rect.width) * 100),\n v: clamp((1 - (event.clientY - rect.top) / rect.height) * 100),\n });\n };\n const handleKey = (event: KeyboardEvent) => {\n if (isDisabled) {\n return;\n }\n const step = event.shiftKey ? 10 : 1;\n const changes: Record<string, Partial<Colour>> = {\n ArrowLeft: { s: clamp(colour.s - step) },\n ArrowRight: { s: clamp(colour.s + step) },\n ArrowDown: { v: clamp(colour.v - step) },\n ArrowUp: { v: clamp(colour.v + step) },\n Home: { s: 0 },\n End: { s: 100 },\n };\n const change = changes[event.key];\n if (!change) {\n return;\n }\n event.preventDefault();\n onChange({ ...colour, ...change });\n };\n return (\n <div\n className=\"ds-colour-panel__square\"\n role=\"slider\"\n tabIndex={isDisabled ? -1 : 0}\n aria-label=\"Saturation and brightness\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(colour.s)}\n aria-valuetext={`Saturation ${Math.round(colour.s)}%, brightness ${Math.round(colour.v)}%`}\n aria-disabled={isDisabled || undefined}\n onKeyDown={handleKey}\n onPointerDown={(event) => {\n if (isDisabled || event.button !== 0) {\n return;\n }\n event.preventDefault();\n event.currentTarget.focus();\n dragging.current = event.pointerId;\n event.currentTarget.setPointerCapture(event.pointerId);\n update(event);\n }}\n onPointerMove={(event) => {\n if (!isDisabled && dragging.current === event.pointerId) {\n update(event);\n }\n }}\n onPointerUp={(event) => {\n if (dragging.current !== event.pointerId) {\n return;\n }\n dragging.current = null;\n event.currentTarget.releasePointerCapture(event.pointerId);\n }}\n onPointerCancel={() => {\n dragging.current = null;\n }}\n onLostPointerCapture={() => {\n dragging.current = null;\n }}\n >\n <span\n className=\"ds-colour-panel__thumb\"\n style={{ left: `${colour.s}%`, top: `${100 - colour.v}%` }}\n />\n </div>\n );\n}\n","import { useState } from \"react\";\nimport { colourHex, colourState, normaliseColour, type Colour } from \"./colour\";\n\nexport interface ColourValueProps {\n value?: string;\n defaultValue?: string;\n /** Uppercase hex (including alpha when needed), or an empty string when cleared. */\n onValueChange?: (value: string) => void;\n}\n\nexport function useColourValue({ value, defaultValue = \"\", onValueChange }: ColourValueProps) {\n const [internal, setInternal] = useState(defaultValue);\n const current = value ?? internal;\n const [selection, setSelection] = useState(() => ({\n source: current,\n colour: colourState(current),\n }));\n let colour = selection.colour;\n if (selection.source !== current) {\n colour = colourState(current, colour);\n setSelection({ source: current, colour });\n }\n\n const commit = (next: string | Colour) => {\n const hex = typeof next === \"string\" ? normaliseColour(next) : colourHex(next);\n setSelection({\n source: hex,\n colour: typeof next === \"string\" ? colourState(next, colour) : next,\n });\n if (value === undefined) {\n setInternal(hex);\n }\n onValueChange?.(hex);\n };\n\n return { current, colour, commit };\n}\n\n/** Typed text the field shows until it is committed, blurred, or replaced. */\nexport function useColourDraft(current: string, hex: string) {\n const [draft, setDraft] = useState<{ source: string; text: string } | null>(null);\n // A draft belongs to the value it was typed over. A parent that stores the invalid\n // text (FormEditor does) takes it over, so restoring the earlier value then wins.\n if (draft && draft.source !== current && draft.text === current) {\n setDraft({ source: current, text: current });\n }\n const text = draft?.source === current ? draft.text : hex || current;\n /** Valid text becomes the committed hex; invalid text stays over the current value. */\n const type = (next: string, isValid: boolean) =>\n setDraft({ source: isValid ? normaliseColour(next) : current, text: next });\n return { text, type, discard: () => setDraft(null) };\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { Slider } from \"../Slider\";\nimport { colourHex, colourState, normaliseColour, parseColour, type Colour } from \"./colour\";\nimport { ColourSquare } from \"./square\";\nimport { useColourValue, type ColourValueProps } from \"./value\";\nimport \"./style.css\";\n\nexport interface ColourPickerOptions {\n presets?: string[];\n showPresets?: boolean;\n picker?: \"custom\" | \"native\";\n isDisabled?: boolean;\n}\n\nexport interface ColourPanelProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, \"defaultValue\" | \"onChange\">,\n ColourValueProps,\n ColourPickerOptions {}\n\ninterface EyeDropperInstance {\n open: () => Promise<{ sRGBHex: string }>;\n}\nfunction eyeDropperConstructor() {\n return (window as Window & { EyeDropper?: new () => EyeDropperInstance }).EyeDropper;\n}\nconst subscribe = () => () => {};\nconst noPresets: string[] = [];\nconst presetColumns = 8;\n\n/** Where a key moves within the preset grid; rows wrap within their column. */\nfunction presetTarget(key: string, index: number, count: number) {\n const column = index % presetColumns;\n const lastInColumn = column + Math.floor((count - 1 - column) / presetColumns) * presetColumns;\n switch (key) {\n case \"Home\":\n return 0;\n case \"End\":\n return count - 1;\n case \"ArrowRight\":\n return (index + 1) % count;\n case \"ArrowLeft\":\n return (index - 1 + count) % count;\n case \"ArrowDown\":\n return index + presetColumns < count ? index + presetColumns : column;\n case \"ArrowUp\":\n return index >= presetColumns ? index - presetColumns : lastInColumn;\n default:\n return undefined;\n }\n}\n\n/** A standalone colour selection surface, also composed by ColourField. */\nexport const ColourPanel = forwardRef<HTMLDivElement, ColourPanelProps>(function ColourPanel(\n { value, defaultValue, onValueChange, ...rest },\n ref,\n) {\n const { current, colour, commit } = useColourValue({ value, defaultValue, onValueChange });\n return (\n <ColourPanelContent\n {...rest}\n ref={ref}\n colour={colour}\n current={current}\n onColourChange={commit}\n />\n );\n});\n\ninterface ColourPanelContentProps extends Omit<\n ColourPanelProps,\n \"value\" | \"defaultValue\" | \"onValueChange\"\n> {\n colour: Colour;\n current: string;\n onColourChange: (colour: Colour | string) => void;\n}\n\nexport const ColourPanelContent = forwardRef<HTMLDivElement, ColourPanelContentProps>(\n function ColourPanelContent(\n {\n colour,\n current,\n onColourChange,\n presets = noPresets,\n showPresets = true,\n picker = \"custom\",\n isDisabled = false,\n className,\n style,\n ...rest\n },\n ref,\n ) {\n const inputRef = useRef<HTMLInputElement>(null);\n const active = useRef(true);\n const disabledRef = useRef(isDisabled);\n const [isPicking, setPicking] = useState(false);\n const [pickerError, setPickerError] = useState(\"\");\n const hasEyeDropper = useSyncExternalStore(\n subscribe,\n () => Boolean(eyeDropperConstructor()),\n () => false,\n );\n const presetsId = useId();\n const hex = normaliseColour(current);\n const rgb = colourHex({ ...colour, a: 1 });\n // Equivalent spellings collapse onto the first; each preset is parsed once.\n const swatches = useMemo(() => {\n const unique = new Map<string, string>();\n for (const preset of presets) {\n const normalised = normaliseColour(preset);\n if (normalised && !unique.has(normalised)) {\n unique.set(normalised, preset);\n }\n }\n return [...unique].map(([normalised, preset]) => ({ normalised, preset }));\n }, [presets]);\n const selectedIndex = swatches.findIndex((swatch) => swatch.normalised === hex);\n useEffect(() => {\n disabledRef.current = isDisabled;\n }, [isDisabled]);\n useEffect(() => {\n active.current = true;\n return () => {\n active.current = false;\n };\n }, []);\n\n const pickFromScreen = async () => {\n const EyeDropper = eyeDropperConstructor();\n if (!EyeDropper || isDisabled || isPicking) {\n return;\n }\n setPicking(true);\n setPickerError(\"\");\n try {\n const result = await new EyeDropper().open();\n if (active.current && !disabledRef.current) {\n if (parseColour(result.sRGBHex)) {\n onColourChange({ ...colourState(result.sRGBHex, colour), a: colour.a });\n }\n }\n } catch (error) {\n if (active.current && !(error instanceof DOMException && error.name === \"AbortError\")) {\n setPickerError(\"Unable to pick a colour from the screen. Try again.\");\n }\n } finally {\n if (active.current) {\n setPicking(false);\n }\n }\n };\n\n return (\n <div\n {...rest}\n ref={ref}\n className={[\"ds-colour-panel\", className].filter(Boolean).join(\" \")}\n data-disabled={isDisabled || undefined}\n style={\n {\n ...style,\n \"--colour-hue\": `hsl(${colour.h} 100% 50%)`,\n \"--colour-rgb\": rgb,\n \"--colour-rgba\": colourHex(colour),\n } as CSSProperties\n }\n >\n <div className=\"ds-colour-panel__head\">\n <span>Colour</span>\n <span className=\"ds-colour-panel__value\">{hex || \"No colour\"}</span>\n </div>\n {picker === \"custom\" ? (\n <>\n <ColourSquare\n colour={colour}\n isDisabled={isDisabled}\n onChange={onColourChange}\n />\n <div className=\"ds-colour-panel__hue-row\">\n {hasEyeDropper && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"pipette\"\n aria-label=\"Pick from screen\"\n isDisabled={isDisabled}\n // Busy, not pending: a pending Button disables itself and drops focus.\n aria-busy={isPicking || undefined}\n onClick={() => void pickFromScreen()}\n />\n )}\n <Slider\n className=\"ds-colour-panel__hue\"\n value={colour.h}\n min={0}\n max={360}\n step={1}\n hasValueLabel={false}\n aria-label=\"Hue\"\n aria-valuetext={`${Math.round(colour.h)} degrees`}\n isDisabled={isDisabled}\n onValueChange={(h) => onColourChange({ ...colour, h })}\n onKeyDown={(event) => {\n if (\n !event.shiftKey ||\n ![\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\"].includes(event.key)\n ) {\n return;\n }\n event.preventDefault();\n const delta = event.key === \"ArrowRight\" || event.key === \"ArrowUp\" ? 15 : -15;\n onColourChange({ ...colour, h: Math.max(0, Math.min(360, colour.h + delta)) });\n }}\n />\n </div>\n </>\n ) : (\n <div className=\"ds-colour-panel__native\">\n <input\n ref={inputRef}\n type=\"color\"\n value={rgb}\n tabIndex={-1}\n aria-hidden=\"true\"\n disabled={isDisabled}\n onChange={(event) => {\n if (parseColour(event.target.value)) {\n onColourChange({ ...colourState(event.target.value, colour), a: colour.a });\n }\n }}\n />\n <Button\n variant=\"neutral\"\n size=\"sm\"\n iconStart=\"pipette\"\n isDisabled={isDisabled}\n onClick={() => {\n const input = inputRef.current;\n if (!input) {\n return;\n }\n try {\n if (input.showPicker) {\n input.showPicker();\n } else {\n input.click();\n }\n } catch {\n input.click();\n }\n }}\n >\n Custom colour…\n </Button>\n </div>\n )}\n <div className=\"ds-colour-panel__opacity\">\n <label htmlFor={`${presetsId}-opacity`}>Opacity</label>\n <Slider\n id={`${presetsId}-opacity`}\n className=\"ds-colour-panel__alpha\"\n value={Math.round(colour.a * 100)}\n min={0}\n max={100}\n step={1}\n suffix=\"%\"\n isDisabled={isDisabled}\n onValueChange={(a) => onColourChange({ ...colour, a: a / 100 })}\n />\n </div>\n {showPresets && swatches.length > 0 && (\n <div className=\"ds-colour-panel__presets\">\n <span\n id={presetsId}\n className=\"ds-colour-panel__presets-label\"\n >\n Presets\n </span>\n <div\n className=\"ds-colour-panel__grid\"\n role=\"radiogroup\"\n aria-labelledby={presetsId}\n style={{ \"--colour-preset-columns\": presetColumns } as CSSProperties}\n onKeyDown={(event) => {\n const radios = Array.from(\n event.currentTarget.querySelectorAll<HTMLButtonElement>(\"[role='radio']\"),\n );\n const index = radios.indexOf(event.target as HTMLButtonElement);\n const next = index < 0 ? undefined : presetTarget(event.key, index, radios.length);\n if (next === undefined) {\n return;\n }\n event.preventDefault();\n radios[next]?.focus();\n radios[next]?.click();\n }}\n >\n {swatches.map(({ normalised, preset }, index) => {\n const selected = index === selectedIndex;\n return (\n <Button\n key={normalised}\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n role=\"radio\"\n aria-checked={selected}\n aria-label={preset}\n title={preset}\n tabIndex={index === Math.max(0, selectedIndex) ? 0 : -1}\n isDisabled={isDisabled}\n className=\"ds-colour-panel__preset\"\n onClick={() => onColourChange(preset)}\n >\n <span\n className=\"ds-colour-swatch\"\n style={{ \"--colour-swatch\": normalised } as CSSProperties}\n >\n {selected && (\n <Icon\n name=\"check\"\n size={16}\n strokeWidth={3}\n />\n )}\n </span>\n </Button>\n );\n })}\n </div>\n </div>\n )}\n {pickerError && (\n <span\n className=\"ds-colour-panel__error\"\n role=\"status\"\n >\n {pickerError}\n </span>\n )}\n </div>\n );\n },\n);\n","import { forwardRef, useEffect, useId, useRef, useState, type CSSProperties } from \"react\";\nimport { Button } from \"../Button\";\nimport { FieldAffix } from \"../FieldAffix\";\nimport { Popover, type PopoverPlacement } from \"../Popover\";\nimport { TextField, type TextFieldProps } from \"../TextField\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { normaliseColour, parseColour } from \"./colour\";\nimport { tabbableControls } from \"../../internal/dialogFocus\";\nimport { focusAfterField } from \"./focus\";\nimport { ColourPanelContent, type ColourPickerOptions } from \"./panel\";\nimport { useColourDraft, useColourValue, type ColourValueProps } from \"./value\";\nimport \"./style.css\";\n\nexport { ColourPanel } from \"./panel\";\nexport type { ColourPanelProps } from \"./panel\";\n\nexport interface ColourFieldProps\n extends\n Omit<TextFieldProps, \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"children\">,\n ColourValueProps,\n ColourPickerOptions {\n isInvalid?: boolean;\n placement?: PopoverPlacement;\n /** Parsing validity; an empty value is valid and native required validation remains separate. */\n onValidityChange?: (isValid: boolean) => void;\n}\n\n/** A typed colour value and a visual picker, bound to the shared Field frame. */\nexport const ColourField = forwardRef<HTMLInputElement, ColourFieldProps>(function ColourField(\n {\n value,\n defaultValue,\n onValueChange,\n onValidityChange,\n presets,\n showPresets,\n picker,\n placement,\n isDisabled = false,\n disabled,\n readOnly,\n isInvalid,\n \"aria-invalid\": ariaInvalid,\n id,\n className,\n onBlur,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const { current, colour, commit } = useColourValue({ value, defaultValue, onValueChange });\n const [isOpen, setOpen] = useState(false);\n const rootRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const openerRef = useRef<HTMLElement | null>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const panelId = useId();\n const fieldId = id ?? `${panelId}-input`;\n const hex = normaliseColour(current);\n const { text, type, discard } = useColourDraft(current, hex);\n const invalid = Boolean(text.trim() && !parseColour(text));\n const effectiveDisabled = isDisabled || disabled;\n if (isOpen && (effectiveDisabled || readOnly)) {\n setOpen(false);\n }\n const visible = isOpen && !effectiveDisabled && !readOnly;\n\n useEffect(() => {\n onValidityChange?.(!invalid);\n inputRef.current?.setCustomValidity(\n invalid ? \"Enter a colour, such as #0052CC or rebeccapurple.\" : \"\",\n );\n }, [invalid, onValidityChange]);\n\n useEffect(() => {\n if (!visible) {\n return;\n }\n if (panelRef.current) {\n tabbableControls(panelRef.current)[0]?.focus({ preventScroll: true });\n }\n const outside = (event: MouseEvent) => {\n const target = event.target as Node;\n if (target && !rootRef.current?.contains(target) && !panelRef.current?.contains(target)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", outside);\n return () => document.removeEventListener(\"mousedown\", outside);\n }, [visible]);\n\n const toggle = (opener: HTMLElement) => {\n openerRef.current = opener;\n setOpen(!visible);\n };\n const close = () => {\n setOpen(false);\n openerRef.current?.focus({ preventScroll: true });\n };\n const triggerProps = {\n \"aria-label\": visible ? \"Close colour picker\" : \"Open colour picker\",\n \"aria-haspopup\": \"dialog\" as const,\n \"aria-expanded\": visible,\n \"aria-controls\": visible ? panelId : undefined,\n isDisabled: effectiveDisabled || readOnly,\n };\n\n return (\n <div\n className=\"ds-colour-field\"\n ref={rootRef}\n onBlur={(event) => {\n const target = event.relatedTarget as Node | null;\n if (target && !rootRef.current?.contains(target) && !panelRef.current?.contains(target)) {\n setOpen(false);\n }\n }}\n onKeyDown={(event) => {\n if (visible && event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n close();\n }\n if (!visible || event.key !== \"Tab\" || !panelRef.current?.contains(event.target as Node)) {\n return;\n }\n const controls = tabbableControls(panelRef.current);\n const atBoundary = event.shiftKey\n ? event.target === controls[0]\n : event.target === controls.at(-1);\n if (!atBoundary) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n setOpen(false);\n if (event.shiftKey) {\n openerRef.current?.focus({ preventScroll: true });\n } else if (rootRef.current) {\n focusAfterField(rootRef.current);\n }\n }}\n >\n <FieldAffix\n isLeadInteractive\n isTrailInteractive\n lead={\n // A pointer shortcut only: the chevron is the one keyboard and screen\n // reader trigger. The swatch never takes focus; the input gets it back.\n <Button\n aria-hidden=\"true\"\n tabIndex={-1}\n isDisabled={triggerProps.isDisabled}\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n openerRef.current = inputRef.current;\n if (visible) {\n close();\n } else {\n setOpen(true);\n }\n }}\n >\n <span\n className=\"ds-colour-swatch ds-colour-field__swatch\"\n style={{ \"--colour-swatch\": hex || \"transparent\" } as CSSProperties}\n />\n </Button>\n }\n trail={\n <Button\n {...triggerProps}\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n iconStart=\"chevron-down\"\n onClick={(event) => toggle(event.currentTarget)}\n />\n }\n >\n <TextField\n {...rest}\n ref={mergeRefs(inputRef, ref)}\n id={fieldId}\n disabled={effectiveDisabled}\n readOnly={readOnly}\n spellCheck={false}\n autoComplete=\"off\"\n value={text}\n aria-invalid={invalid || isInvalid || ariaInvalid || undefined}\n aria-haspopup=\"dialog\"\n aria-controls={visible ? panelId : undefined}\n className={[\"ds-colour-field__input\", className].filter(Boolean).join(\" \")}\n onChange={(event) => {\n const next = event.target.value;\n const valid = !next.trim() || Boolean(parseColour(next));\n type(next, valid);\n if (valid) {\n commit(next);\n }\n }}\n onBlur={(event) => {\n if (!invalid) {\n discard();\n }\n onBlur?.(event);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (event.key === \"Enter\" && !invalid) {\n event.preventDefault();\n discard();\n }\n if (event.key === \"ArrowDown\" && !effectiveDisabled && !readOnly) {\n event.preventDefault();\n openerRef.current = event.currentTarget;\n setOpen(true);\n }\n }}\n />\n </FieldAffix>\n <Popover\n anchorRef={inputRef}\n anchorId={fieldId}\n isOpen={visible}\n placement={placement}\n panelRef={panelRef}\n id={panelId}\n role=\"dialog\"\n aria-label=\"Choose a colour\"\n // A click on the padding or a label focuses the dialog rather than the page,\n // so the field's own Escape handler still runs before an enclosing Modal's.\n tabIndex={-1}\n className=\"ds-colour-field__popover\"\n >\n <ColourPanelContent\n colour={colour}\n current={hex}\n presets={presets}\n showPresets={showPresets}\n picker={picker}\n onColourChange={(next) => {\n discard();\n commit(next);\n }}\n />\n </Popover>\n </div>\n );\n});\n"],"mappings":"A,07BAGAA,EAAAA,EAAAA,OAAAA,CAAO,CAACC,EAAAA,OAAW,CAAC,EASpB,IAAMwD,EAAsB,CAAE,EAAG,EAAG,EAAG,IAAK,EAAG,EAAG,EAAG,CAAE,EAEvD,SAAgBC,EAAY,EAAe,CACzC,IAAMC,EAAOC,EAAM,KAAK,EACxB,GAAI,CAACD,EACH,OAAO,KAET,IAAME,EAAMF,EAAK,QAAQ,KAAM,EAAE,EAG3BG,EAASD,EAAI,OAAS,EAAI,CAAC,GAAGA,CAAG,CAAC,CAAC,IAAK,GAAUE,EAAQA,CAAK,CAAC,CAAC,KAAK,EAAE,EAAIF,EAC5EG,EAAS,4CAA4C,KAAKH,CAAG,GAAA,EAC/DN,EAAA,OAAA,CAAO,CACL,EAAG,SAASO,EAAO,MAAM,EAAG,CAAC,EAAG,EAAE,EAClC,EAAG,SAASA,EAAO,MAAM,EAAG,CAAC,EAAG,EAAE,EAClC,EAAG,SAASA,EAAO,MAAM,EAAG,CAAC,EAAG,EAAE,EAClC,EAAGA,EAAO,SAAW,EAAI,SAASA,EAAO,MAAM,CAAC,EAAG,EAAE,EAAI,IAAM,CACjE,CAAC,GAAA,EACDP,EAAA,OAAA,CAAOI,CAAI,EACf,OAAOK,EAAO,QAAQ,EAAIA,EAAS,IACrC,CAEA,SAAgBC,EAAU,EAAgB,CACxC,OAAA,EAAOV,EAAA,OAAA,CAAOS,CAAM,CAAC,CAAC,MAAM,CAAC,CAAC,YAAY,CAC5C,CAEA,SAAgBE,EAAgB,EAAe,CAC7C,OAAOR,EAAYE,CAAK,CAAC,EAAE,MAAM,CAAC,CAAC,YAAY,GAAK,EACtD,CAGA,SAAgBO,EAAY,EAAe,EAAWV,EAAqB,CACzE,IAAMW,EAASV,EAAYE,CAAK,EAChC,GAAI,CAACQ,GAAUA,EAAO,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