@ostack.tech/ui 0.13.2 → 0.14.1

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 (69) hide show
  1. package/dist/chunks/{en-DtnihkTA.js → en-BiTLo8i1.js} +30 -1
  2. package/dist/chunks/en-BiTLo8i1.js.map +1 -0
  3. package/dist/locales/en-GB.js +1 -1
  4. package/dist/locales/en-US.js +1 -1
  5. package/dist/locales/fr-FR.js +29 -0
  6. package/dist/locales/fr-FR.js.map +1 -1
  7. package/dist/locales/pt-PT.js +29 -0
  8. package/dist/locales/pt-PT.js.map +1 -1
  9. package/dist/ostack-ui.css +5 -0
  10. package/dist/ostack-ui.js +1924 -656
  11. package/dist/ostack-ui.js.map +1 -1
  12. package/dist/types/components/Calendar/Calendar.d.ts +3 -3
  13. package/dist/types/components/Calendar/calendarUtils.d.ts +4 -0
  14. package/dist/types/components/Checkbox/Checkbox.d.ts +13 -1
  15. package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +13 -1
  16. package/dist/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +2 -1
  17. package/dist/types/components/CommandMenu/CommandMenu.d.ts +5 -3
  18. package/dist/types/components/Control/Control.d.ts +162 -0
  19. package/dist/types/components/Control/ControlContext.d.ts +13 -0
  20. package/dist/types/components/Control/ControlWithContainerRef.d.ts +14 -0
  21. package/dist/types/components/Control/controlUtils.d.ts +4 -0
  22. package/dist/types/components/Control/index.d.ts +4 -0
  23. package/dist/types/components/ControlAddon/ControlAddon.d.ts +1 -1
  24. package/dist/types/components/ControlCode/ControlCode.d.ts +1 -1
  25. package/dist/types/components/DataTable/DataTableFilter.d.ts +2 -3
  26. package/dist/types/components/DateInput/DateInput.d.ts +37 -7
  27. package/dist/types/components/DateRangeInput/DateRangeInput.d.ts +35 -9
  28. package/dist/types/components/Field/Field.d.ts +3 -13
  29. package/dist/types/components/Field/FieldContext.d.ts +7 -2
  30. package/dist/types/components/Field/index.d.ts +1 -1
  31. package/dist/types/components/Form/Form.d.ts +155 -0
  32. package/dist/types/components/Form/FormContext.d.ts +85 -0
  33. package/dist/types/components/Form/FormError.d.ts +28 -0
  34. package/dist/types/components/Form/FormReset.d.ts +7 -0
  35. package/dist/types/components/Form/FormState.d.ts +30 -0
  36. package/dist/types/components/Form/FormSubmit.d.ts +7 -0
  37. package/dist/types/components/Form/HiddenFormControl.d.ts +8 -0
  38. package/dist/types/components/Form/formUtils.d.ts +10 -0
  39. package/dist/types/components/Form/index.d.ts +6 -0
  40. package/dist/types/components/Form/useRegisterFormControl.d.ts +15 -0
  41. package/dist/types/components/Form/useResetControlOnFormReset.d.ts +2 -0
  42. package/dist/types/components/Input/Input.d.ts +22 -106
  43. package/dist/types/components/Input/index.d.ts +0 -1
  44. package/dist/types/components/NumericInput/NumericInput.d.ts +16 -15
  45. package/dist/types/components/NumericInput/numericInputUtils.d.ts +24 -0
  46. package/dist/types/components/Output/Output.d.ts +3 -3
  47. package/dist/types/components/RadioGroup/Radio.d.ts +1 -1
  48. package/dist/types/components/RadioGroup/RadioGroup.d.ts +17 -4
  49. package/dist/types/components/Select/Select.d.ts +17 -27
  50. package/dist/types/components/Select/SelectContext.d.ts +1 -1
  51. package/dist/types/components/Select/SelectNative.d.ts +2 -1
  52. package/dist/types/components/Stepper/Step.d.ts +1 -1
  53. package/dist/types/components/Table/Table.d.ts +1 -1
  54. package/dist/types/components/Table/TableCell.d.ts +1 -1
  55. package/dist/types/components/Table/TableContext.d.ts +1 -1
  56. package/dist/types/components/Tabs/Tab.d.ts +1 -1
  57. package/dist/types/components/Tabs/TabsContext.d.ts +1 -1
  58. package/dist/types/components/TextArea/TextArea.d.ts +14 -3
  59. package/dist/types/index.d.ts +2 -1
  60. package/dist/types/providers/LocalizationProvider/LocalizationObject.d.ts +2 -0
  61. package/dist/types/utils/setNativeProperty.d.ts +1 -1
  62. package/dist/types/utils/useConstant.d.ts +1 -1
  63. package/dist/types/utils/validationUtils.d.ts +4 -0
  64. package/package.json +5 -5
  65. package/scss/components/Form/_Form.scss +6 -0
  66. package/scss/index.scss +1 -0
  67. package/dist/chunks/en-DtnihkTA.js.map +0 -1
  68. package/dist/types/components/Input/InputWithContainerRef.d.ts +0 -14
  69. package/dist/types/utils/control.d.ts +0 -23
@@ -1,12 +1,13 @@
1
1
  import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
2
2
  import { ComponentPropsWithoutRef, ComponentPropsWithRef, FocusEvent, ReactNode } from 'react';
3
- import { ControlStatus, ControlVariant } from '../../utils/control.ts';
4
3
  import { CloseButton } from '../CloseButton';
4
+ import { ControlShowClearButton, ControlStatus, ControlVariant } from '../Control';
5
5
  import { ControlCode } from '../ControlCode';
6
- import { ShowClearButton } from '../Input';
6
+ import { FormValidationMode } from '../Form';
7
+ import { FormControlValidateFn } from '../Form/useRegisterFormControl.ts';
7
8
  import { Spinner } from '../Spinner';
8
9
  /** Properties of the radio group component. */
9
- export interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, "asChild"> {
10
+ export interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, "asChild" | "onValueChange"> {
10
11
  /** Whether to display the radio group inline. */
11
12
  inline?: boolean;
12
13
  /**
@@ -56,7 +57,7 @@ export interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<typeof Ra
56
57
  *
57
58
  * @default false
58
59
  */
59
- showClearButton?: ShowClearButton;
60
+ showClearButton?: ControlShowClearButton;
60
61
  /**
61
62
  * Accessible description for how to clear the radio group when the clear
62
63
  * button is visible.
@@ -64,6 +65,8 @@ export interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<typeof Ra
64
65
  clearDescription?: ReactNode;
65
66
  /** Label of the clear button announced to assistive technologies. */
66
67
  clearButtonLabel?: string;
68
+ /** Function called when the value of the radio group changes. */
69
+ onValueChange?: (value: string | null) => void;
67
70
  /**
68
71
  * Function called when the focus moves out of the control as a whole.
69
72
  *
@@ -71,6 +74,16 @@ export interface RadioGroupProps extends Omit<ComponentPropsWithoutRef<typeof Ra
71
74
  * with the control.
72
75
  */
73
76
  onBlurToOutside?: (event: FocusEvent) => void;
77
+ /**
78
+ * Custom validation function meant to validate the control when it is part of
79
+ * a `Form`.
80
+ */
81
+ validate?: FormControlValidateFn<string | null>;
82
+ /**
83
+ * Specifies when the control should be validated. Defaults to the value
84
+ * specified in the `Form`.
85
+ */
86
+ validationMode?: FormValidationMode;
74
87
  /** Properties to pass to the code component. */
75
88
  codeProps?: ComponentPropsWithRef<typeof ControlCode>;
76
89
  /** Properties to pass to the container component. */
@@ -1,28 +1,25 @@
1
1
  import { ComponentPropsWithoutRef, ComponentPropsWithRef, CSSProperties, ReactNode } from 'react';
2
2
  import { CommandMenu } from '../CommandMenu';
3
+ import { ControlSelectMultipleProps, ControlSelectSingleProps } from '../Control';
4
+ import { FormValidationMode } from '../Form';
5
+ import { FormControlValidateFn } from '../Form/useRegisterFormControl.ts';
3
6
  import { IconButton } from '../IconButton';
4
- import { Input } from '../Input';
5
7
  import { PopoverContent, PopoverTrigger } from '../Popover';
6
8
  import { Tag } from '../Tag';
9
+ /** Select's popover trigger properties. */
10
+ type SelectPopoverTriggerProps = Omit<ComponentPropsWithoutRef<typeof PopoverTrigger>, "defaultValue" | "value">;
7
11
  /** Base properties of the select component. */
8
- export interface SelectPropsBase<T extends string | number | readonly string[] = string | number | readonly string[]> extends ComponentPropsWithoutRef<typeof PopoverTrigger>, Pick<ComponentPropsWithoutRef<typeof Input>, "name" | "required" | "variant" | "status" | "code" | "readOnly" | "loading" | "loadingDescription" | "showSpinner" | "align" | "startAdornment" | "endAdornment" | "showClearButton" | "clearDescription" | "onBlurToOutside" | "rootProps" | "codeProps" | "containerProps" | "clearButtonProps" | "spinnerProps">, Pick<ComponentPropsWithoutRef<typeof CommandMenu>, "searchPlaceholder" | "searchValue" | "onSearchValueChange"> {
12
+ interface SelectPropsBase<TValue> extends SelectPopoverTriggerProps, Pick<ComponentPropsWithoutRef<typeof CommandMenu>, "searchPlaceholder" | "searchValue" | "onSearchValueChange"> {
9
13
  /**
10
- * Whether multiple options can be selected. If not set, at most one option
11
- * can be selected at a time.
12
- *
13
- * @default false
14
+ * Custom validation function meant to validate the control when it is part of
15
+ * a `Form`.
14
16
  */
15
- multiple?: boolean;
16
- /** Default select value. */
17
- defaultValue?: T;
18
- /** Select value. */
19
- value?: T;
17
+ validate?: FormControlValidateFn<TValue>;
20
18
  /**
21
- * Function called whenever the value of the select changes.
22
- *
23
- * @param value Select value. An array of values when `multiple` is set.
19
+ * Specifies when the control should be validated. Defaults to the value
20
+ * specified in the `Form`.
24
21
  */
25
- onValueChange?: (value: Exclude<T, number>) => void;
22
+ validationMode?: FormValidationMode;
26
23
  /**
27
24
  * Default (uncontrolled) open state of the popover.
28
25
  *
@@ -38,12 +35,6 @@ export interface SelectPropsBase<T extends string | number | readonly string[] =
38
35
  onOpenChange?: (open: boolean) => void;
39
36
  /** Select's placeholder. */
40
37
  placeholder?: ReactNode;
41
- /**
42
- * Select
43
- * [`autocomplete`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete)
44
- * attribute.
45
- */
46
- autoComplete?: ComponentPropsWithoutRef<"select">["autoComplete"];
47
38
  /** Accessible label for the search input. Not shown visibly. */
48
39
  searchLabel?: string;
49
40
  /** Accessible label for the list of options. Not shown visibly. */
@@ -79,13 +70,11 @@ export interface SelectPropsBase<T extends string | number | readonly string[] =
79
70
  /** Options to pass to the `CommandMenu` component. */
80
71
  commandMenuProps?: Omit<ComponentPropsWithRef<typeof CommandMenu>, "defaultValue" | "value" | "onValueChange" | "iconPlacement" | "searchPlaceholder" | "searchValue" | "onSearchValueChange" | "label" | "listLabel" | "loading" | "loadingLabel" | "loadingProgress" | "emptyMessage">;
81
72
  }
82
- /** Properties of the select component with `multiple` not set. */
83
- export interface SelectSingleProps extends SelectPropsBase<string | number> {
84
- multiple?: false;
73
+ /** Properties of a single select control. */
74
+ export interface SelectSingleProps extends Omit<ControlSelectSingleProps, keyof SelectPopoverTriggerProps>, SelectPropsBase<string> {
85
75
  }
86
- /** Properties of the select component with `multiple` set. */
87
- export interface SelectMultipleProps extends SelectPropsBase<string[]> {
88
- multiple: true;
76
+ /** Properties of a multiple select control. */
77
+ export interface SelectMultipleProps extends Omit<ControlSelectMultipleProps, keyof SelectPopoverTriggerProps>, SelectPropsBase<string[]> {
89
78
  }
90
79
  /** Properties of the select component. */
91
80
  export type SelectProps = SelectSingleProps | SelectMultipleProps;
@@ -125,3 +114,4 @@ export type SelectProps = SelectSingleProps | SelectMultipleProps;
125
114
  * ```
126
115
  */
127
116
  export declare const Select: import('react').ForwardRefExoticComponent<SelectProps & import('react').RefAttributes<HTMLButtonElement>>;
117
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AccentColor } from '../../utils/accent.ts';
3
- import { ControlStatus } from '../../utils/control.ts';
3
+ import { ControlStatus } from '../Control';
4
4
  import { SelectProps } from './Select.tsx';
5
5
  /** Value of the select context. */
6
6
  export interface SelectContextValue {
@@ -1,7 +1,8 @@
1
1
  import { ComponentPropsWithoutRef } from 'react';
2
2
  /** Properties of the native `<select>` element. */
3
3
  export interface SelectNativeProps extends ComponentPropsWithoutRef<"select"> {
4
+ actualElement: HTMLElement | null;
4
5
  onValueChange: (value: string | string[]) => void;
5
6
  }
6
7
  /** Native `<select>` element used by the `Select` component. */
7
- export declare function SelectNative({ multiple, onValueChange, ...otherProps }: SelectNativeProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare const SelectNative: import('react').ForwardRefExoticComponent<SelectNativeProps & import('react').RefAttributes<HTMLSelectElement>>;
@@ -1,6 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, ComponentPropsWithRef, ReactNode } from 'react';
2
- import { ControlStatus } from '../../utils/control.ts';
3
2
  import { ButtonProps } from '../Button';
3
+ import { ControlStatus } from '../Control';
4
4
  import { Label } from '../Label';
5
5
  /** Properties of the step component. */
6
6
  export interface StepProps extends ComponentPropsWithoutRef<"li">, Pick<ButtonProps, "variant" | "disabled" | "loading" | "showSpinner" | "spinnerProps"> {
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithoutRef, ComponentPropsWithRef, CSSProperties, ReactNode } from 'react';
2
- import { ControlStatus } from '../../utils/control.ts';
2
+ import { ControlStatus } from '../Control';
3
3
  /** Default column width in `"fixed"` mode. */
4
4
  export declare const DEFAULT_TABLE_COLUMN_WIDTH = 150;
5
5
  /** Possible table caption sides. */
@@ -1,5 +1,5 @@
1
1
  import { ComponentPropsWithoutRef, CSSProperties } from 'react';
2
- import { ControlStatus } from '../../utils/control.ts';
2
+ import { ControlStatus } from '../Control';
3
3
  /** Type of table cell. */
4
4
  export type TableCellVariant = "header" | "data";
5
5
  /** Sticky position of the table cell. */
@@ -1,5 +1,5 @@
1
- import { ControlStatus } from '../../utils/control.ts';
2
1
  import { ScrollPosition } from '../../utils/useScrollPosition.ts';
2
+ import { ControlStatus } from '../Control';
3
3
  import { TableColumnObject } from './columnUtils.ts';
4
4
  import { TableLayout } from './Table.tsx';
5
5
  /** Value of the table context. */
@@ -1,6 +1,6 @@
1
1
  import { Tabs as TabsPrimitive } from 'radix-ui';
2
2
  import { ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
3
- import { ControlStatus } from '../../utils/control.ts';
3
+ import { ControlStatus } from '../Control';
4
4
  import { Tooltip } from '../Tooltip';
5
5
  /** Properties of the tab component. */
6
6
  export interface TabProps extends Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.TabsTrigger>, "asChild" | "value"> {
@@ -24,7 +24,7 @@ interface TabsStateActions {
24
24
  export type TabsStore = ReturnType<typeof useCreateTabsContext>["store"];
25
25
  /** Tabs' context. */
26
26
  export declare const TabsContext: import('react').Context<TabsContextValue | null>;
27
- /** Hook which creates the tabs' store. */
27
+ /** Hook which creates the tabs' context. */
28
28
  export declare function useCreateTabsContext(variant: TabsVariant, defaultValue?: string | number, value?: string | number, showAllTabsWhilePrinting?: boolean): {
29
29
  variant: TabsVariant;
30
30
  showAllTabsWhilePrinting: boolean | undefined;
@@ -1,7 +1,18 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- import { InputPropsBase } from '../Input';
1
+ import { ControlTextAreaProps } from '../Control';
2
+ import { FormValidationMode } from '../Form';
3
+ import { FormControlValidateFn } from '../Form/useRegisterFormControl.ts';
3
4
  /** Properties of the text area component. */
4
- export interface TextAreaProps extends Omit<InputPropsBase, "asChild" | "children">, ComponentPropsWithoutRef<"textarea"> {
5
+ export interface TextAreaProps extends ControlTextAreaProps {
6
+ /**
7
+ * Custom validation function meant to validate the control when it is part of
8
+ * a `Form`.
9
+ */
10
+ validate?: FormControlValidateFn<string>;
11
+ /**
12
+ * Specifies when the control should be validated. Defaults to the value
13
+ * specified in the `Form`.
14
+ */
15
+ validationMode?: FormValidationMode;
5
16
  }
6
17
  /**
7
18
  * The text area component is used to collect multi-line user input. It is built
@@ -14,6 +14,7 @@ export * from './components/Code';
14
14
  export * from './components/Collapsible';
15
15
  export * from './components/CommandMenu';
16
16
  export * from './components/Container';
17
+ export * from './components/Control';
17
18
  export * from './components/ControlAddon';
18
19
  export * from './components/ControlCode';
19
20
  export * from './components/DataTable';
@@ -28,6 +29,7 @@ export * from './components/FeedbackList';
28
29
  export * from './components/FeedbackPopover';
29
30
  export * from './components/Field';
30
31
  export * from './components/FieldGroup';
32
+ export * from './components/Form';
31
33
  export * from './components/Grid';
32
34
  export * from './components/Heading';
33
35
  export * from './components/HelperText';
@@ -70,7 +72,6 @@ export * from './utils/boolDataAttr.ts';
70
72
  export * from './utils/breakpoints.ts';
71
73
  export * from './utils/combineAriaIds.ts';
72
74
  export * from './utils/combineEventHandlers.ts';
73
- export * from './utils/control.ts';
74
75
  export * from './utils/cx.ts';
75
76
  export * from './utils/filtering.ts';
76
77
  export * from './utils/keyboardShortcut.ts';
@@ -11,6 +11,7 @@ import { ErrorBoundaryProps } from '../../components/ErrorBoundary';
11
11
  import { FeedbackProps } from '../../components/Feedback';
12
12
  import { FeedbackPopoverProps } from '../../components/FeedbackPopover';
13
13
  import { FieldGroupHeaderProps } from '../../components/FieldGroup';
14
+ import { FormProps } from '../../components/Form';
14
15
  import { InputProps } from '../../components/Input';
15
16
  import { KeybindsProps } from '../../components/Keybinds';
16
17
  import { LabelProps } from '../../components/Label';
@@ -45,6 +46,7 @@ export interface LocalizationObject {
45
46
  Feedback: Pick<FeedbackProps, "visuallyHiddenPrefix">;
46
47
  FeedbackPopover: Pick<FeedbackPopoverProps, "label">;
47
48
  FieldGroupHeader: Pick<FieldGroupHeaderProps, "visuallyHiddenCodePrefix">;
49
+ Form: Pick<FormProps, "nativeErrorMessages" | "submitErrorMessage">;
48
50
  Input: Pick<InputProps, "loadingDescription" | "clearButtonLabel">;
49
51
  Keybinds: Pick<KeybindsProps, "keybindsSeparatorLabel" | "keyPressesSeparatorLabel" | "keysSeparatorLabel" | "keySymbols" | "keyLabels">;
50
52
  Label: Pick<LabelProps, "helperButtonLabel">;
@@ -5,4 +5,4 @@
5
5
  *
6
6
  * See: https://github.com/facebook/react/issues/10135
7
7
  */
8
- export declare function setNativeProperty(element: HTMLElement, prop: string, value: unknown): void;
8
+ export declare function setNativeProperty(element: Element, prop: string, value: unknown): void;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Hook for creating a value exactly once.
3
3
  *
4
- * @param fn Function which created the value to return.
4
+ * @param fn Function which creates the value to return.
5
5
  * @returns Value created on the first render of the hook.
6
6
  */
7
7
  export declare function useConstant<T>(fn: () => T): T;
@@ -0,0 +1,4 @@
1
+ /** Validity state keys representing native errors. */
2
+ export declare const NATIVE_VALIDITY_STATE_KEYS: readonly ["valueMissing", "badInput", "typeMismatch", "patternMismatch", "tooShort", "tooLong", "rangeUnderflow", "rangeOverflow", "stepMismatch"];
3
+ /** Type of native validity state keys. */
4
+ export type NativeValidityStateKey = (typeof NATIVE_VALIDITY_STATE_KEYS)[number];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ostack.tech/ui",
3
3
  "description": "ostack/UI component library.",
4
- "version": "0.13.2",
4
+ "version": "0.14.1",
5
5
  "homepage": "https://ui.ostack.tech/",
6
6
  "author": {
7
7
  "name": "Opensoft",
@@ -56,11 +56,11 @@
56
56
  "@fortawesome/fontawesome-svg-core": "^6.2.0 || ^7.0.0",
57
57
  "@fortawesome/free-regular-svg-icons": "^6.2.0 || ^7.0.0",
58
58
  "@fortawesome/free-solid-svg-icons": "^6.2.0 || ^7.0.0",
59
- "@types/react": "^18.0.0 || ^19.0.0",
60
- "@types/react-dom": "^18.0.0 || ^19.0.0",
59
+ "@types/react": "^19.0.0",
60
+ "@types/react-dom": "^19.0.0",
61
61
  "date-fns": "^4.1.0",
62
- "react": "^18.0.0 || ^19.0.0",
63
- "react-dom": "^18.0.0 || ^19.0.0",
62
+ "react": "^19.0.0",
63
+ "react-dom": "^19.0.0",
64
64
  "zustand": "^5.0.0"
65
65
  },
66
66
  "peerDependenciesMeta": {
@@ -0,0 +1,6 @@
1
+ @use "../../scss/base-variables" as *;
2
+
3
+ .#{$prefix}form {
4
+ min-width: 0;
5
+ width: 100%;
6
+ }
package/scss/index.scss CHANGED
@@ -31,6 +31,7 @@
31
31
  @forward "components/FeedbackPopover/FeedbackPopover";
32
32
  @forward "components/Field/Field";
33
33
  @forward "components/FieldGroup/FieldGroup";
34
+ @forward "components/Form/Form";
34
35
  @forward "components/Grid/Grid";
35
36
  @forward "components/Heading/Heading";
36
37
  @forward "components/HelperText/HelperText";
@@ -1 +0,0 @@
1
- {"version":3,"file":"en-DtnihkTA.js","sources":["../../src/locales/en.tsx"],"sourcesContent":["import type { LocalizationObject } from \"../providers/LocalizationProvider\";\nimport { IS_APPLE } from \"../utils/platformUtils.ts\";\n\n/** `en` locale (partial). */\nexport const en: Omit<LocalizationObject, \"languageTag\" | \"dayPickerLocale\"> = {\n AlertDialog: {\n okText: \"OK\",\n },\n Calendar: {\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n previousMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n },\n CloseButton: {\n label: \"Close\",\n },\n CollapsibleTrigger: {\n expandLabel: \"Show\",\n collapseLabel: \"Hide\",\n },\n CommandMenu: {\n searchPlaceholder: \"Search…\",\n listLabel: \"Suggestions\",\n loadingLabel: \"Loading…\",\n emptyMessage: \"No results found.\",\n },\n CommandMenuDialog: {\n title: \"Command palette\",\n description: \"Search for a command…\",\n },\n ConfirmDialog: {\n cancelText: \"Cancel\",\n },\n ControlCode: {\n visuallyHiddenPrefix: \"Field\",\n },\n DataTable: {\n selectAllRowsLabel: \"Select all\",\n selectRowLabel: \"Select\",\n },\n DataTableContent: {\n emptyMessage: \"Nothing to show.\",\n },\n DataTableFilter: {\n \"aria-label\": \"Search table\",\n placeholder: \"Search…\",\n },\n DataTablePagination: {\n \"aria-label\": \"Table pagination\",\n rowsRangeSelectLabel: (total) => `Visible rows out of ${total}`,\n rowsRange: (range, total) => (\n <>\n Rows&nbsp;{range}&nbsp;of {total}\n </>\n ),\n previousPageButtonLabel: \"Previous page\",\n nextPageButtonLabel: \"Next page\",\n },\n DataTableRowsPerPage: {\n label: \"Rows per page:\",\n },\n DateInput: {\n selectedDateDescription: (date) => `Selected date, ${date}`,\n calendarButtonLabel: \"Open calendar\",\n },\n DateRangeInput: {\n startInputLabel: \"Start date\",\n endInputLabel: \"End date\",\n selectedDateRangeDescription: ({ start, end }) =>\n `Selected date range, ${start || \"missing start date\"} to ${\n end || \"missing end date\"\n }`,\n },\n ErrorBoundary: {\n fallbackMessage: (\n <>\n Something went wrong.\n <br />\n Press the button on the right to try again. If the problem persists,\n please try again later.\n </>\n ),\n resetButtonLabel: \"Retry\",\n },\n Feedback: {\n visuallyHiddenPrefix: (type) =>\n type === \"error\" ? \"Error,\" : type === \"warning\" ? \"Warning,\" : null,\n },\n FeedbackPopover: {\n label: \"Show feedback\",\n },\n FieldGroupHeader: {\n visuallyHiddenCodePrefix: \"Section\",\n },\n Input: {\n loadingDescription: \"Loading…\",\n clearButtonLabel: \"Clear\",\n },\n Keybinds: {\n keybindsSeparatorLabel: \"or\",\n keyPressesSeparatorLabel: \"then\",\n keyLabels: {\n Meta: IS_APPLE ? undefined : \"Windows Key\",\n },\n },\n Label: {\n helperButtonLabel: \"Show help\",\n },\n NumericInput: {\n decimalSeparator: \".\",\n groupingStyle: \"thousand\",\n groupSeparator: \",\",\n },\n RadioGroup: {\n clearDescription: \"Press Backspace or Delete to clear.\",\n },\n Select: {\n placeholder: \"Select…\",\n clearDescription: \"Press Backspace or Delete to clear.\",\n searchLabel: \"Search options\",\n optionsLabel: \"Options\",\n valueTagCloseButtonLabel: \"Remove\",\n },\n Step: {\n stepNumberLabel: (number) => `Step ${number}`,\n completedLabel: \"Completed\",\n },\n StepperFinishTrigger: {\n label: \"Finish\",\n },\n StepperNextTrigger: {\n label: \"Next\",\n },\n StepperPreviousTrigger: {\n label: \"Back\",\n },\n TableColumn: {\n helperButtonLabel: \"Show help\",\n },\n TableHead: {\n sortByColumnDescription: (columnName, sortDirection) =>\n sortDirection === null\n ? `Stop sorting table by column “${columnName}”`\n : `Sort table by column “${columnName}” in ${\n sortDirection === \"asc\" ? \"ascending\" : \"descending\"\n } order`,\n },\n TabList: {\n scrollLeftButtonLabel: \"Scroll left\",\n scrollRightButtonLabel: \"Scroll right\",\n },\n ToastProvider: {\n label: \"Notification\",\n },\n ToastViewport: {\n label: \"Notifications ({hotkey})\",\n },\n};\n"],"names":[],"mappings":";;AAIO,MAAM,KAAkE;AAAA,EAC7E,aAAa;AAAA,IACX,QAAQ;AAAA,EAAA;AAAA,EAEV,UAAU;AAAA,IACR,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,gBAAgB;AAAA,EAAA;AAAA,EAElB,aAAa;AAAA,IACX,OAAO;AAAA,EAAA;AAAA,EAET,oBAAoB;AAAA,IAClB,aAAa;AAAA,IACb,eAAe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AAAA,EAAA;AAAA,EAET,eAAe;AAAA,IACb,OAAO;AAAA,EAAA;AAEX;"}
@@ -1,14 +0,0 @@
1
- import { ComponentRef, Ref } from 'react';
2
- import { Input, InputProps } from './Input.tsx';
3
- /**
4
- * Utility input component whose `ref` is passed to the input's container. Use
5
- * `inputRef` to provide the input's ref instead.
6
- *
7
- * This component is useful when using an input component as a trigger for
8
- * popovers/menus, and we wish to align said popover/menu against the input's
9
- * container (since popovers/menus align themselves based on the element
10
- * referenced by their trigger).
11
- */
12
- export declare const InputWithContainerRef: import('react').ForwardRefExoticComponent<InputProps & {
13
- inputRef?: Ref<ComponentRef<typeof Input>>;
14
- } & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,23 +0,0 @@
1
- import { AccentColor } from './accent.ts';
2
- /** Possible status of a control. */
3
- export type ControlStatus = "valid" | "invalid" | "warned";
4
- /**
5
- * Style variants of a control.
6
- *
7
- * The `cell` variant should be used to display controls within table cells.
8
- */
9
- export type ControlVariant = "default" | "cell";
10
- /** Value of the control context. */
11
- export interface ControlContextValue {
12
- variant?: ControlVariant;
13
- status?: ControlStatus;
14
- disabled?: boolean;
15
- softDisabled?: boolean;
16
- readOnly?: boolean;
17
- }
18
- /** Control context. */
19
- export declare const ControlContext: import('react').Context<ControlContextValue | null>;
20
- /** Hook providing access to the control context. */
21
- export declare function useControlContext(): ControlContextValue | null;
22
- /** Transforms a control status into a colour accent. */
23
- export declare function controlStatusToAccent(status?: ControlStatus, defaultAccent?: AccentColor): AccentColor | undefined;