@epam/ai-dial-ui-kit 0.14.0-dev.2 → 0.14.0-dev.22

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 (83) hide show
  1. package/README.md +7 -1
  2. package/dist/CHANGELOG.md +56 -1
  3. package/dist/{JsonEditor-DPtZkKQi.cjs → JsonEditor-CLmDZqJH.cjs} +1 -1
  4. package/dist/{JsonEditor-CM-CG-FK.js → JsonEditor-DdYGciSl.js} +1 -1
  5. package/dist/{MarkdownEditor-cdq8UZxL.js → MarkdownEditor-B9Bs3UUs.js} +1 -1
  6. package/dist/MarkdownEditor-DXdBLiV3.cjs +1 -0
  7. package/dist/{MarkdownEditor-D4WuEafx.cjs → MarkdownEditor-DlAqXKw_.cjs} +1 -1
  8. package/dist/MarkdownEditor-YU-phCxT.js +69 -0
  9. package/dist/components-manifest.json +1795 -202
  10. package/dist/dial-ui-kit.cjs.js +1 -1
  11. package/dist/dial-ui-kit.es.js +231 -195
  12. package/dist/{index-CBk9P1Pa.js → index-CpVGPv8D.js} +15116 -13323
  13. package/dist/{index-A_KNCHda.cjs → index-DBHH26fT.cjs} +31 -31
  14. package/dist/index.css +2 -2
  15. package/dist/migration-guides/0.14.0/button-tooltip-2-0.md +111 -0
  16. package/dist/migration-guides/0.14.0/control-color-token-rename.md +143 -0
  17. package/dist/migration-guides/0.14.0/focus-border-token-role-naming.md +87 -0
  18. package/dist/migration-guides/0.14.0/select-multiselect-option-row.md +99 -0
  19. package/dist/migration-guides/0.14.0/shadow-token-per-step-rename.md +139 -0
  20. package/dist/migration-guides/0.14.0/tag-single-size.md +121 -0
  21. package/dist/migration-guides/README.md +6 -0
  22. package/dist/src/components/Grid/comparators/base-column-comparator.d.ts +1 -4
  23. package/dist/src/components/Grid/renderers/utils.d.ts +1 -2
  24. package/dist/src/components/New/Button/Button.d.ts +4 -3
  25. package/dist/src/components/New/Calendar/constants.d.ts +5 -5
  26. package/dist/src/components/New/Checkbox/Checkbox.d.ts +50 -0
  27. package/dist/src/components/New/Checkbox/CheckboxBox.d.ts +30 -0
  28. package/dist/src/components/New/Checkbox/constants.d.ts +10 -0
  29. package/dist/src/components/New/CollapsibleSidebar/CollapsibleSidebar.d.ts +82 -0
  30. package/dist/src/components/New/Dropdown/constants.d.ts +3 -1
  31. package/dist/src/components/New/EllipsisTooltip/EllipsisTooltip.d.ts +51 -0
  32. package/dist/src/components/New/EllipsisTooltip/use-truncation.d.ts +26 -0
  33. package/dist/src/components/New/Grid/Grid.d.ts +124 -0
  34. package/dist/src/components/New/Grid/components/SelectionCell.d.ts +21 -0
  35. package/dist/src/components/New/Grid/components/SelectionHeader.d.ts +14 -0
  36. package/dist/src/components/New/Grid/constants.d.ts +61 -0
  37. package/dist/src/components/New/Grid/renderers/DateCellRenderer.d.ts +48 -0
  38. package/dist/src/components/New/Grid/renderers/constants.d.ts +5 -0
  39. package/dist/src/components/New/Highlight/Highlight.d.ts +1 -1
  40. package/dist/src/components/New/IconButton/IconButton.d.ts +4 -4
  41. package/dist/src/components/New/Input/Button/constants.d.ts +1 -1
  42. package/dist/src/components/New/Label/Label.d.ts +5 -0
  43. package/dist/src/components/New/NoDataContent/NoDataContent.d.ts +48 -0
  44. package/dist/src/components/New/Notification/Notification.d.ts +7 -0
  45. package/dist/src/components/New/Notification/NotificationWrapper.d.ts +2 -0
  46. package/dist/src/components/New/Popup/Popup.d.ts +48 -9
  47. package/dist/src/components/New/Popup/constants.d.ts +7 -0
  48. package/dist/src/components/New/Radio/Radio.d.ts +48 -0
  49. package/dist/src/components/New/RadioGroup/RadioGroup.d.ts +78 -0
  50. package/dist/src/components/New/RadioGroup/constants.d.ts +11 -0
  51. package/dist/src/components/New/RadioGroupPopupField/RadioGroupPopupField.d.ts +93 -0
  52. package/dist/src/components/New/RadioGroupPopupField/constants.d.ts +22 -0
  53. package/dist/src/components/New/ResizableContainer/ConditionalResizableContainer.d.ts +34 -0
  54. package/dist/src/components/New/ResizableContainer/ResizableContainer.d.ts +77 -0
  55. package/dist/src/components/New/ResizableContainer/components/ResizeHandle.d.ts +21 -0
  56. package/dist/src/components/New/SegmentedControl/SegmentedControl.d.ts +54 -0
  57. package/dist/src/components/New/SegmentedControl/constants.d.ts +16 -0
  58. package/dist/src/components/New/Select/constants.d.ts +2 -2
  59. package/dist/src/components/New/Slider/Slider.d.ts +70 -0
  60. package/dist/src/components/New/Tag/Tag.d.ts +26 -4
  61. package/dist/src/components/New/Tag/constants.d.ts +23 -0
  62. package/dist/src/components/New/ThemeScope/ThemeScope.d.ts +46 -0
  63. package/dist/src/components/New/ToggleIconButton/ToggleIconButton.d.ts +47 -0
  64. package/dist/src/components/New/Tooltip/Tooltip.d.ts +43 -0
  65. package/dist/src/components/New/Tooltip/TooltipContainer.d.ts +32 -0
  66. package/dist/src/components/New/Tooltip/TooltipContent.d.ts +18 -0
  67. package/dist/src/components/New/Tooltip/TooltipContext.d.ts +115 -0
  68. package/dist/src/components/New/Tooltip/TooltipTrigger.d.ts +18 -0
  69. package/dist/src/components/New/Tooltip/constants.d.ts +30 -0
  70. package/dist/src/components/New/constants/icon.d.ts +22 -0
  71. package/dist/src/components/New/constants/overlay.d.ts +12 -3
  72. package/dist/src/index.d.ts +47 -1
  73. package/dist/src/models/dropdown.d.ts +10 -0
  74. package/dist/src/types/notification.d.ts +2 -1
  75. package/dist/src/types/tag.d.ts +4 -0
  76. package/dist/src/types/tooltip.d.ts +6 -0
  77. package/dist/src/utils/__tests__/element-size-observer.spec.d.ts +1 -0
  78. package/dist/src/utils/element-size-observer.d.ts +26 -0
  79. package/dist/src/utils/grid-comparators.d.ts +4 -0
  80. package/dist/src/utils/grid-date.d.ts +7 -0
  81. package/package.json +1 -1
  82. package/dist/MarkdownEditor-DRQoDnC-.js +0 -75
  83. package/dist/MarkdownEditor-DyIvPpmt.cjs +0 -1
@@ -1,4 +1,5 @@
1
1
  import { FC, MouseEvent, ReactNode } from 'react';
2
+ import { ButtonProps } from '../Button/Button';
2
3
  import { PopupSize } from '../../../types/popup';
3
4
  export interface PopupProps {
4
5
  open?: boolean;
@@ -13,7 +14,16 @@ export interface PopupProps {
13
14
  bodyClassName?: string;
14
15
  children?: ReactNode;
15
16
  footer?: ReactNode;
17
+ footerClassName?: string;
16
18
  onClose?: (e?: MouseEvent<HTMLButtonElement> | null) => void;
19
+ onBack?: (e: MouseEvent<HTMLButtonElement>) => void;
20
+ backAriaLabel?: string;
21
+ headerActions?: ReactNode;
22
+ headerDivider?: boolean;
23
+ mainButtons?: ButtonProps[];
24
+ additionalButtons?: ButtonProps[];
25
+ additionalButtonsOnLeft?: boolean;
26
+ footerDivider?: boolean;
17
27
  size?: PopupSize;
18
28
  hideClose?: boolean;
19
29
  closeAriaLabel?: string;
@@ -27,8 +37,18 @@ export interface PopupProps {
27
37
  *
28
38
  * Renders in a portal with a scrim overlay, focus management, a header with the
29
39
  * title and close control, a scrollable body and an optional footer. Sections
30
- * are separated by spacing rather than rules; add your own through
31
- * `headerClassName` or the footer node if a surface needs them.
40
+ * are separated by spacing rather than rules; opt into a rule with
41
+ * `headerDivider` / `footerDivider`.
42
+ *
43
+ * The header grows from the title alone: `onBack` prepends a back control,
44
+ * `headerActions` sits between the title and the close button.
45
+ *
46
+ * The footer is declared as data, not markup: `mainButtons` and
47
+ * `additionalButtons` take {@link ButtonProps} and the popup renders the
48
+ * {@link Button}s itself, so spacing, order and the neutral default are the
49
+ * same on every dialog. `additionalButtonsOnLeft` moves the secondary group to
50
+ * the opposite edge. A `footer` node still wins over both, for the rare surface
51
+ * that needs something other than a row of buttons.
32
52
  *
33
53
  * A string `header` names the dialog automatically. A `header` node cannot —
34
54
  * pass `ariaLabel` in that case, or the dialog opens unnamed.
@@ -39,12 +59,22 @@ export interface PopupProps {
39
59
  * open
40
60
  * header="Title"
41
61
  * size={PopupSize.Md}
42
- * footer={
43
- * <div className="flex justify-end gap-2 px-6 py-4">
44
- * <NeutralButton label="Cancel" />
45
- * <PrimaryButton label="Confirm" />
46
- * </div>
47
- * }
62
+ * onBack={() => setStep(step - 1)}
63
+ * headerActions={<InfoButton caption="What is this?" />}
64
+ * additionalButtonsOnLeft
65
+ * additionalButtons={[
66
+ * {
67
+ * label: 'Back',
68
+ * variant: ButtonVariant.Primary,
69
+ * appearance: ButtonAppearance.Link,
70
+ * iconBefore: <IconArrowLeft />,
71
+ * onClick: goBack,
72
+ * },
73
+ * ]}
74
+ * mainButtons={[
75
+ * { label: 'Cancel', onClick: () => setOpen(false) },
76
+ * { label: 'Confirm', variant: ButtonVariant.Primary, onClick: submit },
77
+ * ]}
48
78
  * onClose={() => setOpen(false)}
49
79
  * >
50
80
  * <div className="px-6 py-4">Dialog content goes here…</div>
@@ -61,7 +91,16 @@ export interface PopupProps {
61
91
  * @param [headerClassName] - Additional CSS classes applied to the popup header container
62
92
  * @param [bodyClassName] - Additional CSS classes applied to the scrollable body wrapper around `children`
63
93
  * @param [children] - Body content
64
- * @param [footer] - Footer area for actions
94
+ * @param [footer] - Custom footer node; overrides `mainButtons` and `additionalButtons`
95
+ * @param [footerClassName] - Additional CSS classes applied to the built-in footer container
96
+ * @param [onBack] - Callback for the header back button; the button renders only when set
97
+ * @param [backAriaLabel="Back"] - Accessible name of the back button
98
+ * @param [headerActions] - Controls rendered between the title and the close button
99
+ * @param [headerDivider=false] - Whether a rule is drawn under the header
100
+ * @param [mainButtons] - Primary footer buttons, aligned to the trailing edge; each defaults to `ButtonVariant.Neutral`
101
+ * @param [additionalButtons] - Secondary footer buttons, next to `mainButtons` unless moved left
102
+ * @param [additionalButtonsOnLeft=false] - Whether `additionalButtons` sit on the leading edge
103
+ * @param [footerDivider=false] - Whether a rule is drawn above the footer
65
104
  * @param [onClose] - Callback fired when the popup requests to close
66
105
  * @param [size=PopupSize.Md] - Sets the max-width of the popup
67
106
  * @param [hideClose=false] - Whether the close button is hidden in the header
@@ -3,6 +3,13 @@ export declare const popupOverlayBaseClassName = "z-[52] flex items-center justi
3
3
  export declare const popupBaseClassName = "relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto";
4
4
  export declare const popupHeaderClassName = "flex flex-row items-center justify-between px-6 py-4";
5
5
  export declare const popupTitleClassName = "flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary";
6
+ /** Rule under the header. Opt-in: by default sections are separated by spacing. */
7
+ export declare const popupHeaderDividerClassName = "border-b border-tertiary";
8
+ export declare const popupFooterClassName = "flex flex-row items-center gap-2 px-6 py-4";
9
+ /** Rule above the footer, mirroring the header. */
10
+ export declare const popupFooterDividerClassName = "border-t border-tertiary";
11
+ /** Groups the controls sitting on one side of the header or footer. */
12
+ export declare const popupActionsGroupClassName = "flex shrink-0 flex-row items-center gap-2";
6
13
  /**
7
14
  * Max widths per size. Full width below the `md` breakpoint, where the popup
8
15
  * fills the screen.
@@ -0,0 +1,48 @@
1
+ import { FC, InputHTMLAttributes } from 'react';
2
+ import { LabelProps } from '../Label/Label';
3
+ type NativeInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'onChange' | 'size' | 'value'>;
4
+ export interface RadioProps extends NativeInputProps {
5
+ name: string;
6
+ value: string;
7
+ labelProps?: LabelProps;
8
+ isSelected?: boolean;
9
+ disabled?: boolean;
10
+ onChange?: (value: string) => void;
11
+ caption?: string;
12
+ }
13
+ /**
14
+ * A radio button from the 2.0 design system.
15
+ * aliases: RadioButton|ChoiceOption|RadioInput
16
+ * Design system 2.0
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * <Radio
21
+ * name="plan"
22
+ * value="pro"
23
+ * labelProps={{ label: 'Pro' }}
24
+ * isSelected={plan === 'pro'}
25
+ * onChange={setPlan}
26
+ * />
27
+ * ```
28
+ *
29
+ * Radios sharing a `name` form one group: the browser gives them a single tab
30
+ * stop and moves the selection with the arrow keys, so no `role="radiogroup"`
31
+ * wiring is needed here. Wrap a set in a `<fieldset>` with a `<legend>` when the
32
+ * group itself needs a name.
33
+ *
34
+ * The circle and the label text are two sibling `<label for>` elements rather
35
+ * than one wrapper, so the {@link Label} keeps its own `required` marker and
36
+ * `caption` info button — a button nested in a label forwards its clicks to the
37
+ * labelled control. Clicking either one still selects the radio.
38
+ *
39
+ * @param name - The group this radio belongs to; radios sharing it are mutually exclusive
40
+ * @param value - The value reported to `onChange` when this radio is selected
41
+ * @param [labelProps] - Props of the {@link Label} rendered next to the control
42
+ * @param [isSelected=false] - Whether this radio is the selected one of its group
43
+ * @param [disabled=false] - Whether the radio is disabled
44
+ * @param [onChange] - Callback fired with `value` when this radio becomes selected
45
+ * @param [caption] - Caption text rendered below the label, and described by the radio
46
+ */
47
+ export declare const Radio: FC<RadioProps>;
48
+ export {};
@@ -0,0 +1,78 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { LabelProps } from '../Label/Label';
3
+ import { RadioGroupOrientation } from '../../../types/radio-group';
4
+ export interface RadioGroupItem {
5
+ value: string;
6
+ label?: ReactNode;
7
+ /** Explanatory text rendered under the option's label. */
8
+ caption?: string;
9
+ /** Content revealed under the option while it is the selected one. */
10
+ content?: ReactNode;
11
+ disabled?: boolean;
12
+ /** Names the option when its `label` is not a string (or absent). */
13
+ 'aria-label'?: string;
14
+ }
15
+ export interface RadioGroupProps {
16
+ items: RadioGroupItem[];
17
+ value?: string;
18
+ onChange: (value: string) => void;
19
+ name?: string;
20
+ id?: string;
21
+ orientation?: RadioGroupOrientation;
22
+ labelProps?: LabelProps;
23
+ disabled?: boolean;
24
+ error?: string;
25
+ caption?: string;
26
+ ariaLabel?: string;
27
+ className?: string;
28
+ optionsClassName?: string;
29
+ radioClassName?: string;
30
+ contentClassName?: string;
31
+ }
32
+ /**
33
+ * A set of mutually exclusive {@link Radio} options with one group label.
34
+ * aliases: SelectionGroup|OptionGroup|RadioList
35
+ * Design system 2.0
36
+ *
37
+ * @example
38
+ * ```tsx
39
+ * <RadioGroup
40
+ * labelProps={{ label: 'Delivery' }}
41
+ * value={delivery}
42
+ * onChange={setDelivery}
43
+ * items={[
44
+ * { value: 'pickup', label: 'Pickup', caption: 'Free, ready today' },
45
+ * { value: 'courier', label: 'Courier', content: <AddressForm /> },
46
+ * ]}
47
+ * />
48
+ * ```
49
+ *
50
+ * The options are native radios sharing one `name`, so the browser gives the
51
+ * group a single tab stop and moves the selection with the arrow keys — no
52
+ * roving `tabindex` is needed. The wrapper still takes `role="radiogroup"` so
53
+ * the group's own name is announced before the options.
54
+ *
55
+ * An option's `content` is mounted only while that option is selected, so a
56
+ * form or an input inside it never holds focus for an option the user has moved
57
+ * away from.
58
+ *
59
+ * The group is named by `labelProps.label` when that is a string, and by
60
+ * `ariaLabel` otherwise — a group whose label is a node has no other name.
61
+ *
62
+ * @param items - Options to render; each needs a unique `value` and may carry a `label`, `caption`, `content` and `disabled` flag
63
+ * @param [value] - The `value` of the selected option
64
+ * @param onChange - Callback fired with the newly selected `value`
65
+ * @param [name] - The `name` shared by the underlying radios; defaults to the group id
66
+ * @param [id] - Base id for the group; option ids are derived from it
67
+ * @param [orientation=RadioGroupOrientation.Column] - Whether the options stack or sit in a row
68
+ * @param [labelProps] - Props of the {@link Label} rendered above the options
69
+ * @param [disabled] - Disables every option
70
+ * @param [error] - Error message rendered below the options
71
+ * @param [caption] - Helper text rendered below the options when there is no `error`
72
+ * @param [ariaLabel] - Names the group when there is no string `labelProps.label`
73
+ * @param [className] - Additional classes for the outer container
74
+ * @param [optionsClassName] - Additional classes for the options wrapper
75
+ * @param [radioClassName] - Additional classes for every option's control row
76
+ * @param [contentClassName] - Additional classes for the selected option's content
77
+ */
78
+ export declare const RadioGroup: FC<RadioGroupProps>;
@@ -0,0 +1,11 @@
1
+ import { RadioGroupOrientation } from '../../../types/radio-group';
2
+ /** Label, options and caption/error stack, matching the 2.0 field rhythm. */
3
+ export declare const groupBaseClassName = "flex flex-col gap-2";
4
+ export declare const optionsWrapperBaseClassName = "flex";
5
+ /**
6
+ * Content revealed under the selected option. The inline offset is the one
7
+ * `Radio` gives its own caption, so the content lines up with the option's
8
+ * label text rather than with its circle.
9
+ */
10
+ export declare const selectedContentClassName = "mt-2 ml-[26px]";
11
+ export declare const orientationClassMap: Record<RadioGroupOrientation, string>;
@@ -0,0 +1,93 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { LabelProps } from '../Label/Label';
3
+ import { RadioGroupItem } from '../RadioGroup/RadioGroup';
4
+ import { PopupSize } from '../../../types/popup';
5
+ export interface RadioGroupPopupFieldProps {
6
+ items: RadioGroupItem[];
7
+ value?: string;
8
+ customValue?: string;
9
+ header: ReactNode;
10
+ onApply: (value?: string) => void;
11
+ id?: string;
12
+ labelProps?: LabelProps;
13
+ placeholder?: string;
14
+ selectedValue?: string;
15
+ onSelectionChange?: (value: string) => void;
16
+ onCancel?: () => void;
17
+ onClose?: () => void;
18
+ isValid?: boolean;
19
+ applyButtonLabel?: string;
20
+ cancelButtonLabel?: string;
21
+ size?: PopupSize;
22
+ portalId?: string;
23
+ disabled?: boolean;
24
+ invalid?: boolean;
25
+ error?: string;
26
+ caption?: string;
27
+ ariaLabel?: string;
28
+ className?: string;
29
+ fieldClassName?: string;
30
+ }
31
+ /**
32
+ * A field whose value is picked from a {@link RadioGroup} inside a {@link Popup}.
33
+ * aliases: PopupRadio|ChoicePopup|RadioPopupField
34
+ * Design system 2.0
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <RadioGroupPopupField
39
+ * labelProps={{ label: 'Status' }}
40
+ * header="Select status"
41
+ * placeholder="None"
42
+ * items={[
43
+ * { value: 'draft', label: 'Draft' },
44
+ * { value: 'published', label: 'Published' },
45
+ * ]}
46
+ * value={status}
47
+ * onApply={(next) => setStatus(next)}
48
+ * />
49
+ * ```
50
+ *
51
+ * The collapsed field is a `<button>` rather than a read-only `<input>`: it
52
+ * opens a dialog and holds no text of its own, so the button role and its
53
+ * `Enter` / `Space` activation come from the element itself instead of being
54
+ * re-implemented on an input that would also invite typing.
55
+ *
56
+ * The selection inside the popup is a draft. Uncontrolled, it is seeded from
57
+ * `value` each time the popup opens, so an edit the user cancelled never leaks
58
+ * into the next one, and `onApply` is the only callback reporting a committed
59
+ * value. Pass `selectedValue` with `onSelectionChange` to drive the draft
60
+ * yourself — needed when `isValid` depends on what is currently selected.
61
+ *
62
+ * The field's accessible name is its label followed by the current value, so it
63
+ * announces like a collapsed picker ("Status, Draft"). With no `labelProps`,
64
+ * pass `ariaLabel`: it is exposed through a visually hidden element rather than
65
+ * as `aria-label`, which would replace the value in the name instead of
66
+ * preceding it.
67
+ *
68
+ * @param items - Options offered inside the popup
69
+ * @param [value] - The committed value, shown in the collapsed field
70
+ * @param [customValue] - Text shown in the field in place of the selected option's label
71
+ * @param header - Title of the popup
72
+ * @param onApply - Callback fired with the selected value when Apply is clicked
73
+ * @param [id] - Base id for the field; the label and the options derive theirs from it
74
+ * @param [labelProps] - Props of the {@link Label} rendered above the field
75
+ * @param [placeholder] - Text shown in the field while no value is selected
76
+ * @param [selectedValue] - Controlled draft selection inside the popup
77
+ * @param [onSelectionChange] - Callback fired when the draft selection changes
78
+ * @param [onCancel] - Callback fired when Cancel is clicked, before the popup closes
79
+ * @param [onClose] - Callback fired whenever the popup closes
80
+ * @param [isValid=true] - Whether Apply is enabled
81
+ * @param [applyButtonLabel="Apply"] - Label of the Apply button
82
+ * @param [cancelButtonLabel="Cancel"] - Label of the Cancel button
83
+ * @param [size=PopupSize.Md] - Size of the popup
84
+ * @param [portalId] - Portal container id for the popup
85
+ * @param [disabled] - Disables the field, so the popup cannot be opened
86
+ * @param [invalid] - Paints the field with the error border
87
+ * @param [error] - Error message rendered below the field
88
+ * @param [caption] - Helper text rendered below the field when there is no `error`
89
+ * @param [ariaLabel] - Names the field when there is no string `labelProps.label`
90
+ * @param [className] - Additional classes for the outer container
91
+ * @param [fieldClassName] - Additional classes for the collapsed field
92
+ */
93
+ export declare const RadioGroupPopupField: FC<RadioGroupPopupFieldProps>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The collapsed field. `dial-kit-input` gives it the 2.0 field box — 40px tall,
3
+ * raised surface, accent border on hover, accent outline on focus, and the
4
+ * sunken disabled treatment through its own `:disabled` rule, which a `<button>`
5
+ * matches. The utilities after it only lay the row out; the SCSS class is
6
+ * unlayered, so anything it already sets (`truncate`, `w-full`, the height)
7
+ * cannot be overridden from here.
8
+ *
9
+ * No `dial-kit-enhanced-target`: `truncate` puts `overflow: hidden` on the
10
+ * field, which would clip the 44px pseudo-element back to the field's own 40px,
11
+ * and being unlayered it cannot be undone with a utility. The field takes the
12
+ * same documented 2.5.5 exception as `Input` and `Select` — full-width target,
13
+ * 4px short of 44 vertically.
14
+ */
15
+ export declare const fieldBaseClassName = "dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left";
16
+ export declare const fieldValueClassName = "min-w-0 flex-1 truncate text-primary";
17
+ export declare const fieldPlaceholderClassName = "min-w-0 flex-1 truncate text-secondary";
18
+ export declare const fieldIconClassName = "shrink-0 text-secondary";
19
+ export declare const popupBodyClassName = "px-6 pb-4";
20
+ export declare const popupFooterClassName = "flex justify-end gap-2 px-6 py-4 border-t border-tertiary";
21
+ export declare const defaultCancelLabel = "Cancel";
22
+ export declare const defaultApplyLabel = "Apply";
@@ -0,0 +1,34 @@
1
+ import { FC } from 'react';
2
+ import { ResizableContainerProps } from './ResizableContainer';
3
+ export interface ConditionalResizableContainerProps extends ResizableContainerProps {
4
+ /** Whether resizing is enabled. Defaults to `true`. */
5
+ enabled?: boolean;
6
+ }
7
+ /**
8
+ * Renders its children inside a {@link ResizableContainer} only while `enabled`.
9
+ * aliases: OptionalResize|ConditionalPanel
10
+ * Design system 2.0
11
+ *
12
+ * When `enabled` is false the children are rendered on their own, with no
13
+ * wrapper element and no resize behaviour — useful for a panel that is only
14
+ * resizable while it is expanded. Every other prop is passed straight through;
15
+ * see {@link ResizableContainer} for controlled and uncontrolled sizing, sides
16
+ * and callbacks.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * <ConditionalResizableContainer
21
+ * enabled={isExpanded}
22
+ * minWidth={180}
23
+ * maxWidth={520}
24
+ * defaultWidth={260}
25
+ * >
26
+ * <Sidebar />
27
+ * </ConditionalResizableContainer>
28
+ * ```
29
+ *
30
+ * @param [enabled=true] - Whether resizing is enabled.
31
+ * @param children - Content to render inside the container.
32
+ * @see ResizableContainer
33
+ */
34
+ export declare const ConditionalResizableContainer: FC<ConditionalResizableContainerProps>;
@@ -0,0 +1,77 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { ResizableContainerSide } from '../../../types/resizable-container';
3
+ export interface ResizableContainerProps {
4
+ /** Content placed inside the container. */
5
+ children: ReactNode;
6
+ /** Minimum allowed width in px. */
7
+ minWidth: number;
8
+ /** Maximum allowed width in px. */
9
+ maxWidth: number;
10
+ /** Controlled width in px. When provided, the component becomes controlled. */
11
+ width?: number;
12
+ /** Initial width when uncontrolled. Defaults to `minWidth`. */
13
+ defaultWidth?: number;
14
+ /** Fired when a resize ends, and once per arrow key press. */
15
+ onResizeStop?: (width: number) => void;
16
+ /** Fired continuously while dragging, with the current width. */
17
+ onResize?: (width: number) => void;
18
+ /** Edge carrying the resize handle. Defaults to `ResizableContainerSide.Right`. */
19
+ side?: ResizableContainerSide;
20
+ /** Width change per arrow key press. Defaults to `16`. */
21
+ keyboardStep?: number;
22
+ /** Accessible name of the handle. Defaults to `'Resize panel'`. */
23
+ ariaLabel?: string;
24
+ /** Additional CSS classes for the inner content wrapper. */
25
+ className?: string;
26
+ /** Additional CSS classes for the resize handle. */
27
+ resizeHandlerClassName?: string;
28
+ /** Custom node rendered inside the handle, in place of the default chevron. */
29
+ resizeHandler?: ReactNode;
30
+ }
31
+ /**
32
+ * A panel the user can widen or narrow by dragging its edge.
33
+ * aliases: ResizePanel|SizableContainer|Splitter
34
+ * Design system 2.0
35
+ *
36
+ * Works as a controlled component when `width` is provided, otherwise it keeps
37
+ * its own width from `defaultWidth`. The handle — an accent line with a chevron
38
+ * pointing away from the panel — appears on hover and while dragging, and stays
39
+ * within `minWidth`–`maxWidth` in both modes.
40
+ *
41
+ * The handle is a focusable `separator`, so the panel resizes with the arrow
42
+ * keys — `Home` and `End` jump to the bounds — and each press reports through
43
+ * `onResize` and `onResizeStop`. Unlike the 1.0 container this one draws no
44
+ * dividers between its children; pass `divide-y divide-tertiary` through
45
+ * `className` if you want them.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * <ResizableContainer minWidth={180} maxWidth={520} defaultWidth={260}>
50
+ * <Sidebar />
51
+ * </ResizableContainer>
52
+ *
53
+ * <ResizableContainer
54
+ * minWidth={180}
55
+ * maxWidth={520}
56
+ * width={sidebarWidth}
57
+ * onResizeStop={setSidebarWidth}
58
+ * >
59
+ * <Sidebar />
60
+ * </ResizableContainer>
61
+ * ```
62
+ *
63
+ * @param children - Content placed inside the container.
64
+ * @param minWidth - Minimum allowed width in px.
65
+ * @param maxWidth - Maximum allowed width in px.
66
+ * @param [width] - Controlled width. If omitted the container is uncontrolled.
67
+ * @param [defaultWidth] - Initial width when uncontrolled. Defaults to `minWidth`.
68
+ * @param [onResizeStop] - Fired when a resize ends, and once per arrow key press.
69
+ * @param [onResize] - Fired continuously while dragging.
70
+ * @param [side=ResizableContainerSide.Right] - Edge carrying the resize handle.
71
+ * @param [keyboardStep=16] - Width change per arrow key press.
72
+ * @param [ariaLabel='Resize panel'] - Accessible name of the handle.
73
+ * @param [className] - Additional CSS classes for the inner content wrapper.
74
+ * @param [resizeHandlerClassName] - Additional CSS classes for the resize handle.
75
+ * @param [resizeHandler] - Custom node rendered inside the handle, replacing the default chevron.
76
+ */
77
+ export declare const ResizableContainer: FC<ResizableContainerProps>;
@@ -0,0 +1,21 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { ResizableContainerSide } from '../../../../types/resizable-container';
3
+ interface ResizeHandleProps {
4
+ side: ResizableContainerSide;
5
+ isResizing: boolean;
6
+ width: number;
7
+ minWidth: number;
8
+ maxWidth: number;
9
+ step: number;
10
+ ariaLabel: string;
11
+ onWidthChange: (nextWidth: number) => void;
12
+ customHandler?: ReactNode;
13
+ handlerClassName?: string;
14
+ }
15
+ /**
16
+ * The draggable edge of {@link ResizableContainer}. It is a focusable
17
+ * `separator` — the window-splitter pattern — so the panel can be resized with
18
+ * the arrow keys as well as the pointer.
19
+ */
20
+ export declare const ResizeHandle: FC<ResizeHandleProps>;
21
+ export {};
@@ -0,0 +1,54 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SegmentedControlItem<T extends string = string> {
3
+ value: T;
4
+ label?: ReactNode;
5
+ icon?: ReactNode;
6
+ disabled?: boolean;
7
+ 'aria-label'?: string;
8
+ }
9
+ export interface SegmentedControlProps<T extends string> {
10
+ items: SegmentedControlItem<T>[];
11
+ value: T;
12
+ onChange: (value: T) => void;
13
+ disabled?: boolean;
14
+ className?: string;
15
+ segmentClassName?: string;
16
+ 'aria-label'?: string;
17
+ }
18
+ /**
19
+ * A single-select switch between a few mutually exclusive, equally sized options.
20
+ * aliases: SegmentedButton|ViewSwitcher|ButtonGroup
21
+ * Design system 2.0
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * <SegmentedControl
26
+ * aria-label="View"
27
+ * value={view}
28
+ * onChange={setView}
29
+ * items={[
30
+ * { value: 'list', icon: <IconList />, 'aria-label': 'List' },
31
+ * { value: 'grid', icon: <IconGrid />, 'aria-label': 'Grid' },
32
+ * ]}
33
+ * />
34
+ * ```
35
+ *
36
+ * This is a radio group, not a tab list: it selects a value rather than
37
+ * revealing a panel, so it takes `role="radiogroup"` with `role="radio"`
38
+ * segments. The group is a single tab stop — the selected segment holds it, and
39
+ * the arrow keys, `Home` and `End` move the selection, per the ARIA radio-group
40
+ * pattern. `DialSegmentedControl` (1.0) uses `tablist`/`tab` instead; that is
41
+ * the behaviour this replaces.
42
+ *
43
+ * An icon-only segment still needs a name: give it `aria-label`, since the icon
44
+ * carries no text. A segment with a string `label` is named by it.
45
+ *
46
+ * @param items - Segments to render; each needs a unique `value` and may carry a `label`, `icon` and `disabled` flag
47
+ * @param value - The currently selected `value`
48
+ * @param onChange - Callback fired with the newly selected `value`
49
+ * @param [disabled] - Disables every segment
50
+ * @param [className] - Additional classes for the track
51
+ * @param [segmentClassName] - Additional classes for every segment
52
+ * @param [aria-label] - Names the group as a whole
53
+ */
54
+ export declare const SegmentedControl: <T extends string>({ items, value, onChange, disabled, className, segmentClassName: segmentClassNameProp, "aria-label": ariaLabel, }: SegmentedControlProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ /** Keys that move the selection inside the group. */
2
+ export declare const NAVIGATION_KEYS: string[];
3
+ /** The sunken track the segments sit in. */
4
+ export declare const containerClassName = "inline-flex w-fit items-center gap-1 rounded-full border border-tertiary bg-layer-sunken p-[3px]";
5
+ export declare const segmentClassName = "flex h-8 min-w-8 flex-1 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-full px-4 dial-small-text transition-colors duration-200 outline-offset-0 focus-visible:outline focus-visible:outline-focus";
6
+ /** Selected lifts off the track on a raised surface and keeps the accent at rest. */
7
+ export declare const segmentSelectedClassName = "bg-layer-raised text-accent shadow-xs";
8
+ export declare const segmentUnselectedClassName = "bg-transparent text-secondary";
9
+ export declare const segmentSelectedInteractiveClassName = "cursor-pointer hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active";
10
+ export declare const segmentUnselectedInteractiveClassName = "cursor-pointer hover:bg-control-accent-alpha-hover hover:text-accent active:bg-control-accent-alpha-active";
11
+ /**
12
+ * A disabled segment keeps its shape so the group does not reflow, but drops the
13
+ * accent and the shadow.
14
+ */
15
+ export declare const segmentDisabledSelectedClassName = "cursor-not-allowed bg-control-disable-primary text-control-disable-primary shadow-none";
16
+ export declare const segmentDisabledUnselectedClassName = "cursor-not-allowed bg-transparent text-control-disable-primary";
@@ -1,6 +1,6 @@
1
1
  export declare const selectOverlayBaseClassName: string;
2
2
  export declare const selectOptionBaseClassName: string;
3
- export declare const selectOptionSelectedClassName = "bg-control-accent-alpha-hover";
3
+ export declare const selectOptionSelectedClassName = "bg-control-accent-alpha";
4
4
  /**
5
5
  * Holds the option list to the width of the field.
6
6
  *
@@ -12,7 +12,7 @@ export declare const selectOptionSelectedClassName = "bg-control-accent-alpha-ho
12
12
  * default this component relies on).
13
13
  */
14
14
  export declare const selectListWidthClassName = "!max-w-[var(--reference-width)]";
15
- export declare const selectOptionDisabledClassName = "opacity-75";
15
+ export declare const selectOptionDisabledClassName: string;
16
16
  export declare const dropdownMenuMaxHeight = 352;
17
17
  export declare const selectSubMenuGap = 4;
18
18
  export declare const selectSubMenuClassName: string;
@@ -0,0 +1,70 @@
1
+ import { FC, InputHTMLAttributes } from 'react';
2
+ import { LabelProps } from '../Label/Label';
3
+ type NativeInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange' | 'size'>;
4
+ export interface SliderProps extends NativeInputProps {
5
+ value: number;
6
+ min?: number;
7
+ max?: number;
8
+ step?: number;
9
+ disabled?: boolean;
10
+ labelProps?: LabelProps;
11
+ /** 2-element or 3-element label tuple rendered below the track */
12
+ labels?: [string, string] | [string, string, string];
13
+ /** Custom formatter for the displayed value; defaults to fixed-decimal based on step */
14
+ formatValue?: (value: number) => string;
15
+ /** Renders the current value at the end of the label row */
16
+ showValue?: boolean;
17
+ caption?: string;
18
+ error?: string;
19
+ onChange?: (value: number) => void;
20
+ containerClassName?: string;
21
+ /** Additional classes for the unfilled track */
22
+ trackClassName?: string;
23
+ /** Additional classes for the filled portion of the track */
24
+ fillClassName?: string;
25
+ }
26
+ /**
27
+ * A range slider from the 2.0 design system.
28
+ * aliases: RangeInput|TemperatureSlider|RangeSlider
29
+ * Design system 2.0
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * <Slider
34
+ * id="temperature"
35
+ * labelProps={{ label: 'Temperature' }}
36
+ * value={temperature}
37
+ * labels={['Precise', 'Neutral', 'Creative']}
38
+ * onChange={setTemperature}
39
+ * />
40
+ * ```
41
+ *
42
+ * Built on a native `<input type="range">`, so the browser owns the drag, the
43
+ * arrow / Home / End steps, touch and the writing direction. Only the thumb is
44
+ * restyled; the track and its fill are separate elements so the fill can be
45
+ * driven from `value`. Thumb states live in `slider.scss`, because a
46
+ * pseudo-element cannot be reached by a utility class.
47
+ *
48
+ * The interactive row is 24px tall and spans the full width, so the pointer
49
+ * target meets WCAG 2.5.8 (Minimum) but not the 44px of 2.5.5 (Enhanced) — see
50
+ * the exception table in the README.
51
+ *
52
+ * @param value - Current slider value
53
+ * @param [min=0] - Minimum value
54
+ * @param [max=1] - Maximum value
55
+ * @param [step=0.1] - Step increment
56
+ * @param [disabled=false] - Whether the slider is disabled
57
+ * @param [labelProps] - Props of the {@link Label} rendered above the track
58
+ * @param [labels] - 2 or 3 strings rendered below the track (start, [middle,] end)
59
+ * @param [formatValue] - Custom formatter for the displayed value; also becomes the announced `aria-valuetext`
60
+ * @param [showValue=false] - Renders the current value at the end of the label row
61
+ * @param [caption] - Helper text rendered below the track, and described by the slider
62
+ * @param [error] - Error message rendered below the track; replaces the caption
63
+ * @param [onChange] - Callback fired with the new value
64
+ * @param [containerClassName] - Additional classes for the outer container
65
+ * @param [trackClassName] - Additional classes for the unfilled track
66
+ * @param [fillClassName] - Additional classes for the filled portion of the track
67
+ * @param [className] - Additional classes for the underlying range input
68
+ */
69
+ export declare const Slider: FC<SliderProps>;
70
+ export {};