@planningcenter/tapestry 3.2.1-rc.4 → 3.2.1-rc.6

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.
@@ -0,0 +1,44 @@
1
+ import "../button/btn.css";
2
+ import "./index.css";
3
+ import React, { type AriaAttributes } from "react";
4
+ export type NumberStepperSize = "md" | "lg";
5
+ export interface NumberStepperProps {
6
+ /** The default uncontrolled value. */
7
+ defaultValue?: number;
8
+ /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */
9
+ description?: string;
10
+ /** Disables the input and stepper buttons. */
11
+ disabled?: boolean;
12
+ /** Formatting options for the displayed value. Uses `Intl.NumberFormat`. */
13
+ formatOptions?: Intl.NumberFormatOptions;
14
+ /** If `true`, renders the label visually hidden. */
15
+ hideLabel?: boolean;
16
+ /** If `true`, applies error styling to the field and description. */
17
+ invalid?: boolean;
18
+ /** Accessible label for the field. */
19
+ label: string;
20
+ /** Maximum allowed value. */
21
+ max?: number;
22
+ /** Minimum allowed value. */
23
+ min?: number;
24
+ /** Field name for form submission. */
25
+ name?: string;
26
+ /** Called when the value changes. */
27
+ onChange?: (value: number) => void;
28
+ /** Allows the value to be read but not changed. */
29
+ readOnly?: boolean;
30
+ /** If `true`, appends an asterisk after the label text. */
31
+ required?: boolean;
32
+ /** The size of the number stepper. */
33
+ size?: NumberStepperSize;
34
+ /** Amount to increment or decrement by. Defaults to `1`. */
35
+ step?: number;
36
+ /** The controlled value. */
37
+ value?: number;
38
+ }
39
+ export type NumberStepperElementProps = NumberStepperProps & Omit<AriaAttributes, keyof NumberStepperProps> & {
40
+ className?: string;
41
+ id?: string;
42
+ };
43
+ export declare function NumberStepper({ className, defaultValue, description, disabled, formatOptions, hideLabel, id, invalid, label, max, min, name, onChange, readOnly, required, size, step, value, ...restProps }: NumberStepperElementProps): React.JSX.Element;
44
+ //# sourceMappingURL=NumberStepper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberStepper.d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C/C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAEH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,aAAa,EACb,SAAS,EACT,EAAE,EACF,OAAO,EACP,KAAK,EACL,GAAG,EACH,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAW,EACX,IAAI,EACJ,KAAK,EACL,GAAG,SAAS,EACb,EAAE,yBAAyB,qBAwD3B"}
@@ -0,0 +1,22 @@
1
+ import Icon from '../../utilities/Icon.js';
2
+ import classNames from 'classnames';
3
+ import React__default from 'react';
4
+ import { NumberField, Label, Group, Input, Button, Text } from 'react-aria-components';
5
+
6
+ function NumberStepper({ className, defaultValue, description, disabled, formatOptions, hideLabel, id, invalid, label, max, min, name, onChange, readOnly, required, size = "md", step, value, ...restProps }) {
7
+ const combinedClassName = classNames("tds-number-stepper", { "tds-number-stepper--lg": size === "lg" }, className);
8
+ return (React__default.createElement(NumberField, { ...restProps, "aria-label": hideLabel ? label : undefined, className: combinedClassName, defaultValue: defaultValue, formatOptions: formatOptions, id: id, isDisabled: disabled, isInvalid: invalid, isReadOnly: readOnly, isRequired: required, maxValue: max, minValue: min, name: name, onChange: onChange ?? undefined, step: step, value: value },
9
+ !hideLabel && (React__default.createElement(Label, { className: "tds-number-stepper-label" }, label)),
10
+ React__default.createElement(Group, { className: "tds-number-stepper-field" },
11
+ React__default.createElement(Input, { className: "tds-number-stepper-input" }),
12
+ React__default.createElement(Button, { className: "tds-btn tds-btn--infield tds-number-stepper-button", slot: "decrement" },
13
+ React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#minus" })),
14
+ React__default.createElement(Button, { className: "tds-btn tds-btn--infield tds-number-stepper-button", slot: "increment" },
15
+ React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#plus" }))),
16
+ description && (React__default.createElement(Text, { className: "tds-number-stepper-description", slot: "description" },
17
+ React__default.createElement(Icon, { "aria-hidden": true, className: "tds-number-stepper-description-invalid-icon", symbol: "general#exclamation-triangle" }),
18
+ description))));
19
+ }
20
+
21
+ export { NumberStepper };
22
+ //# sourceMappingURL=NumberStepper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberStepper.js","sources":["../../../src/components/NumberStepper/NumberStepper.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"./index.css\"\n\nimport Icon from \"@utilities/Icon\"\nimport classNames from \"classnames\"\nimport React, { type AriaAttributes } from \"react\"\nimport {\n Button,\n Group,\n Input,\n Label,\n NumberField as AriaNumberField,\n Text,\n} from \"react-aria-components\"\n\nexport type NumberStepperSize = \"md\" | \"lg\"\n\nexport interface NumberStepperProps {\n /** The default uncontrolled value. */\n defaultValue?: number\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: string\n /** Disables the input and stepper buttons. */\n disabled?: boolean\n /** Formatting options for the displayed value. Uses `Intl.NumberFormat`. */\n formatOptions?: Intl.NumberFormatOptions\n /** If `true`, renders the label visually hidden. */\n hideLabel?: boolean\n /** If `true`, applies error styling to the field and description. */\n invalid?: boolean\n /** Accessible label for the field. */\n label: string\n /** Maximum allowed value. */\n max?: number\n /** Minimum allowed value. */\n min?: number\n /** Field name for form submission. */\n name?: string\n /** Called when the value changes. */\n onChange?: (value: number) => void\n /** Allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk after the label text. */\n required?: boolean\n /** The size of the number stepper. */\n size?: NumberStepperSize\n /** Amount to increment or decrement by. Defaults to `1`. */\n step?: number\n /** The controlled value. */\n value?: number\n}\n\nexport type NumberStepperElementProps = NumberStepperProps &\n Omit<AriaAttributes, keyof NumberStepperProps> & {\n className?: string\n id?: string\n }\n\nexport function NumberStepper({\n className,\n defaultValue,\n description,\n disabled,\n formatOptions,\n hideLabel,\n id,\n invalid,\n label,\n max,\n min,\n name,\n onChange,\n readOnly,\n required,\n size = \"md\",\n step,\n value,\n ...restProps\n}: NumberStepperElementProps) {\n const combinedClassName = classNames(\n \"tds-number-stepper\",\n { \"tds-number-stepper--lg\": size === \"lg\" },\n className\n )\n\n return (\n <AriaNumberField\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultValue={defaultValue}\n formatOptions={formatOptions}\n id={id}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={max}\n minValue={min}\n name={name}\n onChange={onChange ?? undefined}\n step={step}\n value={value}\n >\n {!hideLabel && (\n <Label className=\"tds-number-stepper-label\">{label}</Label>\n )}\n <Group className=\"tds-number-stepper-field\">\n <Input className=\"tds-number-stepper-input\" />\n <Button\n className=\"tds-btn tds-btn--infield tds-number-stepper-button\"\n slot=\"decrement\"\n >\n <Icon aria-hidden symbol=\"general#minus\" />\n </Button>\n <Button\n className=\"tds-btn tds-btn--infield tds-number-stepper-button\"\n slot=\"increment\"\n >\n <Icon aria-hidden symbol=\"general#plus\" />\n </Button>\n </Group>\n {description && (\n <Text className=\"tds-number-stepper-description\" slot=\"description\">\n <Icon\n aria-hidden\n className=\"tds-number-stepper-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaNumberField>\n )\n}\n"],"names":["React","AriaNumberField"],"mappings":";;;;;AA0DM,SAAU,aAAa,CAAC,EAC5B,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,aAAa,EACb,SAAS,EACT,EAAE,EACF,OAAO,EACP,KAAK,EACL,GAAG,EACH,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,IAAI,EACJ,KAAK,EACL,GAAG,SAAS,EACc,EAAA;AAC1B,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,oBAAoB,EACpB,EAAE,wBAAwB,EAAE,IAAI,KAAK,IAAI,EAAE,EAC3C,SAA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aAAA,CAAC,IAAI,EAAA,EAAC,SAAS,EAAC,gCAAgC,EAAC,IAAI,EAAC,aAAa,EAAA;YACjEA,cAAA,CAAA,aAAA,CAAC,IAAI,yBAEH,SAAS,EAAC,6CAA6C,EACvD,MAAM,EAAC,8BAA8B,EAAA,CACrC;AACD,YAAA,WAAW,CACP,CACR,CACe;AAEtB;;;;"}
@@ -0,0 +1,4 @@
1
+ import "./index.css";
2
+ export type { NumberStepperElementProps, NumberStepperProps, NumberStepperSize, } from "./NumberStepper";
3
+ export { NumberStepper } from "./NumberStepper";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NumberStepper/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,YAAY,EACV,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
@@ -11,8 +11,11 @@ export interface ComboBoxProps<T extends object = object> {
11
11
  defaultInputValue?: string;
12
12
  /** The default list of items (uncontrolled dynamic collection). */
13
13
  defaultItems?: Iterable<T>;
14
- /** The default uncontrolled selected value. */
15
- defaultValue?: Key | null;
14
+ /**
15
+ * The default uncontrolled selected value(s).
16
+ * Pass a `Key[]` when `selectionMode` is `"multiple"`.
17
+ */
18
+ defaultValue?: Key | Key[] | null;
16
19
  /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */
17
20
  description?: string;
18
21
  /** Disables the field and trigger button. */
@@ -35,8 +38,11 @@ export interface ComboBoxProps<T extends object = object> {
35
38
  menuTrigger?: "focus" | "input" | "manual";
36
39
  /** Field name for form submission. */
37
40
  name?: string;
38
- /** Called when the selected value changes. */
39
- onChange?: (value: Key | null) => void;
41
+ /**
42
+ * Called when the selected value(s) change.
43
+ * Receives `Key[]` when `selectionMode` is `"multiple"`, otherwise `Key | null`.
44
+ */
45
+ onChange?: ((value: Key | null) => void) | ((value: Key[]) => void);
40
46
  /** Called when the input text changes. */
41
47
  onInputChange?: (value: string) => void;
42
48
  /** Placeholder text for the input. */
@@ -45,16 +51,21 @@ export interface ComboBoxProps<T extends object = object> {
45
51
  readOnly?: boolean;
46
52
  /** If `true`, appends an asterisk at the end of the label text. */
47
53
  required?: boolean;
54
+ /** Controls whether one or multiple items can be selected. Defaults to `"single"`. */
55
+ selectionMode?: "single" | "multiple";
48
56
  /** The size of the combo box. */
49
57
  size?: ComboBoxSize;
50
- /** The controlled selected value. */
51
- value?: Key | null;
58
+ /**
59
+ * The controlled selected value(s).
60
+ * Pass a `Key[]` when `selectionMode` is `"multiple"`.
61
+ */
62
+ value?: Key | Key[] | null;
52
63
  }
53
64
  export type ComboBoxElementProps<T extends object = object> = ComboBoxProps<T> & Omit<AriaAttributes, keyof ComboBoxProps<T>> & {
54
65
  className?: string;
55
66
  id?: string;
56
67
  };
57
- export declare function ComboBox<T extends object>({ allowsEmptyCollection, children, className, defaultInputValue, defaultItems, defaultValue, description, disabled, disabledKeys, filter, hideLabel, inputValue, invalid, items, label, menuTrigger, name, onChange, onInputChange, placeholder, readOnly, required, size, value, ...restProps }: ComboBoxElementProps<T>): React.JSX.Element;
68
+ export declare function ComboBox<T extends object>({ allowsEmptyCollection, children, className, defaultInputValue, defaultItems, defaultValue, description, disabled, disabledKeys, filter, hideLabel, inputValue, invalid, items, label, menuTrigger, name, onChange, onInputChange, placeholder, readOnly, required, selectionMode, size, value, ...restProps }: ComboBoxElementProps<T>): React.JSX.Element;
58
69
  export declare function ComboBoxItem<T extends object>(props: ListBoxItemProps<T>): React.JSX.Element;
59
70
  interface ComboBoxSectionProps<T extends object> extends Omit<ListBoxSectionProps<T>, "children"> {
60
71
  children: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../../src/components/combo-box/ComboBox.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;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,CAAC,CAAC,GAC5E,IAAI,CAAC,cAAc,EAAE,MAAM,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAEH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,EACzC,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,SAAS,EACT,UAAU,EACV,OAAO,EACP,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,IAAW,EACX,KAAK,EACL,GAAG,SAAS,EACb,EAAE,oBAAoB,CAAC,CAAC,CAAC,qBAyDzB;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,qBAOxE;AAED,UAAU,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAC7C,SAAQ,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IAChD,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,EAChD,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,qBAYzB"}
@@ -3,9 +3,14 @@ import classNames from 'classnames';
3
3
  import React__default from 'react';
4
4
  import { ComboBox as ComboBox$1, Label, Group, Input, Button, Popover, ListBox, Text, ListBoxItem, ListBoxSection, Header } from 'react-aria-components';
5
5
 
6
- function ComboBox({ allowsEmptyCollection, children, className, defaultInputValue, defaultItems, defaultValue, description, disabled, disabledKeys, filter, hideLabel, inputValue, invalid, items, label, menuTrigger, name, onChange, onInputChange, placeholder, readOnly, required, size = "md", value, ...restProps }) {
6
+ function ComboBox({ allowsEmptyCollection, children, className, defaultInputValue, defaultItems, defaultValue, description, disabled, disabledKeys, filter, hideLabel, inputValue, invalid, items, label, menuTrigger, name, onChange, onInputChange, placeholder, readOnly, required, selectionMode, size = "md", value, ...restProps }) {
7
7
  const combinedClassName = classNames("tds-combo-box", { "tds-combo-box--lg": size === "lg" }, className);
8
- return (React__default.createElement(ComboBox$1, { ...restProps, allowsEmptyCollection: allowsEmptyCollection, "aria-label": hideLabel ? label : undefined, className: combinedClassName, defaultFilter: filter, defaultInputValue: defaultInputValue, defaultItems: defaultItems, defaultValue: defaultValue, disabledKeys: disabledKeys, inputValue: inputValue, isDisabled: disabled, isInvalid: invalid, isReadOnly: readOnly, isRequired: required, items: items, menuTrigger: menuTrigger, name: name, onChange: onChange ?? undefined, onInputChange: onInputChange, value: value },
8
+ return (
9
+ // React Aria's ComboBox uses conditional generic types (ComboBoxProps<T, M>) to
10
+ // differentiate value/defaultValue/onChange/selectionMode per selection mode. Since
11
+ // our interface intentionally abstracts this detail, we bridge with targeted assertions
12
+ // on the four props that carry the selection-mode variance.
13
+ React__default.createElement(ComboBox$1, { ...restProps, allowsEmptyCollection: allowsEmptyCollection, "aria-label": hideLabel ? label : undefined, className: combinedClassName, defaultFilter: filter, defaultInputValue: defaultInputValue, defaultItems: defaultItems, defaultValue: defaultValue, disabledKeys: disabledKeys, inputValue: inputValue, isDisabled: disabled, isInvalid: invalid, isReadOnly: readOnly, isRequired: required, items: items, menuTrigger: menuTrigger, name: name, onChange: onChange, onInputChange: onInputChange, selectionMode: selectionMode, value: value },
9
14
  !hideLabel && React__default.createElement(Label, { className: "tds-combo-box-label" }, label),
10
15
  React__default.createElement(Group, { className: "tds-combo-box-field" },
11
16
  React__default.createElement(Input, { className: "tds-combo-box-input", placeholder: placeholder }),
@@ -1 +1 @@
1
- {"version":3,"file":"ComboBox.js","sources":["../../../src/components/combo-box/ComboBox.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport Icon from \"@utilities/Icon\"\nimport classNames from \"classnames\"\nimport React, { type AriaAttributes, type ReactNode } from \"react\"\nimport type {\n Key,\n ListBoxItemProps,\n ListBoxSectionProps,\n} from \"react-aria-components\"\nimport {\n Button,\n ComboBox as AriaComboBox,\n Group,\n Header,\n Input,\n Label,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Popover,\n Text,\n} from \"react-aria-components\"\n\nexport type ComboBoxSize = \"md\" | \"lg\"\n\nexport interface ComboBoxProps<T extends object = object> {\n /** Whether the combo box allows the menu to be open when the collection is empty. */\n allowsEmptyCollection?: boolean\n /** The children of the combo box (ComboBoxItem elements or a render function). */\n children: ReactNode | ((item: T) => ReactNode)\n /** The default uncontrolled value of the text input. */\n defaultInputValue?: string\n /** The default list of items (uncontrolled dynamic collection). */\n defaultItems?: Iterable<T>\n /** The default uncontrolled selected value. */\n defaultValue?: Key | null\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: string\n /** Disables the field and trigger button. */\n disabled?: boolean\n /** Item keys that are disabled and cannot be selected or focused. */\n disabledKeys?: Iterable<Key>\n /** Custom filter function for determining if an item should appear in the list. */\n filter?: (textValue: string, inputValue: string) => boolean\n /** If `true`, the `label` text is rendered as an `aria-label` instead of a visible label element. */\n hideLabel?: boolean\n /** The controlled value of the text input. */\n inputValue?: string\n /** Whether the input is in an invalid state. */\n invalid?: boolean\n /** The list of items (controlled dynamic collection). */\n items?: Iterable<T>\n /** Accessible label for the field. */\n label: string\n /** Controls when the listbox opens. */\n menuTrigger?: \"focus\" | \"input\" | \"manual\"\n /** Field name for form submission. */\n name?: string\n /** Called when the selected value changes. */\n onChange?: (value: Key | null) => void\n /** Called when the input text changes. */\n onInputChange?: (value: string) => void\n /** Placeholder text for the input. */\n placeholder?: string\n /** If `true`, allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk at the end of the label text. */\n required?: boolean\n /** The size of the combo box. */\n size?: ComboBoxSize\n /** The controlled selected value. */\n value?: Key | null\n}\n\nexport type ComboBoxElementProps<T extends object = object> = ComboBoxProps<T> &\n Omit<AriaAttributes, keyof ComboBoxProps<T>> & {\n className?: string\n id?: string\n }\n\nexport function ComboBox<T extends object>({\n allowsEmptyCollection,\n children,\n className,\n defaultInputValue,\n defaultItems,\n defaultValue,\n description,\n disabled,\n disabledKeys,\n filter,\n hideLabel,\n inputValue,\n invalid,\n items,\n label,\n menuTrigger,\n name,\n onChange,\n onInputChange,\n placeholder,\n readOnly,\n required,\n size = \"md\",\n value,\n ...restProps\n}: ComboBoxElementProps<T>) {\n const combinedClassName = classNames(\n \"tds-combo-box\",\n { \"tds-combo-box--lg\": size === \"lg\" },\n className\n )\n\n return (\n <AriaComboBox\n {...restProps}\n allowsEmptyCollection={allowsEmptyCollection}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultFilter={filter}\n defaultInputValue={defaultInputValue}\n defaultItems={defaultItems}\n defaultValue={defaultValue}\n disabledKeys={disabledKeys}\n inputValue={inputValue}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n items={items}\n menuTrigger={menuTrigger}\n name={name}\n onChange={onChange ?? undefined}\n onInputChange={onInputChange}\n value={value}\n >\n {!hideLabel && <Label className=\"tds-combo-box-label\">{label}</Label>}\n <Group className=\"tds-combo-box-field\">\n <Input className=\"tds-combo-box-input\" placeholder={placeholder} />\n <Button className=\"tds-combo-box-button\">\n <Icon aria-hidden symbol=\"general#down-caret\" />\n </Button>\n </Group>\n <Popover className=\"tds-combo-box-popover\">\n <ListBox className=\"tds-combo-box-list\">{children}</ListBox>\n </Popover>\n {description && (\n <Text className=\"tds-combo-box-description\" slot=\"description\">\n <Icon\n aria-hidden\n className=\"tds-combo-box-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaComboBox>\n )\n}\n\nexport function ComboBoxItem<T extends object>(props: ListBoxItemProps<T>) {\n return (\n <ListBoxItem\n {...props}\n className={classNames(\"tds-combo-box-list-item\", props.className)}\n />\n )\n}\n\ninterface ComboBoxSectionProps<T extends object>\n extends Omit<ListBoxSectionProps<T>, \"children\"> {\n children: ReactNode\n title?: string\n}\n\nexport function ComboBoxSection<T extends object>({\n children,\n title,\n ...props\n}: ComboBoxSectionProps<T>) {\n return (\n <ListBoxSection\n {...props}\n className={classNames(\"tds-combo-box-list-section\", props.className)}\n >\n {title && (\n <Header className=\"tds-combo-box-section-header\">{title}</Header>\n )}\n {children}\n </ListBoxSection>\n )\n}\n"],"names":["React","AriaComboBox"],"mappings":";;;;;AAiFM,SAAU,QAAQ,CAAmB,EACzC,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,SAAS,EACT,UAAU,EACV,OAAO,EACP,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,KAAK,EACL,GAAG,SAAS,EACY,EAAA;AACxB,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,eAAe,EACf,EAAE,mBAAmB,EAAE,IAAI,KAAK,IAAI,EAAE,EACtC,SAAS,CACV;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAACC,UAAY,OACP,SAAS,EACb,qBAAqB,EAAE,qBAAqB,gBAChC,SAAS,GAAG,KAAK,GAAG,SAAS,EACzC,SAAS,EAAE,iBAAiB,EAC5B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,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AW,OACN,KAAK,EACT,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,KAAK,CAAC,SAAS,CAAC,EAAA,CACjE;AAEN;AAQM,SAAU,eAAe,CAAmB,EAChD,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACgB,EAAA;AACxB,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAA,GACT,KAAK,EACT,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,KAAK,CAAC,SAAS,CAAC,EAAA;QAEnE,KAAK,KACJA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,8BAA8B,EAAA,EAAE,KAAK,CAAU,CAClE;QACA,QAAQ,CACM;AAErB;;;;"}
1
+ {"version":3,"file":"ComboBox.js","sources":["../../../src/components/combo-box/ComboBox.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport Icon from \"@utilities/Icon\"\nimport classNames from \"classnames\"\nimport React, { type AriaAttributes, type ReactNode } from \"react\"\nimport type {\n Key,\n ListBoxItemProps,\n ListBoxSectionProps,\n} from \"react-aria-components\"\nimport {\n Button,\n ComboBox as AriaComboBox,\n Group,\n Header,\n Input,\n Label,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Popover,\n Text,\n} from \"react-aria-components\"\n\nexport type ComboBoxSize = \"md\" | \"lg\"\n\nexport interface ComboBoxProps<T extends object = object> {\n /** Whether the combo box allows the menu to be open when the collection is empty. */\n allowsEmptyCollection?: boolean\n /** The children of the combo box (ComboBoxItem elements or a render function). */\n children: ReactNode | ((item: T) => ReactNode)\n /** The default uncontrolled value of the text input. */\n defaultInputValue?: string\n /** The default list of items (uncontrolled dynamic collection). */\n defaultItems?: Iterable<T>\n /**\n * The default uncontrolled selected value(s).\n * Pass a `Key[]` when `selectionMode` is `\"multiple\"`.\n */\n defaultValue?: Key | Key[] | null\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: string\n /** Disables the field and trigger button. */\n disabled?: boolean\n /** Item keys that are disabled and cannot be selected or focused. */\n disabledKeys?: Iterable<Key>\n /** Custom filter function for determining if an item should appear in the list. */\n filter?: (textValue: string, inputValue: string) => boolean\n /** If `true`, the `label` text is rendered as an `aria-label` instead of a visible label element. */\n hideLabel?: boolean\n /** The controlled value of the text input. */\n inputValue?: string\n /** Whether the input is in an invalid state. */\n invalid?: boolean\n /** The list of items (controlled dynamic collection). */\n items?: Iterable<T>\n /** Accessible label for the field. */\n label: string\n /** Controls when the listbox opens. */\n menuTrigger?: \"focus\" | \"input\" | \"manual\"\n /** Field name for form submission. */\n name?: string\n /**\n * Called when the selected value(s) change.\n * Receives `Key[]` when `selectionMode` is `\"multiple\"`, otherwise `Key | null`.\n */\n onChange?: ((value: Key | null) => void) | ((value: Key[]) => void)\n /** Called when the input text changes. */\n onInputChange?: (value: string) => void\n /** Placeholder text for the input. */\n placeholder?: string\n /** If `true`, allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk at the end of the label text. */\n required?: boolean\n /** Controls whether one or multiple items can be selected. Defaults to `\"single\"`. */\n selectionMode?: \"single\" | \"multiple\"\n /** The size of the combo box. */\n size?: ComboBoxSize\n /**\n * The controlled selected value(s).\n * Pass a `Key[]` when `selectionMode` is `\"multiple\"`.\n */\n value?: Key | Key[] | null\n}\n\nexport type ComboBoxElementProps<T extends object = object> = ComboBoxProps<T> &\n Omit<AriaAttributes, keyof ComboBoxProps<T>> & {\n className?: string\n id?: string\n }\n\nexport function ComboBox<T extends object>({\n allowsEmptyCollection,\n children,\n className,\n defaultInputValue,\n defaultItems,\n defaultValue,\n description,\n disabled,\n disabledKeys,\n filter,\n hideLabel,\n inputValue,\n invalid,\n items,\n label,\n menuTrigger,\n name,\n onChange,\n onInputChange,\n placeholder,\n readOnly,\n required,\n selectionMode,\n size = \"md\",\n value,\n ...restProps\n}: ComboBoxElementProps<T>) {\n const combinedClassName = classNames(\n \"tds-combo-box\",\n { \"tds-combo-box--lg\": size === \"lg\" },\n className\n )\n\n return (\n // React Aria's ComboBox uses conditional generic types (ComboBoxProps<T, M>) to\n // differentiate value/defaultValue/onChange/selectionMode per selection mode. Since\n // our interface intentionally abstracts this detail, we bridge with targeted assertions\n // on the four props that carry the selection-mode variance.\n <AriaComboBox\n {...restProps}\n allowsEmptyCollection={allowsEmptyCollection}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultFilter={filter}\n defaultInputValue={defaultInputValue}\n defaultItems={defaultItems}\n defaultValue={defaultValue as unknown as Key | null}\n disabledKeys={disabledKeys}\n inputValue={inputValue}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n items={items}\n menuTrigger={menuTrigger}\n name={name}\n onChange={onChange as unknown as (value: Key | null) => void}\n onInputChange={onInputChange}\n selectionMode={selectionMode as \"single\" | undefined}\n value={value as unknown as Key | null}\n >\n {!hideLabel && <Label className=\"tds-combo-box-label\">{label}</Label>}\n <Group className=\"tds-combo-box-field\">\n <Input className=\"tds-combo-box-input\" placeholder={placeholder} />\n <Button className=\"tds-combo-box-button\">\n <Icon aria-hidden symbol=\"general#down-caret\" />\n </Button>\n </Group>\n <Popover className=\"tds-combo-box-popover\">\n <ListBox className=\"tds-combo-box-list\">{children}</ListBox>\n </Popover>\n {description && (\n <Text className=\"tds-combo-box-description\" slot=\"description\">\n <Icon\n aria-hidden\n className=\"tds-combo-box-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaComboBox>\n )\n}\n\nexport function ComboBoxItem<T extends object>(props: ListBoxItemProps<T>) {\n return (\n <ListBoxItem\n {...props}\n className={classNames(\"tds-combo-box-list-item\", props.className)}\n />\n )\n}\n\ninterface ComboBoxSectionProps<T extends object>\n extends Omit<ListBoxSectionProps<T>, \"children\"> {\n children: ReactNode\n title?: string\n}\n\nexport function ComboBoxSection<T extends object>({\n children,\n title,\n ...props\n}: ComboBoxSectionProps<T>) {\n return (\n <ListBoxSection\n {...props}\n className={classNames(\"tds-combo-box-list-section\", props.className)}\n >\n {title && (\n <Header className=\"tds-combo-box-section-header\">{title}</Header>\n )}\n {children}\n </ListBoxSection>\n )\n}\n"],"names":["React","AriaComboBox"],"mappings":";;;;;AA4FM,SAAU,QAAQ,CAAmB,EACzC,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,SAAS,EACT,UAAU,EACV,OAAO,EACP,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,IAAI,GAAG,IAAI,EACX,KAAK,EACL,GAAG,SAAS,EACY,EAAA;AACxB,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,eAAe,EACf,EAAE,mBAAmB,EAAE,IAAI,KAAK,IAAI,EAAE,EACtC,SAAS,CACV;IAED;;;;;AAKE,IAAAA,cAAA,CAAA,aAAA,CAACC,UAAY,EAAA,EAAA,GACP,SAAS,EACb,qBAAqB,EAAE,qBAAqB,EAAA,YAAA,EAChC,SAAS,GAAG,KAAK,GAAG,SAAS,EACzC,SAAS,EAAE,iBAAiB,EAC5B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAqC,EACnD,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,QAAQ,EACpB,UAAU,EAAE,QAAQ,EACpB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAkD,EAC5D,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAqC,EACpD,KAAK,EAAE,KAA8B,EAA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,cAAc,EAAA,EAAA,GACT,KAAK,EACT,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,KAAK,CAAC,SAAS,CAAC,EAAA;QAEnE,KAAK,KACJA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,8BAA8B,EAAA,EAAE,KAAK,CAAU,CAClE;QACA,QAAQ,CACM;AAErB;;;;"}
package/dist/index.css CHANGED
@@ -1991,6 +1991,56 @@ a[class="tds-btn"]{
1991
1991
  border-radius:var(--t-border-radius-round);
1992
1992
  }
1993
1993
 
1994
+ .tds-btn--infield{
1995
+ --tds-btn-color:var(--t-text-color-status-neutral);
1996
+ --tds-btn-bg:var(--t-fill-color-button-neutral-solid);
1997
+ --tds-btn-border-color:var(--t-fill-color-button-neutral-solid);
1998
+ --tds-btn-color-hover:var(--t-text-color-status-neutral);
1999
+ --tds-btn-bg-hover:var(--t-fill-color-button-neutral-solid-hover);
2000
+ --tds-btn-border-color-hover:var(--t-fill-color-button-neutral-solid-hover);
2001
+ --tds-btn-color-active:var(--t-text-color-status-neutral);
2002
+ --tds-btn-bg-active:var(--t-fill-color-button-neutral-solid-active);
2003
+ --tds-btn-border-color-active:var(--t-fill-color-button-neutral-solid-active);
2004
+ --tds-btn-color-disabled:var(--t-text-color-disabled);
2005
+ --tds-btn-bg-disabled:var(--t-fill-color-button-neutral-solid-disabled);
2006
+ --tds-btn-border-color-disabled:var(--t-fill-color-button-neutral-solid-disabled);
2007
+ --tds-btn-padding-x:0;
2008
+ --tds-btn-padding-y:0;
2009
+ --tds-btn-font-size:.66lh;
2010
+ --tds-btn-min-height:auto;
2011
+ --tds-btn-border-width:var(--t-border-width);
2012
+
2013
+ aspect-ratio:1;
2014
+ cursor:pointer;
2015
+ }
2016
+
2017
+ .tds-btn--infield[data-hovered]:not([data-disabled]){
2018
+ color:var(--tds-btn-color-hover);
2019
+ background-color:var(--tds-btn-bg-hover);
2020
+ border-color:var(--tds-btn-border-color-hover);
2021
+ }
2022
+
2023
+ .tds-btn--infield[data-focus-visible]{
2024
+ color:var(--tds-btn-color-hover);
2025
+ outline:var(--t-focus-ring-outline);
2026
+ outline-offset:var(--t-focus-ring-offset);
2027
+ background-color:var(--tds-btn-bg-hover);
2028
+ border-color:var(--tds-btn-border-color-hover);
2029
+ }
2030
+
2031
+ .tds-btn--infield[data-pressed]:not([data-disabled]){
2032
+ color:var(--tds-btn-color-active);
2033
+ background-color:var(--tds-btn-bg-active);
2034
+ border-color:var(--tds-btn-border-color-active);
2035
+ }
2036
+
2037
+ .tds-btn--infield[data-disabled]{
2038
+ color:var(--tds-btn-color-disabled);
2039
+ pointer-events:none;
2040
+ background-color:var(--tds-btn-bg-disabled);
2041
+ border-color:var(--tds-btn-border-color-disabled);
2042
+ }
2043
+
1994
2044
  .tds-loading-spinner{
1995
2045
  --tds-loading-spinner-size:1.25em;
1996
2046