@j2-health/design-system 0.6.9 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/index.cjs +2 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +2 -1
  4. package/dist/index2.js +2 -1
  5. package/dist/src/components/checkboxTree/CheckboxTree.cjs +1 -1
  6. package/dist/src/components/checkboxTree/CheckboxTree.js +1 -1
  7. package/dist/src/components/filterform/FilterGroup.cjs +1 -1
  8. package/dist/src/components/filterform/FilterGroup.js +1 -1
  9. package/dist/src/components/filterform/FilterInput.cjs +1 -1
  10. package/dist/src/components/filterform/FilterInput.js +1 -1
  11. package/dist/src/components/form/FormItem.cjs +1 -1
  12. package/dist/src/components/form/FormItem.js +1 -1
  13. package/dist/src/components/input/AntdInput.d.ts +5 -8
  14. package/dist/src/components/input/AntdSearchInput.d.ts +5 -8
  15. package/dist/src/components/input/AntdTextArea.d.ts +4 -7
  16. package/dist/src/components/legacyNavMenu/LegacyNavMenu.cjs +1 -1
  17. package/dist/src/components/legacyNavMenu/LegacyNavMenu.js +1 -1
  18. package/dist/src/components/listpopover/ListPopover.cjs +1 -1
  19. package/dist/src/components/listpopover/ListPopover.js +1 -1
  20. package/dist/src/components/navMenu/NavMenu.cjs +2 -2
  21. package/dist/src/components/navMenu/NavMenu.js +2 -2
  22. package/dist/src/components/swatchPicker/SwatchPicker.cjs +174 -0
  23. package/dist/src/components/swatchPicker/SwatchPicker.cjs.map +1 -0
  24. package/dist/src/components/swatchPicker/SwatchPicker.d.ts +44 -0
  25. package/dist/src/components/swatchPicker/SwatchPicker.js +171 -0
  26. package/dist/src/components/swatchPicker/SwatchPicker.js.map +1 -0
  27. package/dist/src/components/swatchPicker/index.d.ts +1 -0
  28. package/dist/src/components/swatchStrip/SwatchStrip.cjs +1 -1
  29. package/dist/src/components/swatchStrip/SwatchStrip.js +1 -1
  30. package/dist/src/components/table/Table.cjs +1 -1
  31. package/dist/src/components/table/Table.js +1 -1
  32. package/package.json +16 -16
package/dist/index.cjs CHANGED
@@ -58,6 +58,7 @@ const require_StatusPill = require("./src/components/statusPill/StatusPill.cjs")
58
58
  const require_useSteps = require("./src/components/steps/useSteps.cjs");
59
59
  const require_Steps = require("./src/components/steps/Steps.cjs");
60
60
  const require_StepDrawer = require("./src/components/stepDrawer/StepDrawer.cjs");
61
+ const require_SwatchPicker = require("./src/components/swatchPicker/SwatchPicker.cjs");
61
62
  const require_SwatchStrip = require("./src/components/swatchStrip/SwatchStrip.cjs");
62
63
  const require_Switch = require("./src/components/switch/Switch.cjs");
63
64
  const require_Table = require("./src/components/table/Table.cjs");
@@ -126,6 +127,7 @@ exports.StepDrawer = require_StepDrawer.StepDrawer;
126
127
  exports.Steps = require_Steps.Steps;
127
128
  exports.SummarizedSelect = require_SummarizedSelect.SummarizedSelect;
128
129
  exports.Swatch = require_Swatch.Swatch;
130
+ exports.SwatchPicker = require_SwatchPicker.SwatchPicker;
129
131
  exports.SwatchStrip = require_SwatchStrip.SwatchStrip;
130
132
  exports.Switch = require_Switch.Switch;
131
133
  exports.Table = require_Table.Table;
package/dist/index.d.ts CHANGED
@@ -44,6 +44,7 @@ export * from './src/components/statusPill/index.js';
44
44
  export * from './src/components/stepDrawer/index.js';
45
45
  export * from './src/components/steps/index.js';
46
46
  export * from './src/components/swatch/index.js';
47
+ export * from './src/components/swatchPicker/index.js';
47
48
  export * from './src/components/swatchStrip/index.js';
48
49
  export * from './src/components/switch/index.js';
49
50
  export * from './src/components/table/index.js';
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ import { StatusPill } from "./src/components/statusPill/StatusPill.js";
57
57
  import { useSteps } from "./src/components/steps/useSteps.js";
58
58
  import { Steps } from "./src/components/steps/Steps.js";
59
59
  import { StepDrawer, useStepDrawerSlots } from "./src/components/stepDrawer/StepDrawer.js";
60
+ import { SwatchPicker } from "./src/components/swatchPicker/SwatchPicker.js";
60
61
  import { SwatchStrip } from "./src/components/swatchStrip/SwatchStrip.js";
61
62
  import { Switch } from "./src/components/switch/Switch.js";
62
63
  import { Table } from "./src/components/table/Table.js";
@@ -66,4 +67,4 @@ import { VennDiagram } from "./src/components/vennDiagram/VennDiagram.js";
66
67
  import { UserProfile } from "./src/components/legacyNavMenu/UserProfile.js";
67
68
  import { LegacyNavMenu } from "./src/components/legacyNavMenu/LegacyNavMenu.js";
68
69
  import { icons } from "./index2.js";
69
- export { Alert, AntdInput, AntdSearchInput, AntdSelect, AntdTextArea, AppConfigProvider, BarChart, BareButton, Breadcrumb, BulkActionBar, Button, Callout, Card, ChangeChip, Checkbox, CheckboxTree, Collapse, Drawer, Dropdown, EmptyState, FileDropzone, FiltersForm, Form, HighchartsReact, Input, InputNumber, LegacyNavMenu, ListPopover, ListRow, ManageColumnsPanel, Menu, Modal, MultiValueTextOperatorOptions, NavMenu, NotificationModal, Pagination, Popover, Progress, Radio, RadioCardGroup, RadioGroup, Rate, Select, SelectAll, Skeleton, Slider, Spinner, StatusPill, StepDrawer, Steps, SummarizedSelect, Swatch, SwatchStrip, Switch, Table, Tabs, Tag, ThresholdBar, Tooltip, UserProfile, VennDiagram, appTheme, icons, isMultiValueTextOperator, mergeProps, normalizeMultiValues, operatorOptionsFor, tailwindPreset, useMessage, useNotification, useStepDrawerSlots, useSteps, withDesignSystemPaginationOverrides };
70
+ export { Alert, AntdInput, AntdSearchInput, AntdSelect, AntdTextArea, AppConfigProvider, BarChart, BareButton, Breadcrumb, BulkActionBar, Button, Callout, Card, ChangeChip, Checkbox, CheckboxTree, Collapse, Drawer, Dropdown, EmptyState, FileDropzone, FiltersForm, Form, HighchartsReact, Input, InputNumber, LegacyNavMenu, ListPopover, ListRow, ManageColumnsPanel, Menu, Modal, MultiValueTextOperatorOptions, NavMenu, NotificationModal, Pagination, Popover, Progress, Radio, RadioCardGroup, RadioGroup, Rate, Select, SelectAll, Skeleton, Slider, Spinner, StatusPill, StepDrawer, Steps, SummarizedSelect, Swatch, SwatchPicker, SwatchStrip, Switch, Table, Tabs, Tag, ThresholdBar, Tooltip, UserProfile, VennDiagram, appTheme, icons, isMultiValueTextOperator, mergeProps, normalizeMultiValues, operatorOptionsFor, tailwindPreset, useMessage, useNotification, useStepDrawerSlots, useSteps, withDesignSystemPaginationOverrides };
package/dist/index2.js CHANGED
@@ -57,6 +57,7 @@ import { StatusPill } from "./src/components/statusPill/StatusPill.js";
57
57
  import { useSteps } from "./src/components/steps/useSteps.js";
58
58
  import { Steps } from "./src/components/steps/Steps.js";
59
59
  import { StepDrawer, useStepDrawerSlots } from "./src/components/stepDrawer/StepDrawer.js";
60
+ import { SwatchPicker } from "./src/components/swatchPicker/SwatchPicker.js";
60
61
  import { SwatchStrip } from "./src/components/swatchStrip/SwatchStrip.js";
61
62
  import { Switch } from "./src/components/switch/Switch.js";
62
63
  import { Table } from "./src/components/table/Table.js";
@@ -66,4 +67,4 @@ import { VennDiagram } from "./src/components/vennDiagram/VennDiagram.js";
66
67
  import { UserProfile } from "./src/components/legacyNavMenu/UserProfile.js";
67
68
  import { LegacyNavMenu } from "./src/components/legacyNavMenu/LegacyNavMenu.js";
68
69
  import * as icons from "@phosphor-icons/react";
69
- export { Alert, AntdInput, AntdSearchInput, AntdSelect, AntdTextArea, AppConfigProvider, BarChart, BareButton, Breadcrumb, BulkActionBar, Button, Callout, Card, ChangeChip, Checkbox, CheckboxTree, Collapse, Drawer, Dropdown, EmptyState, FileDropzone, FiltersForm, Form, HighchartsReact, Input, InputNumber, LegacyNavMenu, ListPopover, ListRow, ManageColumnsPanel, Menu, Modal, MultiValueTextOperatorOptions, NavMenu, NotificationModal, Pagination, Popover, Progress, Radio, RadioCardGroup, RadioGroup, Rate, Select, SelectAll, Skeleton, Slider, Spinner, StatusPill, StepDrawer, Steps, SummarizedSelect, Swatch, SwatchStrip, Switch, Table, Tabs, Tag, ThresholdBar, Tooltip, UserProfile, VennDiagram, appTheme, icons, isMultiValueTextOperator, mergeProps, normalizeMultiValues, operatorOptionsFor, tailwindPreset, useMessage, useNotification, useStepDrawerSlots, useSteps, withDesignSystemPaginationOverrides };
70
+ export { Alert, AntdInput, AntdSearchInput, AntdSelect, AntdTextArea, AppConfigProvider, BarChart, BareButton, Breadcrumb, BulkActionBar, Button, Callout, Card, ChangeChip, Checkbox, CheckboxTree, Collapse, Drawer, Dropdown, EmptyState, FileDropzone, FiltersForm, Form, HighchartsReact, Input, InputNumber, LegacyNavMenu, ListPopover, ListRow, ManageColumnsPanel, Menu, Modal, MultiValueTextOperatorOptions, NavMenu, NotificationModal, Pagination, Popover, Progress, Radio, RadioCardGroup, RadioGroup, Rate, Select, SelectAll, Skeleton, Slider, Spinner, StatusPill, StepDrawer, Steps, SummarizedSelect, Swatch, SwatchPicker, SwatchStrip, Switch, Table, Tabs, Tag, ThresholdBar, Tooltip, UserProfile, VennDiagram, appTheme, icons, isMultiValueTextOperator, mergeProps, normalizeMultiValues, operatorOptionsFor, tailwindPreset, useMessage, useNotification, useStepDrawerSlots, useSteps, withDesignSystemPaginationOverrides };
@@ -1,6 +1,6 @@
1
1
  const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
- const require_utils = require("./utils.cjs");
3
2
  const require_TreeNode = require("./TreeNode.cjs");
3
+ const require_utils = require("./utils.cjs");
4
4
  let react = require("react");
5
5
  react = require_runtime.__toESM(react, 1);
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -1,5 +1,5 @@
1
- import { getAllLeafKeys, getAllParentKeys, getLeafKeys } from "./utils.js";
2
1
  import { TreeNode } from "./TreeNode.js";
2
+ import { getAllLeafKeys, getAllParentKeys, getLeafKeys } from "./utils.js";
3
3
  import { useCallback, useEffect, useMemo, useState } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  // src/components/checkboxTree/CheckboxTree.tsx
@@ -1,7 +1,7 @@
1
1
  const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
2
  const require_Button = require("../button/Button.cjs");
3
- const require_FiltersForm_module = require("./FiltersForm.module.css.cjs");
4
3
  const require_FilterInput = require("./FilterInput.cjs");
4
+ const require_FiltersForm_module = require("./FiltersForm.module.css.cjs");
5
5
  let _phosphor_icons_react = require("@phosphor-icons/react");
6
6
  _phosphor_icons_react = require_runtime.__toESM(_phosphor_icons_react, 1);
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -1,6 +1,6 @@
1
1
  import { Button } from "../button/Button.js";
2
- import FiltersForm_module_default from "./FiltersForm.module.css.js";
3
2
  import { FilterInput } from "./FilterInput.js";
3
+ import FiltersForm_module_default from "./FiltersForm.module.css.js";
4
4
  import { TrashIcon } from "@phosphor-icons/react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import cx from "classnames";
@@ -1,6 +1,6 @@
1
1
  const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
- const require_filterHelpers = require("./filterHelpers.cjs");
3
2
  const require_useFilterField = require("./useFilterField.cjs");
3
+ const require_filterHelpers = require("./filterHelpers.cjs");
4
4
  let react = require("react");
5
5
  let react$1 = require_runtime.__toESM(react, 1);
6
6
  react = require_runtime.__toESM(react);
@@ -1,5 +1,5 @@
1
- import { normalizeMultiValues, tooManyValuesMessage } from "./filterHelpers.js";
2
1
  import { useFilterField } from "./useFilterField.js";
2
+ import { normalizeMultiValues, tooManyValuesMessage } from "./filterHelpers.js";
3
3
  import * as React from "react";
4
4
  import { Input, InputNumber, Select, Typography } from "antd";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
- const require_FormItemFieldContext = require("./FormItemFieldContext.cjs");
2
1
  const require_FormikField = require("./FormikField.cjs");
2
+ const require_FormItemFieldContext = require("./FormItemFieldContext.cjs");
3
3
  let antd = require("antd");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
  let formik = require("formik");
@@ -1,5 +1,5 @@
1
- import { FormItemFieldContext } from "./FormItemFieldContext.js";
2
1
  import { FormikField } from "./FormikField.js";
2
+ import { FormItemFieldContext } from "./FormItemFieldContext.js";
3
3
  import { Form } from "antd";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  import { getIn, useFormikContext } from "formik";
@@ -61,7 +61,7 @@ export declare const AntdInput: import('react').ForwardRefExoticComponent<{
61
61
  name?: string | undefined | undefined;
62
62
  nonce?: string | undefined | undefined;
63
63
  part?: string | undefined | undefined;
64
- type?: import('@rc-component/input/lib/utils/types').LiteralUnion<"button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week", string> | undefined;
64
+ type?: import('@rc-component/input/es/utils/types').LiteralUnion<"button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week", string> | undefined;
65
65
  width?: number | string | undefined | undefined;
66
66
  role?: import('react').AriaRole | undefined;
67
67
  tabIndex?: number | undefined | undefined;
@@ -289,7 +289,7 @@ export declare const AntdInput: import('react').ForwardRefExoticComponent<{
289
289
  onTransitionRunCapture?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
290
290
  onTransitionStart?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
291
291
  onTransitionStartCapture?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
292
- value?: import('@rc-component/input/lib/interface').ValueType;
292
+ value?: import('@rc-component/input/es/interface').ValueType;
293
293
  prefixCls?: string | undefined;
294
294
  list?: string | undefined | undefined;
295
295
  step?: number | string | undefined | undefined;
@@ -342,7 +342,7 @@ export declare const AntdInput: import('react').ForwardRefExoticComponent<{
342
342
  is?: string | undefined | undefined;
343
343
  exportparts?: string | undefined | undefined;
344
344
  multiple?: boolean | undefined | undefined;
345
- count?: import('@rc-component/input/lib/interface').CountConfig | undefined;
345
+ count?: import('@rc-component/input/es/interface').CountConfig | undefined;
346
346
  placeholder?: string | undefined | undefined;
347
347
  checked?: boolean | undefined | undefined;
348
348
  required?: boolean | undefined | undefined;
@@ -355,14 +355,11 @@ export declare const AntdInput: import('react').ForwardRefExoticComponent<{
355
355
  src?: string | undefined | undefined;
356
356
  readOnly?: boolean | undefined | undefined;
357
357
  onClear?: (() => void) | undefined;
358
- allowClear?: boolean | {
359
- disabled?: boolean;
360
- clearIcon?: import('react').ReactNode;
361
- } | undefined;
358
+ allowClear?: (boolean | import('@rc-component/util').AllowClearConfig) | undefined;
362
359
  suffix?: import('react').ReactNode;
363
360
  onPressEnter?: import('react').KeyboardEventHandler<HTMLInputElement> | undefined;
364
361
  showCount?: boolean | {
365
- formatter: import('@rc-component/input/lib/interface').ShowCountFormatter;
362
+ formatter: import('@rc-component/input/es/interface').ShowCountFormatter;
366
363
  } | undefined;
367
364
  htmlSize?: number | undefined;
368
365
  } & import('react').RefAttributes<InputRef>>;
@@ -73,7 +73,7 @@ export declare const AntdSearchInput: import('react').ForwardRefExoticComponent<
73
73
  name?: string | undefined | undefined;
74
74
  nonce?: string | undefined | undefined;
75
75
  part?: string | undefined | undefined;
76
- type?: import('@rc-component/input/lib/utils/types').LiteralUnion<"button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week", string> | undefined;
76
+ type?: import('@rc-component/input/es/utils/types').LiteralUnion<"button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week", string> | undefined;
77
77
  width?: number | string | undefined | undefined;
78
78
  role?: import('react').AriaRole | undefined;
79
79
  tabIndex?: number | undefined | undefined;
@@ -301,7 +301,7 @@ export declare const AntdSearchInput: import('react').ForwardRefExoticComponent<
301
301
  onTransitionRunCapture?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
302
302
  onTransitionStart?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
303
303
  onTransitionStartCapture?: import('react').TransitionEventHandler<HTMLInputElement> | undefined;
304
- value?: import('@rc-component/input/lib/interface').ValueType;
304
+ value?: import('@rc-component/input/es/interface').ValueType;
305
305
  prefixCls?: string | undefined;
306
306
  list?: string | undefined | undefined;
307
307
  step?: number | string | undefined | undefined;
@@ -354,7 +354,7 @@ export declare const AntdSearchInput: import('react').ForwardRefExoticComponent<
354
354
  is?: string | undefined | undefined;
355
355
  exportparts?: string | undefined | undefined;
356
356
  multiple?: boolean | undefined | undefined;
357
- count?: import('@rc-component/input/lib/interface').CountConfig | undefined;
357
+ count?: import('@rc-component/input/es/interface').CountConfig | undefined;
358
358
  placeholder?: string | undefined | undefined;
359
359
  checked?: boolean | undefined | undefined;
360
360
  required?: boolean | undefined | undefined;
@@ -367,13 +367,10 @@ export declare const AntdSearchInput: import('react').ForwardRefExoticComponent<
367
367
  src?: string | undefined | undefined;
368
368
  readOnly?: boolean | undefined | undefined;
369
369
  onClear?: (() => void) | undefined;
370
- allowClear?: boolean | {
371
- disabled?: boolean;
372
- clearIcon?: import('react').ReactNode;
373
- } | undefined;
370
+ allowClear?: (boolean | import('@rc-component/util').AllowClearConfig) | undefined;
374
371
  suffix?: import('react').ReactNode;
375
372
  showCount?: boolean | {
376
- formatter: import('@rc-component/input/lib/interface').ShowCountFormatter;
373
+ formatter: import('@rc-component/input/es/interface').ShowCountFormatter;
377
374
  } | undefined;
378
375
  htmlSize?: number | undefined;
379
376
  } & import('react').RefAttributes<InputRef>>;
@@ -273,7 +273,7 @@ export declare const AntdTextArea: import('react').ForwardRefExoticComponent<{
273
273
  onTransitionRunCapture?: import('react').TransitionEventHandler<HTMLTextAreaElement> | undefined;
274
274
  onTransitionStart?: import('react').TransitionEventHandler<HTMLTextAreaElement> | undefined;
275
275
  onTransitionStartCapture?: import('react').TransitionEventHandler<HTMLTextAreaElement> | undefined;
276
- value?: import('@rc-component/input/lib/interface').ValueOrTextAreaValue;
276
+ value?: import('@rc-component/input/es/interface').ValueOrTextAreaValue;
277
277
  prefixCls?: string | undefined;
278
278
  disabled?: boolean | undefined | undefined;
279
279
  defaultChecked?: boolean | undefined | undefined;
@@ -321,7 +321,7 @@ export declare const AntdTextArea: import('react').ForwardRefExoticComponent<{
321
321
  exportparts?: string | undefined | undefined;
322
322
  wrap?: string | undefined | undefined;
323
323
  rows?: number | undefined | undefined;
324
- count?: import('@rc-component/input/lib/interface').CountConfig | undefined;
324
+ count?: import('@rc-component/input/es/interface').CountConfig | undefined;
325
325
  placeholder?: string | undefined | undefined;
326
326
  required?: boolean | undefined | undefined;
327
327
  autoComplete?: string | undefined | undefined;
@@ -331,13 +331,10 @@ export declare const AntdTextArea: import('react').ForwardRefExoticComponent<{
331
331
  minLength?: number | undefined | undefined;
332
332
  readOnly?: boolean | undefined | undefined;
333
333
  onClear?: (() => void) | undefined;
334
- allowClear?: boolean | {
335
- disabled?: boolean;
336
- clearIcon?: import('react').ReactNode;
337
- } | undefined;
334
+ allowClear?: (boolean | import('@rc-component/util').AllowClearConfig) | undefined;
338
335
  onPressEnter?: import('react').KeyboardEventHandler<HTMLTextAreaElement> | undefined;
339
336
  showCount?: boolean | {
340
- formatter: import('@rc-component/input/lib/interface').ShowCountFormatter;
337
+ formatter: import('@rc-component/input/es/interface').ShowCountFormatter;
341
338
  } | undefined;
342
339
  onResize?: ((size: {
343
340
  width: number;
@@ -1,6 +1,6 @@
1
1
  const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
- const require_j2_logo_menu_collapse = require("../../svgs/j2-logo-menu-collapse.svg.cjs");
3
2
  const require_LegacyNavMenu_module = require("./LegacyNavMenu.module.css.cjs");
3
+ const require_j2_logo_menu_collapse = require("../../svgs/j2-logo-menu-collapse.svg.cjs");
4
4
  const require_UserProfile = require("./UserProfile.cjs");
5
5
  let react = require("react");
6
6
  react = require_runtime.__toESM(react, 1);
@@ -1,5 +1,5 @@
1
- import SvgJ2LogoMenuCollapse from "../../svgs/j2-logo-menu-collapse.svg.js";
2
1
  import LegacyNavMenu_module_default from "./LegacyNavMenu.module.css.js";
2
+ import SvgJ2LogoMenuCollapse from "../../svgs/j2-logo-menu-collapse.svg.js";
3
3
  import { UserProfile } from "./UserProfile.js";
4
4
  import "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
- const require_Button = require("../button/Button.cjs");
3
2
  const require_Popover = require("../popover/Popover.cjs");
3
+ const require_Button = require("../button/Button.cjs");
4
4
  const require_Tooltip = require("../tooltip/Tooltip.cjs");
5
5
  const require_ListPopover_module = require("./ListPopover.module.css.cjs");
6
6
  let _phosphor_icons_react = require("@phosphor-icons/react");
@@ -1,5 +1,5 @@
1
- import { Button } from "../button/Button.js";
2
1
  import { Popover } from "../popover/Popover.js";
2
+ import { Button } from "../button/Button.js";
3
3
  import { Tooltip } from "../tooltip/Tooltip.js";
4
4
  import ListPopover_module_default from "./ListPopover.module.css.js";
5
5
  import { CopyIcon } from "@phosphor-icons/react";
@@ -1,12 +1,12 @@
1
1
  const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
- const require_Button = require("../button/Button.cjs");
3
- const require_Tooltip = require("../tooltip/Tooltip.cjs");
4
2
  const require_Menu = require("../menu/Menu.cjs");
5
3
  const require_j2_logo_menu_collapse = require("../../svgs/j2-logo-menu-collapse.svg.cjs");
6
4
  const require_j2_logo_menu = require("../../svgs/j2-logo-menu.svg.cjs");
7
5
  const require_menu_sidebar_expand = require("../../svgs/menu-sidebar-expand.svg.cjs");
8
6
  const require_menu_sidebar_collapse = require("../../svgs/menu-sidebar-collapse.svg.cjs");
7
+ const require_Button = require("../button/Button.cjs");
9
8
  const require_NavMenu_module = require("./NavMenu.module.css.cjs");
9
+ const require_Tooltip = require("../tooltip/Tooltip.cjs");
10
10
  let react = require("react");
11
11
  let react$1 = require_runtime.__toESM(react, 1);
12
12
  react = require_runtime.__toESM(react);
@@ -1,11 +1,11 @@
1
- import { Button } from "../button/Button.js";
2
- import { Tooltip } from "../tooltip/Tooltip.js";
3
1
  import { Menu } from "../menu/Menu.js";
4
2
  import SvgJ2LogoMenuCollapse from "../../svgs/j2-logo-menu-collapse.svg.js";
5
3
  import SvgJ2LogoMenu from "../../svgs/j2-logo-menu.svg.js";
6
4
  import SvgMenuSidebarExpand from "../../svgs/menu-sidebar-expand.svg.js";
7
5
  import SvgMenuSidebarCollapse from "../../svgs/menu-sidebar-collapse.svg.js";
6
+ import { Button } from "../button/Button.js";
8
7
  import NavMenu_module_default from "./NavMenu.module.css.js";
8
+ import { Tooltip } from "../tooltip/Tooltip.js";
9
9
  import * as React from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import cx from "classnames";
@@ -0,0 +1,174 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_Button = require("../button/Button.cjs");
3
+ const require_Popover = require("../popover/Popover.cjs");
4
+ const require_Swatch = require("../swatch/Swatch.cjs");
5
+ let react = require("react");
6
+ let _phosphor_icons_react = require("@phosphor-icons/react");
7
+ _phosphor_icons_react = require_runtime.__toESM(_phosphor_icons_react, 1);
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ let classnames = require("classnames");
10
+ classnames = require_runtime.__toESM(classnames, 1);
11
+ // src/components/swatchPicker/SwatchPicker.tsx
12
+ var COLUMNS = 8;
13
+ var RADIUS = 2;
14
+ var CENTERED = {
15
+ display: "flex",
16
+ alignItems: "center",
17
+ justifyContent: "center"
18
+ };
19
+ var STEPS = {
20
+ ArrowRight: 1,
21
+ ArrowLeft: -1,
22
+ ArrowDown: COLUMNS,
23
+ ArrowUp: -8
24
+ };
25
+ var modalOrPage = (trigger) => trigger.closest(".ant-modal-container") ?? document.body;
26
+ var channels = (painted) => {
27
+ const numbers = painted.match(/[\d.]+/g)?.map(Number);
28
+ if (!numbers || numbers.length < 3) return null;
29
+ const scale = painted.startsWith("color(") ? 255 : 1;
30
+ return numbers.slice(0, 3).map((n) => n * scale);
31
+ };
32
+ var isDark = (painted) => {
33
+ const rgb = channels(painted);
34
+ return rgb ? (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3 < 140 : true;
35
+ };
36
+ var Check = () => {
37
+ const ref = (0, react.useRef)(null);
38
+ const [dark, setDark] = (0, react.useState)(true);
39
+ (0, react.useLayoutEffect)(() => {
40
+ const swatch = ref.current?.parentElement;
41
+ if (swatch) setDark(isDark(getComputedStyle(swatch).backgroundColor));
42
+ }, []);
43
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
44
+ ref,
45
+ className: "flex",
46
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_phosphor_icons_react.CheckIcon, {
47
+ size: 12,
48
+ weight: "bold",
49
+ color: "currentColor",
50
+ className: (0, classnames.default)("block", dark ? "text-white" : "text-j2-text")
51
+ })
52
+ });
53
+ };
54
+ var SwatchGrid = ({ colors, value, defaultValue, label, onPick, gridRef, size }) => {
55
+ const [focusIndex, setFocusIndex] = (0, react.useState)(() => Math.max(0, colors.findIndex((c) => c.value === value)));
56
+ const swatches = (0, react.useRef)([]);
57
+ const onKeyDown = (event) => {
58
+ const step = STEPS[event.key];
59
+ if (step === void 0) return;
60
+ event.preventDefault();
61
+ const next = focusIndex + step;
62
+ if (next < 0 || next >= colors.length) return;
63
+ setFocusIndex(next);
64
+ swatches.current[next]?.focus();
65
+ };
66
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
67
+ className: "flex flex-col gap-2",
68
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
69
+ ref: gridRef,
70
+ role: "radiogroup",
71
+ "aria-label": `Color for ${label}`,
72
+ className: "grid w-fit grid-cols-8 gap-1",
73
+ onKeyDown,
74
+ children: colors.map((c, index) => {
75
+ const selected = c.value === value;
76
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
77
+ ref: (node) => {
78
+ swatches.current[index] = node;
79
+ },
80
+ type: "button",
81
+ role: "radio",
82
+ "aria-checked": selected,
83
+ "aria-label": c.label ?? c.value,
84
+ tabIndex: index === focusIndex ? 0 : -1,
85
+ onClick: () => {
86
+ setFocusIndex(index);
87
+ onPick(c.value);
88
+ },
89
+ className: "flex cursor-pointer rounded-j2-xs border-0 bg-transparent p-0",
90
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Swatch.Swatch, {
91
+ color: c.color ?? c.value,
92
+ size,
93
+ radius: RADIUS,
94
+ style: CENTERED,
95
+ children: selected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Check, {})
96
+ })
97
+ }, c.value);
98
+ })
99
+ }), defaultValue !== void 0 && value !== defaultValue && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
100
+ type: "link",
101
+ size: "small",
102
+ className: "self-start !px-0",
103
+ onClick: () => onPick(defaultValue),
104
+ children: "Reset to default"
105
+ })]
106
+ });
107
+ };
108
+ /**
109
+ * Pick one color from a fixed set, in a popover or inline. A grid rather than
110
+ * a free color input, so two items can't end up on colors that are hard to
111
+ * tell apart. The popover opens on the current color and closes on a pick.
112
+ */
113
+ var SwatchPicker = ({ colors, value, label, onChange, defaultValue, variant = "popover", children, placement = "rightTop", getPopupContainer = modalOrPage, onOpenChange }) => {
114
+ const [open, setOpenState] = (0, react.useState)(false);
115
+ const setOpen = (next) => {
116
+ setOpenState(next);
117
+ onOpenChange?.(next);
118
+ };
119
+ const gridRef = (0, react.useRef)(null);
120
+ const triggerRef = (0, react.useRef)(null);
121
+ (0, react.useEffect)(() => {
122
+ if (!open) return;
123
+ const frame = requestAnimationFrame(() => gridRef.current?.querySelector("[tabindex=\"0\"]")?.focus());
124
+ return () => cancelAnimationFrame(frame);
125
+ }, [open]);
126
+ const close = () => {
127
+ setOpen(false);
128
+ triggerRef.current?.querySelector("button, [tabindex]")?.focus();
129
+ };
130
+ if (variant === "inline") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SwatchGrid, {
131
+ colors,
132
+ value,
133
+ defaultValue,
134
+ label,
135
+ onPick: onChange,
136
+ size: 20
137
+ });
138
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Popover.Popover, {
139
+ trigger: "click",
140
+ placement,
141
+ open,
142
+ onOpenChange: setOpen,
143
+ getPopupContainer,
144
+ destroyOnHidden: true,
145
+ paddingSize: "xs",
146
+ content: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
147
+ onKeyDown: (event) => {
148
+ if (event.key !== "Escape") return;
149
+ event.stopPropagation();
150
+ close();
151
+ },
152
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SwatchGrid, {
153
+ colors,
154
+ value,
155
+ defaultValue,
156
+ label,
157
+ gridRef,
158
+ size: 24,
159
+ onPick: (next) => {
160
+ onChange(next);
161
+ close();
162
+ }
163
+ })
164
+ }),
165
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
166
+ ref: triggerRef,
167
+ className: "inline-flex",
168
+ children
169
+ })
170
+ });
171
+ };
172
+ exports.SwatchPicker = SwatchPicker;
173
+
174
+ //# sourceMappingURL=SwatchPicker.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwatchPicker.cjs","names":["useRef","useState","CheckIcon","cx","Swatch","Button","Popover"],"sources":["../../../../src/components/swatchPicker/SwatchPicker.tsx"],"sourcesContent":["import {\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\nimport { CheckIcon } from '@phosphor-icons/react'\nimport cx from 'classnames'\nimport { Button } from '../button'\nimport { Popover, type PopoverProps } from '../popover'\nimport { Swatch } from '../swatch'\n\nexport type SwatchPickerColor = {\n /** What `onChange` reports: a token name, a hex, any id. */\n value: string\n /** Any CSS color. Defaults to `value`. */\n color?: string\n /** The swatch's accessible name. Defaults to `value`. */\n label?: string\n}\n\nexport type SwatchPickerProps = {\n /** The colors offered, in order. */\n colors: SwatchPickerColor[]\n /** The current color's `value`. */\n value: string\n /** What is being colored, for the grid's name: \"Color for {label}\". */\n label: string\n onChange: (value: string) => void\n /** The starting color. \"Reset to default\" shows once `value` differs from it. */\n defaultValue?: string\n /**\n * - `'popover'`: the grid opens from `children` and closes on a pick.\n * - `'inline'`: the grid in place, with no control or popover, and smaller\n * swatches (20px, against 24px in the popover).\n */\n variant?: 'popover' | 'inline'\n /** The control that opens the popover. Not used inline. */\n children?: ReactNode\n /** The popover's placement. */\n placement?: PopoverProps['placement']\n /** Where the popover renders. Defaults to the enclosing modal, or the page when there is none. */\n getPopupContainer?: PopoverProps['getPopupContainer']\n /**\n * Called when the popover opens or closes, e.g. to keep a panel around it\n * open meanwhile. Not used inline.\n */\n onOpenChange?: (open: boolean) => void\n}\n\nconst COLUMNS = 8\n\n// The maps picker's corners (2px); Swatch's default is 4px.\nconst RADIUS = 2\n\n// Centers the check on its swatch.\nconst CENTERED = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n} as const\n\n// Arrow keys move through the grid; each is the step in swatches.\nconst STEPS: Record<string, number> = {\n ArrowRight: 1,\n ArrowLeft: -1,\n ArrowDown: COLUMNS,\n ArrowUp: -COLUMNS,\n}\n\n// Inside a modal the popover renders in the modal's container. A popover on\n// the page body can't take focus, since the modal pulls it back, and the\n// modal's outer box ignores the pointer, so only its container takes clicks.\nconst modalOrPage = (trigger: HTMLElement) =>\n trigger.closest<HTMLElement>('.ant-modal-container') ?? document.body\n\n// The first three channels of a painted color, 0 to 255. Browsers report\n// `rgb(…)` for most colors and `color(srgb …)`, 0 to 1, for color-mix results.\nconst channels = (painted: string) => {\n const numbers = painted.match(/[\\d.]+/g)?.map(Number)\n if (!numbers || numbers.length < 3) return null\n const scale = painted.startsWith('color(') ? 255 : 1\n return numbers.slice(0, 3).map((n) => n * scale)\n}\n\n// Whether a swatch needs a light check mark: Rec. 601 luma, which is enough\n// for a light-or-dark decision.\nconst isDark = (painted: string) => {\n const rgb = channels(painted)\n return rgb ? (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000 < 140 : true\n}\n\n// Colors may be CSS variables, so the check reads its swatch as painted.\nconst Check = () => {\n const ref = useRef<HTMLSpanElement>(null)\n const [dark, setDark] = useState(true)\n useLayoutEffect(() => {\n const swatch = ref.current?.parentElement\n if (swatch) setDark(isDark(getComputedStyle(swatch).backgroundColor))\n }, [])\n return (\n <span ref={ref} className=\"flex\">\n <CheckIcon\n size={12}\n weight=\"bold\"\n color=\"currentColor\"\n className={cx('block', dark ? 'text-white' : 'text-j2-text')}\n />\n </span>\n )\n}\n\n// The grid and its Reset link. Focus rests on one swatch at a time (roving\n// tabindex), so the grid is one Tab stop and the arrow keys move within it;\n// Enter or Space picks. It starts on the current color, or the first when\n// that isn't in the grid.\nconst SwatchGrid = ({\n colors,\n value,\n defaultValue,\n label,\n onPick,\n gridRef,\n size,\n}: {\n colors: SwatchPickerColor[]\n value: string\n defaultValue?: string\n label: string\n onPick: (value: string) => void\n gridRef?: RefObject<HTMLDivElement | null>\n /** Swatch side in px. */\n size: number\n}) => {\n const [focusIndex, setFocusIndex] = useState(() =>\n Math.max(\n 0,\n colors.findIndex((c) => c.value === value)\n )\n )\n const swatches = useRef<(HTMLButtonElement | null)[]>([])\n\n const onKeyDown = (event: KeyboardEvent) => {\n const step = STEPS[event.key]\n if (step === undefined) return\n event.preventDefault()\n const next = focusIndex + step\n if (next < 0 || next >= colors.length) return\n setFocusIndex(next)\n swatches.current[next]?.focus()\n }\n\n return (\n <div className=\"flex flex-col gap-2\">\n <div\n ref={gridRef}\n role=\"radiogroup\"\n aria-label={`Color for ${label}`}\n // Sized to its swatches: in a wider box the columns would stretch,\n // spreading the swatches and each button past its square.\n className=\"grid w-fit grid-cols-8 gap-1\"\n onKeyDown={onKeyDown}\n >\n {colors.map((c, index) => {\n const selected = c.value === value\n return (\n <button\n key={c.value}\n ref={(node) => {\n swatches.current[index] = node\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n aria-label={c.label ?? c.value}\n tabIndex={index === focusIndex ? 0 : -1}\n onClick={() => {\n // Inline the grid stays, so arrow keys go on from the pick.\n setFocusIndex(index)\n onPick(c.value)\n }}\n className=\"flex cursor-pointer rounded-j2-xs border-0 bg-transparent p-0\"\n >\n <Swatch\n color={c.color ?? c.value}\n size={size}\n radius={RADIUS}\n style={CENTERED}\n >\n {selected && <Check />}\n </Swatch>\n </button>\n )\n })}\n </div>\n {/* Only offered when it would change something. */}\n {defaultValue !== undefined && value !== defaultValue && (\n <Button\n type=\"link\"\n size=\"small\"\n className=\"self-start !px-0\"\n onClick={() => onPick(defaultValue)}\n >\n Reset to default\n </Button>\n )}\n </div>\n )\n}\n\n/**\n * Pick one color from a fixed set, in a popover or inline. A grid rather than\n * a free color input, so two items can't end up on colors that are hard to\n * tell apart. The popover opens on the current color and closes on a pick.\n */\nexport const SwatchPicker = ({\n colors,\n value,\n label,\n onChange,\n defaultValue,\n variant = 'popover',\n children,\n placement = 'rightTop',\n getPopupContainer = modalOrPage,\n onOpenChange,\n}: SwatchPickerProps) => {\n const [open, setOpenState] = useState(false)\n const setOpen = (next: boolean) => {\n setOpenState(next)\n onOpenChange?.(next)\n }\n const gridRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLSpanElement>(null)\n\n // Focus moves into the grid on open, onto the swatch that is its Tab stop:\n // a frame later, once the popover is in the page. (afterOpenChange waits\n // for the open animation.)\n useEffect(() => {\n if (!open) return\n const frame = requestAnimationFrame(() =>\n gridRef.current?.querySelector<HTMLElement>('[tabindex=\"0\"]')?.focus()\n )\n return () => cancelAnimationFrame(frame)\n }, [open])\n\n // A pick or Escape closes it and returns focus to the control that opened it.\n const close = () => {\n setOpen(false)\n triggerRef.current\n ?.querySelector<HTMLElement>('button, [tabindex]')\n ?.focus()\n }\n\n if (variant === 'inline') {\n return (\n <SwatchGrid\n colors={colors}\n value={value}\n defaultValue={defaultValue}\n label={label}\n onPick={onChange}\n size={20}\n />\n )\n }\n\n return (\n <Popover\n trigger=\"click\"\n placement={placement}\n open={open}\n onOpenChange={setOpen}\n getPopupContainer={getPopupContainer}\n destroyOnHidden\n paddingSize=\"xs\"\n content={\n <div\n onKeyDown={(event) => {\n // Only the picker closes, not a modal around it.\n if (event.key !== 'Escape') return\n event.stopPropagation()\n close()\n }}\n >\n <SwatchGrid\n colors={colors}\n value={value}\n defaultValue={defaultValue}\n label={label}\n gridRef={gridRef}\n size={24}\n onPick={(next) => {\n onChange(next)\n close()\n }}\n />\n </div>\n }\n >\n <span ref={triggerRef} className=\"inline-flex\">\n {children}\n </span>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;;;;AAqDA,IAAM,UAAU;AAGhB,IAAM,SAAS;AAGf,IAAM,WAAW;CACf,SAAS;CACT,YAAY;CACZ,gBAAgB;AAClB;AAGA,IAAM,QAAgC;CACpC,YAAY;CACZ,WAAW;CACX,WAAW;CACX,SAAS;AACX;AAKA,IAAM,eAAe,YACnB,QAAQ,QAAqB,sBAAsB,KAAK,SAAS;AAInE,IAAM,YAAY,YAAoB;CACpC,MAAM,UAAU,QAAQ,MAAM,SAAS,CAAC,EAAE,IAAI,MAAM;CACpD,IAAI,CAAC,WAAW,QAAQ,SAAS,GAAG,OAAO;CAC3C,MAAM,QAAQ,QAAQ,WAAW,QAAQ,IAAI,MAAM;CACnD,OAAO,QAAQ,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,KAAK;AACjD;AAIA,IAAM,UAAU,YAAoB;CAClC,MAAM,MAAM,SAAS,OAAO;CAC5B,OAAO,OAAO,IAAI,KAAK,MAAM,IAAI,KAAK,MAAM,IAAI,KAAK,OAAO,MAAO,MAAM;AAC3E;AAGA,IAAM,cAAc;CAClB,MAAM,OAAA,GAAMA,MAAAA,OAAAA,CAAwB,IAAI;CACxC,MAAM,CAAC,MAAM,YAAA,GAAWC,MAAAA,SAAAA,CAAS,IAAI;CACr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AY,UACd,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;EACU;EACD;EACO;EACP;EACP,QAAQ;EACR,MAAM;CACP,CAAA;CAIL,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACM,gBAAAA,SAAD;EACE,SAAQ;EACG;EACL;EACN,cAAc;EACK;EACnB,iBAAA;EACA,aAAY;EACZ,SACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GACE,YAAY,UAAU;IAEpB,IAAI,MAAM,QAAQ,UAAU;IAC5B,MAAM,gBAAgB;IACtB,MAAM;GACR;GAEA,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;IACU;IACD;IACO;IACP;IACE;IACT,MAAM;IACN,SAAS,SAAS;KAChB,SAAS,IAAI;KACb,MAAM;IACR;GACD,CAAA;EACE,CAAA;EAGP,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,KAAK;GAAY,WAAU;GAC9B;EACG,CAAA;CACC,CAAA;AAEb"}
@@ -0,0 +1,44 @@
1
+ import { ReactNode } from 'react';
2
+ import { PopoverProps } from '../popover/index.js';
3
+ export type SwatchPickerColor = {
4
+ /** What `onChange` reports: a token name, a hex, any id. */
5
+ value: string;
6
+ /** Any CSS color. Defaults to `value`. */
7
+ color?: string;
8
+ /** The swatch's accessible name. Defaults to `value`. */
9
+ label?: string;
10
+ };
11
+ export type SwatchPickerProps = {
12
+ /** The colors offered, in order. */
13
+ colors: SwatchPickerColor[];
14
+ /** The current color's `value`. */
15
+ value: string;
16
+ /** What is being colored, for the grid's name: "Color for {label}". */
17
+ label: string;
18
+ onChange: (value: string) => void;
19
+ /** The starting color. "Reset to default" shows once `value` differs from it. */
20
+ defaultValue?: string;
21
+ /**
22
+ * - `'popover'`: the grid opens from `children` and closes on a pick.
23
+ * - `'inline'`: the grid in place, with no control or popover, and smaller
24
+ * swatches (20px, against 24px in the popover).
25
+ */
26
+ variant?: 'popover' | 'inline';
27
+ /** The control that opens the popover. Not used inline. */
28
+ children?: ReactNode;
29
+ /** The popover's placement. */
30
+ placement?: PopoverProps['placement'];
31
+ /** Where the popover renders. Defaults to the enclosing modal, or the page when there is none. */
32
+ getPopupContainer?: PopoverProps['getPopupContainer'];
33
+ /**
34
+ * Called when the popover opens or closes, e.g. to keep a panel around it
35
+ * open meanwhile. Not used inline.
36
+ */
37
+ onOpenChange?: (open: boolean) => void;
38
+ };
39
+ /**
40
+ * Pick one color from a fixed set, in a popover or inline. A grid rather than
41
+ * a free color input, so two items can't end up on colors that are hard to
42
+ * tell apart. The popover opens on the current color and closes on a pick.
43
+ */
44
+ export declare const SwatchPicker: ({ colors, value, label, onChange, defaultValue, variant, children, placement, getPopupContainer, onOpenChange, }: SwatchPickerProps) => import('react').JSX.Element;
@@ -0,0 +1,171 @@
1
+ import { Button } from "../button/Button.js";
2
+ import { Popover } from "../popover/Popover.js";
3
+ import { Swatch } from "../swatch/Swatch.js";
4
+ import { useEffect, useLayoutEffect, useRef, useState } from "react";
5
+ import { CheckIcon } from "@phosphor-icons/react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import cx from "classnames";
8
+ // src/components/swatchPicker/SwatchPicker.tsx
9
+ var COLUMNS = 8;
10
+ var RADIUS = 2;
11
+ var CENTERED = {
12
+ display: "flex",
13
+ alignItems: "center",
14
+ justifyContent: "center"
15
+ };
16
+ var STEPS = {
17
+ ArrowRight: 1,
18
+ ArrowLeft: -1,
19
+ ArrowDown: COLUMNS,
20
+ ArrowUp: -8
21
+ };
22
+ var modalOrPage = (trigger) => trigger.closest(".ant-modal-container") ?? document.body;
23
+ var channels = (painted) => {
24
+ const numbers = painted.match(/[\d.]+/g)?.map(Number);
25
+ if (!numbers || numbers.length < 3) return null;
26
+ const scale = painted.startsWith("color(") ? 255 : 1;
27
+ return numbers.slice(0, 3).map((n) => n * scale);
28
+ };
29
+ var isDark = (painted) => {
30
+ const rgb = channels(painted);
31
+ return rgb ? (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3 < 140 : true;
32
+ };
33
+ var Check = () => {
34
+ const ref = useRef(null);
35
+ const [dark, setDark] = useState(true);
36
+ useLayoutEffect(() => {
37
+ const swatch = ref.current?.parentElement;
38
+ if (swatch) setDark(isDark(getComputedStyle(swatch).backgroundColor));
39
+ }, []);
40
+ return /* @__PURE__ */ jsx("span", {
41
+ ref,
42
+ className: "flex",
43
+ children: /* @__PURE__ */ jsx(CheckIcon, {
44
+ size: 12,
45
+ weight: "bold",
46
+ color: "currentColor",
47
+ className: cx("block", dark ? "text-white" : "text-j2-text")
48
+ })
49
+ });
50
+ };
51
+ var SwatchGrid = ({ colors, value, defaultValue, label, onPick, gridRef, size }) => {
52
+ const [focusIndex, setFocusIndex] = useState(() => Math.max(0, colors.findIndex((c) => c.value === value)));
53
+ const swatches = useRef([]);
54
+ const onKeyDown = (event) => {
55
+ const step = STEPS[event.key];
56
+ if (step === void 0) return;
57
+ event.preventDefault();
58
+ const next = focusIndex + step;
59
+ if (next < 0 || next >= colors.length) return;
60
+ setFocusIndex(next);
61
+ swatches.current[next]?.focus();
62
+ };
63
+ return /* @__PURE__ */ jsxs("div", {
64
+ className: "flex flex-col gap-2",
65
+ children: [/* @__PURE__ */ jsx("div", {
66
+ ref: gridRef,
67
+ role: "radiogroup",
68
+ "aria-label": `Color for ${label}`,
69
+ className: "grid w-fit grid-cols-8 gap-1",
70
+ onKeyDown,
71
+ children: colors.map((c, index) => {
72
+ const selected = c.value === value;
73
+ return /* @__PURE__ */ jsx("button", {
74
+ ref: (node) => {
75
+ swatches.current[index] = node;
76
+ },
77
+ type: "button",
78
+ role: "radio",
79
+ "aria-checked": selected,
80
+ "aria-label": c.label ?? c.value,
81
+ tabIndex: index === focusIndex ? 0 : -1,
82
+ onClick: () => {
83
+ setFocusIndex(index);
84
+ onPick(c.value);
85
+ },
86
+ className: "flex cursor-pointer rounded-j2-xs border-0 bg-transparent p-0",
87
+ children: /* @__PURE__ */ jsx(Swatch, {
88
+ color: c.color ?? c.value,
89
+ size,
90
+ radius: RADIUS,
91
+ style: CENTERED,
92
+ children: selected && /* @__PURE__ */ jsx(Check, {})
93
+ })
94
+ }, c.value);
95
+ })
96
+ }), defaultValue !== void 0 && value !== defaultValue && /* @__PURE__ */ jsx(Button, {
97
+ type: "link",
98
+ size: "small",
99
+ className: "self-start !px-0",
100
+ onClick: () => onPick(defaultValue),
101
+ children: "Reset to default"
102
+ })]
103
+ });
104
+ };
105
+ /**
106
+ * Pick one color from a fixed set, in a popover or inline. A grid rather than
107
+ * a free color input, so two items can't end up on colors that are hard to
108
+ * tell apart. The popover opens on the current color and closes on a pick.
109
+ */
110
+ var SwatchPicker = ({ colors, value, label, onChange, defaultValue, variant = "popover", children, placement = "rightTop", getPopupContainer = modalOrPage, onOpenChange }) => {
111
+ const [open, setOpenState] = useState(false);
112
+ const setOpen = (next) => {
113
+ setOpenState(next);
114
+ onOpenChange?.(next);
115
+ };
116
+ const gridRef = useRef(null);
117
+ const triggerRef = useRef(null);
118
+ useEffect(() => {
119
+ if (!open) return;
120
+ const frame = requestAnimationFrame(() => gridRef.current?.querySelector("[tabindex=\"0\"]")?.focus());
121
+ return () => cancelAnimationFrame(frame);
122
+ }, [open]);
123
+ const close = () => {
124
+ setOpen(false);
125
+ triggerRef.current?.querySelector("button, [tabindex]")?.focus();
126
+ };
127
+ if (variant === "inline") return /* @__PURE__ */ jsx(SwatchGrid, {
128
+ colors,
129
+ value,
130
+ defaultValue,
131
+ label,
132
+ onPick: onChange,
133
+ size: 20
134
+ });
135
+ return /* @__PURE__ */ jsx(Popover, {
136
+ trigger: "click",
137
+ placement,
138
+ open,
139
+ onOpenChange: setOpen,
140
+ getPopupContainer,
141
+ destroyOnHidden: true,
142
+ paddingSize: "xs",
143
+ content: /* @__PURE__ */ jsx("div", {
144
+ onKeyDown: (event) => {
145
+ if (event.key !== "Escape") return;
146
+ event.stopPropagation();
147
+ close();
148
+ },
149
+ children: /* @__PURE__ */ jsx(SwatchGrid, {
150
+ colors,
151
+ value,
152
+ defaultValue,
153
+ label,
154
+ gridRef,
155
+ size: 24,
156
+ onPick: (next) => {
157
+ onChange(next);
158
+ close();
159
+ }
160
+ })
161
+ }),
162
+ children: /* @__PURE__ */ jsx("span", {
163
+ ref: triggerRef,
164
+ className: "inline-flex",
165
+ children
166
+ })
167
+ });
168
+ };
169
+ export { SwatchPicker };
170
+
171
+ //# sourceMappingURL=SwatchPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwatchPicker.js","names":[],"sources":["../../../../src/components/swatchPicker/SwatchPicker.tsx"],"sourcesContent":["import {\n type KeyboardEvent,\n type ReactNode,\n type RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\nimport { CheckIcon } from '@phosphor-icons/react'\nimport cx from 'classnames'\nimport { Button } from '../button'\nimport { Popover, type PopoverProps } from '../popover'\nimport { Swatch } from '../swatch'\n\nexport type SwatchPickerColor = {\n /** What `onChange` reports: a token name, a hex, any id. */\n value: string\n /** Any CSS color. Defaults to `value`. */\n color?: string\n /** The swatch's accessible name. Defaults to `value`. */\n label?: string\n}\n\nexport type SwatchPickerProps = {\n /** The colors offered, in order. */\n colors: SwatchPickerColor[]\n /** The current color's `value`. */\n value: string\n /** What is being colored, for the grid's name: \"Color for {label}\". */\n label: string\n onChange: (value: string) => void\n /** The starting color. \"Reset to default\" shows once `value` differs from it. */\n defaultValue?: string\n /**\n * - `'popover'`: the grid opens from `children` and closes on a pick.\n * - `'inline'`: the grid in place, with no control or popover, and smaller\n * swatches (20px, against 24px in the popover).\n */\n variant?: 'popover' | 'inline'\n /** The control that opens the popover. Not used inline. */\n children?: ReactNode\n /** The popover's placement. */\n placement?: PopoverProps['placement']\n /** Where the popover renders. Defaults to the enclosing modal, or the page when there is none. */\n getPopupContainer?: PopoverProps['getPopupContainer']\n /**\n * Called when the popover opens or closes, e.g. to keep a panel around it\n * open meanwhile. Not used inline.\n */\n onOpenChange?: (open: boolean) => void\n}\n\nconst COLUMNS = 8\n\n// The maps picker's corners (2px); Swatch's default is 4px.\nconst RADIUS = 2\n\n// Centers the check on its swatch.\nconst CENTERED = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n} as const\n\n// Arrow keys move through the grid; each is the step in swatches.\nconst STEPS: Record<string, number> = {\n ArrowRight: 1,\n ArrowLeft: -1,\n ArrowDown: COLUMNS,\n ArrowUp: -COLUMNS,\n}\n\n// Inside a modal the popover renders in the modal's container. A popover on\n// the page body can't take focus, since the modal pulls it back, and the\n// modal's outer box ignores the pointer, so only its container takes clicks.\nconst modalOrPage = (trigger: HTMLElement) =>\n trigger.closest<HTMLElement>('.ant-modal-container') ?? document.body\n\n// The first three channels of a painted color, 0 to 255. Browsers report\n// `rgb(…)` for most colors and `color(srgb …)`, 0 to 1, for color-mix results.\nconst channels = (painted: string) => {\n const numbers = painted.match(/[\\d.]+/g)?.map(Number)\n if (!numbers || numbers.length < 3) return null\n const scale = painted.startsWith('color(') ? 255 : 1\n return numbers.slice(0, 3).map((n) => n * scale)\n}\n\n// Whether a swatch needs a light check mark: Rec. 601 luma, which is enough\n// for a light-or-dark decision.\nconst isDark = (painted: string) => {\n const rgb = channels(painted)\n return rgb ? (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000 < 140 : true\n}\n\n// Colors may be CSS variables, so the check reads its swatch as painted.\nconst Check = () => {\n const ref = useRef<HTMLSpanElement>(null)\n const [dark, setDark] = useState(true)\n useLayoutEffect(() => {\n const swatch = ref.current?.parentElement\n if (swatch) setDark(isDark(getComputedStyle(swatch).backgroundColor))\n }, [])\n return (\n <span ref={ref} className=\"flex\">\n <CheckIcon\n size={12}\n weight=\"bold\"\n color=\"currentColor\"\n className={cx('block', dark ? 'text-white' : 'text-j2-text')}\n />\n </span>\n )\n}\n\n// The grid and its Reset link. Focus rests on one swatch at a time (roving\n// tabindex), so the grid is one Tab stop and the arrow keys move within it;\n// Enter or Space picks. It starts on the current color, or the first when\n// that isn't in the grid.\nconst SwatchGrid = ({\n colors,\n value,\n defaultValue,\n label,\n onPick,\n gridRef,\n size,\n}: {\n colors: SwatchPickerColor[]\n value: string\n defaultValue?: string\n label: string\n onPick: (value: string) => void\n gridRef?: RefObject<HTMLDivElement | null>\n /** Swatch side in px. */\n size: number\n}) => {\n const [focusIndex, setFocusIndex] = useState(() =>\n Math.max(\n 0,\n colors.findIndex((c) => c.value === value)\n )\n )\n const swatches = useRef<(HTMLButtonElement | null)[]>([])\n\n const onKeyDown = (event: KeyboardEvent) => {\n const step = STEPS[event.key]\n if (step === undefined) return\n event.preventDefault()\n const next = focusIndex + step\n if (next < 0 || next >= colors.length) return\n setFocusIndex(next)\n swatches.current[next]?.focus()\n }\n\n return (\n <div className=\"flex flex-col gap-2\">\n <div\n ref={gridRef}\n role=\"radiogroup\"\n aria-label={`Color for ${label}`}\n // Sized to its swatches: in a wider box the columns would stretch,\n // spreading the swatches and each button past its square.\n className=\"grid w-fit grid-cols-8 gap-1\"\n onKeyDown={onKeyDown}\n >\n {colors.map((c, index) => {\n const selected = c.value === value\n return (\n <button\n key={c.value}\n ref={(node) => {\n swatches.current[index] = node\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n aria-label={c.label ?? c.value}\n tabIndex={index === focusIndex ? 0 : -1}\n onClick={() => {\n // Inline the grid stays, so arrow keys go on from the pick.\n setFocusIndex(index)\n onPick(c.value)\n }}\n className=\"flex cursor-pointer rounded-j2-xs border-0 bg-transparent p-0\"\n >\n <Swatch\n color={c.color ?? c.value}\n size={size}\n radius={RADIUS}\n style={CENTERED}\n >\n {selected && <Check />}\n </Swatch>\n </button>\n )\n })}\n </div>\n {/* Only offered when it would change something. */}\n {defaultValue !== undefined && value !== defaultValue && (\n <Button\n type=\"link\"\n size=\"small\"\n className=\"self-start !px-0\"\n onClick={() => onPick(defaultValue)}\n >\n Reset to default\n </Button>\n )}\n </div>\n )\n}\n\n/**\n * Pick one color from a fixed set, in a popover or inline. A grid rather than\n * a free color input, so two items can't end up on colors that are hard to\n * tell apart. The popover opens on the current color and closes on a pick.\n */\nexport const SwatchPicker = ({\n colors,\n value,\n label,\n onChange,\n defaultValue,\n variant = 'popover',\n children,\n placement = 'rightTop',\n getPopupContainer = modalOrPage,\n onOpenChange,\n}: SwatchPickerProps) => {\n const [open, setOpenState] = useState(false)\n const setOpen = (next: boolean) => {\n setOpenState(next)\n onOpenChange?.(next)\n }\n const gridRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLSpanElement>(null)\n\n // Focus moves into the grid on open, onto the swatch that is its Tab stop:\n // a frame later, once the popover is in the page. (afterOpenChange waits\n // for the open animation.)\n useEffect(() => {\n if (!open) return\n const frame = requestAnimationFrame(() =>\n gridRef.current?.querySelector<HTMLElement>('[tabindex=\"0\"]')?.focus()\n )\n return () => cancelAnimationFrame(frame)\n }, [open])\n\n // A pick or Escape closes it and returns focus to the control that opened it.\n const close = () => {\n setOpen(false)\n triggerRef.current\n ?.querySelector<HTMLElement>('button, [tabindex]')\n ?.focus()\n }\n\n if (variant === 'inline') {\n return (\n <SwatchGrid\n colors={colors}\n value={value}\n defaultValue={defaultValue}\n label={label}\n onPick={onChange}\n size={20}\n />\n )\n }\n\n return (\n <Popover\n trigger=\"click\"\n placement={placement}\n open={open}\n onOpenChange={setOpen}\n getPopupContainer={getPopupContainer}\n destroyOnHidden\n paddingSize=\"xs\"\n content={\n <div\n onKeyDown={(event) => {\n // Only the picker closes, not a modal around it.\n if (event.key !== 'Escape') return\n event.stopPropagation()\n close()\n }}\n >\n <SwatchGrid\n colors={colors}\n value={value}\n defaultValue={defaultValue}\n label={label}\n gridRef={gridRef}\n size={24}\n onPick={(next) => {\n onChange(next)\n close()\n }}\n />\n </div>\n }\n >\n <span ref={triggerRef} className=\"inline-flex\">\n {children}\n </span>\n </Popover>\n )\n}\n"],"mappings":";;;;;;;;AAqDA,IAAM,UAAU;AAGhB,IAAM,SAAS;AAGf,IAAM,WAAW;CACf,SAAS;CACT,YAAY;CACZ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,CAAC,MAAM;EACX,MAAM,QAAQ,4BACZ,QAAQ,SAAS,cAA2B,kBAAgB,CAAC,EAAE,MAAM,CACvE;EACA,aAAa,qBAAqB,KAAK;CACzC,GAAG,CAAC,IAAI,CAAC;CAGT,MAAM,cAAc;EAClB,QAAQ,KAAK;EACb,WAAW,SACP,cAA2B,oBAAoB,CAAC,EAChD,MAAM;CACZ;CAEA,IAAI,YAAY,UACd,OACE,oBAAC,YAAD;EACU;EACD;EACO;EACP;EACP,QAAQ;EACR,MAAM;CACP,CAAA;CAIL,OACE,oBAAC,SAAD;EACE,SAAQ;EACG;EACL;EACN,cAAc;EACK;EACnB,iBAAA;EACA,aAAY;EACZ,SACE,oBAAC,OAAD;GACE,YAAY,UAAU;IAEpB,IAAI,MAAM,QAAQ,UAAU;IAC5B,MAAM,gBAAgB;IACtB,MAAM;GACR;GAEA,UAAA,oBAAC,YAAD;IACU;IACD;IACO;IACP;IACE;IACT,MAAM;IACN,SAAS,SAAS;KAChB,SAAS,IAAI;KACb,MAAM;IACR;GACD,CAAA;EACE,CAAA;EAGP,UAAA,oBAAC,QAAD;GAAM,KAAK;GAAY,WAAU;GAC9B;EACG,CAAA;CACC,CAAA;AAEb"}
@@ -0,0 +1 @@
1
+ export { SwatchPicker, type SwatchPickerColor, type SwatchPickerProps, } from './SwatchPicker.js';
@@ -1,6 +1,6 @@
1
+ const require_Tooltip = require("../tooltip/Tooltip.cjs");
1
2
  const require_Swatch = require("../swatch/Swatch.cjs");
2
3
  const require_useRender = require("../../utils/useRender.cjs");
3
- const require_Tooltip = require("../tooltip/Tooltip.cjs");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
  // src/components/swatchStrip/SwatchStrip.tsx
6
6
  var Item = ({ item, group, size, render }) => require_useRender.useRender({
@@ -1,6 +1,6 @@
1
+ import { Tooltip } from "../tooltip/Tooltip.js";
1
2
  import { Swatch } from "../swatch/Swatch.js";
2
3
  import { mergeProps, useRender } from "../../utils/useRender.js";
3
- import { Tooltip } from "../tooltip/Tooltip.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  // src/components/swatchStrip/SwatchStrip.tsx
6
6
  var Item = ({ item, group, size, render }) => useRender({
@@ -1,7 +1,7 @@
1
1
  const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_Table_module = require("./Table.module.css.cjs");
2
3
  const require_Spinner = require("../spinner/Spinner.cjs");
3
4
  const require_Pagination = require("../pagination/Pagination.cjs");
4
- const require_Table_module = require("./Table.module.css.cjs");
5
5
  let antd = require("antd");
6
6
  let _phosphor_icons_react = require("@phosphor-icons/react");
7
7
  _phosphor_icons_react = require_runtime.__toESM(_phosphor_icons_react, 1);
@@ -1,6 +1,6 @@
1
+ import Table_module_default from "./Table.module.css.js";
1
2
  import { Spinner } from "../spinner/Spinner.js";
2
3
  import { withDesignSystemPaginationOverrides } from "../pagination/Pagination.js";
3
- import Table_module_default from "./Table.module.css.js";
4
4
  import { Table, Tooltip } from "antd";
5
5
  import { CaretDownIcon, CaretUpDownIcon, CaretUpIcon } from "@phosphor-icons/react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@j2-health/design-system",
3
- "version": "0.6.9",
3
+ "version": "0.6.11",
4
4
  "type": "module",
5
5
  "description": "J2 Health shared React component library",
6
6
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "@dnd-kit/utilities": "^3.2.2",
61
61
  "@highcharts/react": "^5.0.0",
62
62
  "@phosphor-icons/react": "^2.1.7",
63
- "antd": "^6.6.8",
63
+ "antd": "^6.7.0",
64
64
  "classnames": "^2.5.1",
65
65
  "formik": "^2.4.6",
66
66
  "highcharts": "^13.1.1",
@@ -78,18 +78,18 @@
78
78
  "@eslint/js": "^10.0.1",
79
79
  "@highcharts/react": "^5.4.0",
80
80
  "@phosphor-icons/react": "^2.1.7",
81
- "@storybook/addon-docs": "^10.6.5",
82
- "@storybook/addon-links": "^10.6.5",
83
- "@storybook/react-vite": "^10.6.5",
84
- "@tailwindcss/postcss": "^4.3.3",
81
+ "@storybook/addon-docs": "^10.6.6",
82
+ "@storybook/addon-links": "^10.6.6",
83
+ "@storybook/react-vite": "^10.6.6",
84
+ "@tailwindcss/postcss": "^4.3.5",
85
85
  "@testing-library/jest-dom": "^7.0.1",
86
86
  "@testing-library/react": "^16.3.3",
87
87
  "@types/lodash": "^4.17.27",
88
88
  "@types/react": "^19.2.18",
89
89
  "@types/react-dom": "^19.2.5",
90
- "@vitejs/plugin-react": "^6.1.2",
90
+ "@vitejs/plugin-react": "^6.2.1",
91
91
  "@vitest/coverage-v8": "^5.0.5",
92
- "antd": "^6.6.8",
92
+ "antd": "^6.7.0",
93
93
  "autoprefixer": "^10.6.2",
94
94
  "classnames": "^2.5.1",
95
95
  "eslint": "^10.14.0",
@@ -97,9 +97,9 @@
97
97
  "eslint-plugin-react": "^7.37.2",
98
98
  "eslint-plugin-react-hooks": "^7.1.1",
99
99
  "eslint-plugin-react-refresh": "^0.5.7",
100
- "eslint-plugin-storybook": "^10.6.5",
100
+ "eslint-plugin-storybook": "^10.6.6",
101
101
  "formik": "^2.4.6",
102
- "globals": "^17.13.0",
102
+ "globals": "^17.14.0",
103
103
  "happy-dom": "^21.0.4",
104
104
  "highcharts": "^13.1.1",
105
105
  "lodash": "^4.18.1",
@@ -107,20 +107,20 @@
107
107
  "prettier": "^3.9.10",
108
108
  "react": "^19.2.8",
109
109
  "react-dom": "^19.3.1",
110
- "semver": "^7.8.5",
111
- "storybook": "^10.6.5",
112
- "tailwindcss": "^4.3.3",
110
+ "semver": "^7.8.6",
111
+ "storybook": "^10.6.6",
112
+ "tailwindcss": "^4.3.5",
113
113
  "ts-node": "^10.9.2",
114
114
  "typescript": "^5.5.3",
115
115
  "typescript-eslint": "^8.72.1",
116
- "vite": "^8.3.5",
116
+ "vite": "^8.3.6",
117
117
  "vite-plugin-dts": "^5.1.2",
118
118
  "vite-plugin-svgr": "^5.2.0",
119
- "vitest": "^5.0.4",
119
+ "vitest": "^5.1.0",
120
120
  "yup": "^1.4.0"
121
121
  },
122
122
  "optionalDependencies": {
123
- "@rollup/rollup-linux-x64-gnu": "^4.67.2"
123
+ "@rollup/rollup-linux-x64-gnu": "^4.68.0"
124
124
  },
125
125
  "eslintConfig": {
126
126
  "extends": [