@narmi/design_system 6.19.9 → 6.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/index.js +24 -24
  2. package/dist/index.js.map +1 -1
  3. package/dist/types/AutocompleteModal/index.d.ts.map +1 -1
  4. package/dist/types/Chip/index.d.ts +1 -1
  5. package/dist/types/Chip/index.d.ts.map +1 -1
  6. package/dist/types/DateInput/index.d.ts +39 -0
  7. package/dist/types/DateInput/index.d.ts.map +1 -0
  8. package/dist/types/Drawer/index.d.ts +62 -0
  9. package/dist/types/Drawer/index.d.ts.map +1 -0
  10. package/dist/types/Drawer/useMountTransition.d.ts +9 -0
  11. package/dist/types/Drawer/useMountTransition.d.ts.map +1 -0
  12. package/dist/types/Input/index.d.ts +36 -0
  13. package/dist/types/Input/index.d.ts.map +1 -0
  14. package/dist/types/MenuButton/MenuButtonItem.d.ts +30 -0
  15. package/dist/types/MenuButton/MenuButtonItem.d.ts.map +1 -0
  16. package/dist/types/MenuButton/index.d.ts +61 -0
  17. package/dist/types/MenuButton/index.d.ts.map +1 -0
  18. package/dist/types/Popover/index.d.ts +63 -0
  19. package/dist/types/Popover/index.d.ts.map +1 -0
  20. package/dist/types/TableDateInput/index.d.ts +1 -1
  21. package/dist/types/TableDateInput/index.d.ts.map +1 -1
  22. package/dist/types/Tabs/TabsList.d.ts.map +1 -1
  23. package/dist/types/Tabs/TabsPanel.d.ts.map +1 -1
  24. package/dist/types/Tag/index.d.ts +27 -0
  25. package/dist/types/Tag/index.d.ts.map +1 -0
  26. package/dist/types/TextInput/index.d.ts +73 -0
  27. package/dist/types/TextInput/index.d.ts.map +1 -0
  28. package/dist/types/TokenInput/index.d.ts +41 -0
  29. package/dist/types/TokenInput/index.d.ts.map +1 -0
  30. package/dist/types/index.d.ts +17 -8
  31. package/dist/types/index.d.ts.map +1 -1
  32. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AutocompleteModal/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,MAAM,WAAW,sBAAsB;IACrC,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACpE,sCAAsC;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,uEAAuE;IACvE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,6DAA6D;IAC7D,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,iBAAiB;iFAOpB,sBAAsB;;;;;;;;;;;;;CAgDxB,CAAC;AAGF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AutocompleteModal/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,MAAM,WAAW,sBAAsB;IACrC,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACpE,sCAAsC;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,uEAAuE;IACvE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,6DAA6D;IAC7D,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,iBAAiB;iFAOpB,sBAAsB;;;;;;;;;;;;;CA+CxB,CAAC;AAGF,eAAe,iBAAiB,CAAC"}
@@ -19,7 +19,7 @@ export interface ChipProps {
19
19
  endIcon?: IconName;
20
20
  /** Displays a Count after the `label` */
21
21
  count?: string | number;
22
- /** Adds a border to the badege when `true` */
22
+ /** Adds a border to the badge when `true` */
23
23
  hasBorder?: boolean;
24
24
  /** Defines if the label is visible */
25
25
  isLabelVisible?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Chip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,eAAO,MAAM,WAAW,uEAOd,CAAC;AAEX,MAAM,WAAW,SAAS;IACxB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,IAAI,CAAC,EAAE,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;IACpC,iFAAiF;IACjF,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAChE;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAC9D,2CAA2C;IAC3C,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,yCAAyC;IACzC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,QAAA,MAAM,IAAI,GAAI,4FAUX,SAAS,sBAkEX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Chip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,eAAO,MAAM,WAAW,uEAOd,CAAC;AAEX,MAAM,WAAW,SAAS;IACxB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,IAAI,CAAC,EAAE,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;IACpC,iFAAiF;IACjF,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAChE;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAC9D,2CAA2C;IAC3C,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,yCAAyC;IACzC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,QAAA,MAAM,IAAI,GAAI,4FAUX,SAAS,sBAkEX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { SingleLineTextInputProps } from '../TextInput';
3
+ import { Options } from 'flatpickr/dist/types/options';
4
+ export interface DateInputProps extends Omit<SingleLineTextInputProps, "onChange" | "defaultValue"> {
5
+ /** Fired with 'YYYY-MM-DD' selected date string when selected date changes */
6
+ onChange?: (date: string) => void;
7
+ /** Disables dates. See [flatpickr docs](https://flatpickr.js.org/examples/#disabling-dates) for usage instructions */
8
+ disableDates?: Options["disable"];
9
+ /** Sets the minimum selectable date (inclusive) */
10
+ minDate?: string | Date;
11
+ /** Alternate date format to show in input when a date is selected (e.g. 'm/d/Y')*/
12
+ altFormat?: string;
13
+ /**
14
+ * When true, the input value will follow an alternate format defined by the `altFormat` prop
15
+ */
16
+ altInput?: boolean;
17
+ /**
18
+ * Sets a default selected date.
19
+ * DateInput uses the format 'YYYY-MM-DD' by default.
20
+ */
21
+ defaultDate?: string;
22
+ /** Changes date format used in input. See [flatpickr docs](https://flatpickr.js.org/formatting/) for formatting options */
23
+ dateFormat?: string;
24
+ /** If the `onChange` callback should pass the date string in ISO8601 format */
25
+ useIsoOnChange?: boolean;
26
+ /** Disable mobile text inputs on mobile web */
27
+ disableMobile?: boolean;
28
+ /** When true, appends the calendar popup to the parent of the input instead of to document body */
29
+ disablePortal?: boolean;
30
+ /** Custom render function for the input element (props, input, testId) => <TextInput {...props} /> */
31
+ renderInput?: (props: Omit<SingleLineTextInputProps, "onChange" | "defaultValue">, input: React.MutableRefObject<HTMLInputElement | undefined>, testId?: string) => ReactNode;
32
+ }
33
+ /**
34
+ * Single day picker.
35
+ * Composes NDS input with a [flatpickr](http://flatpickrjs.org) calendar UI.
36
+ */
37
+ declare const DateInput: ({ disableDates, minDate, dateFormat, altInput, altFormat, defaultDate, onChange: onChangeProp, useIsoOnChange, disableMobile, testId, disablePortal, renderInput, ...props }: DateInputProps) => React.JSX.Element;
38
+ export default DateInput;
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/DateInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAC5D,OAAkB,EAAE,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAI5D,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,wBAAwB,EACxB,UAAU,GAAG,cAAc,CAC5B;IACC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sHAAsH;IACtH,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2HAA2H;IAC3H,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mGAAmG;IACnG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sGAAsG;IACtG,WAAW,CAAC,EAAE,CACZ,KAAK,EAAE,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,cAAc,CAAC,EAClE,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,GAAG,SAAS,CAAC,EAC3D,MAAM,CAAC,EAAE,MAAM,KACZ,SAAS,CAAC;CAChB;AAQD;;;GAGG;AACH,QAAA,MAAM,SAAS,GAAI,8KAchB,cAAc,sBAoDhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { default as React } from 'react';
2
+ export interface DrawerProps {
3
+ /** Scrollable contents of the Drawer */
4
+ children: React.ReactNode | ((args: {
5
+ isVisible: boolean;
6
+ }) => React.ReactNode);
7
+ /** Controls open/close state of the modal. Use the `onUserDismiss` callback to update. */
8
+ isOpen?: boolean;
9
+ /**
10
+ * Callback to handle user taking an action to dismiss the modal
11
+ * (click outside, Escape key, click close button)
12
+ */
13
+ onUserDismiss?: () => void;
14
+ /**
15
+ * Callback to handle user taking an action to go to the next element
16
+ * (click on the next arrow, right/down arrow key).
17
+ * When omitted, the next arrow renders disabled.
18
+ */
19
+ onNext?: () => void;
20
+ /**
21
+ * Callback to handle user taking an action to go to the previous element
22
+ * (click on the previous arrow, left/up arrow key).
23
+ * When omitted, the previous arrow renders disabled.
24
+ */
25
+ onPrev?: () => void;
26
+ /**
27
+ * Sets how far the drawer opens out (width or height).
28
+ * Use the full CSS value with the percentage (e.g. `"400px"` or `"70%"`)
29
+ */
30
+ depth?: string;
31
+ /**
32
+ * Determines whether the close button shows.
33
+ */
34
+ showClose?: boolean;
35
+ /**
36
+ * Determines whether the next and prev buttons show.
37
+ */
38
+ showControls?: boolean;
39
+ /**
40
+ * Sets the position from which the drawers open.
41
+ * Valid values are `right`, `left`, `bottom`, `top`.
42
+ */
43
+ position?: "right" | "left" | "top" | "bottom";
44
+ /**
45
+ * Sets the padding amount, or disable padding by passing "none"
46
+ */
47
+ paddingSize?: "none" | "xs" | "s" | "m" | "l" | "xl" | "xxl";
48
+ /** Contents of Drawer footer, typically reserved for action buttons */
49
+ footer?: React.ReactNode;
50
+ /** Optional value for `data-testid` attribute */
51
+ testId?: string;
52
+ }
53
+ /**
54
+ * Renders an animated drawer dialog with an overlay that
55
+ * allows navigation between multiple contents
56
+ *
57
+ * This component uses a `ReactDOM` portal to render it as a direct
58
+ * child of `document.body`.
59
+ */
60
+ declare const Drawer: ({ isOpen, onUserDismiss, onNext, onPrev, showClose, showControls, children, position, depth, paddingSize, footer, testId, }: DrawerProps) => React.JSX.Element;
61
+ export default Drawer;
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Drawer/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAUxD,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,QAAQ,EACJ,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,IAAI,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACxD,0FAA0F;IAC1F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC/C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC;IAC7D,uEAAuE;IACvE,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,MAAM,GAAI,6HAab,WAAW,sBAmOb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Hook to allow transitioning a component when it enters or leaves the DOM. Based on Ryan Finni's
3
+ * article on https://letsbuildui.dev/articles/building-a-drawer-component-with-react-portals
4
+ * @param isMounted - whether the component is mounted
5
+ * @param unmountDelay - delay of animation in ms
6
+ */
7
+ declare const useMountTransition: (isMounted: boolean, unmountDelay: number) => boolean;
8
+ export default useMountTransition;
9
+ //# sourceMappingURL=useMountTransition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMountTransition.d.ts","sourceRoot":"","sources":["../../../src/Drawer/useMountTransition.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,GACtB,WAAW,OAAO,EAClB,cAAc,MAAM,KACnB,OAiBF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ export interface InputProps {
3
+ id?: string;
4
+ label?: string;
5
+ /** full `narmi-icon-<shape>` className for icon at start of input */
6
+ startIconClass?: string;
7
+ /** full `narmi-icon-<shape>` className for icon at end of input */
8
+ endIconClass?: string;
9
+ /** arbitrary JSX to place at the start of the input */
10
+ startContent?: ReactNode;
11
+ /** arbitrary JSX to place at the end of the input */
12
+ endContent?: ReactNode;
13
+ /** arbitrary JSX to place at the end of the subtitle/error */
14
+ tailContent?: ReactNode;
15
+ showClearButton?: boolean;
16
+ clearInput?: (event: React.MouseEvent) => void;
17
+ decoration?: ReactNode;
18
+ multiline?: boolean;
19
+ disabled?: boolean;
20
+ search?: boolean;
21
+ onClick?: (event: React.MouseEvent) => void;
22
+ style?: React.CSSProperties;
23
+ error?: string | string[] | null;
24
+ /** Gives consumers control over where to render the error when `false` */
25
+ renderError?: boolean;
26
+ children?: ReactNode;
27
+ }
28
+ /**
29
+ * PRIVATE
30
+ *
31
+ * This component has no stories because it is only used internally by NDS.
32
+ * In a future release, this base Input component will be merged with TextInput.
33
+ */
34
+ declare const Input: ({ id, label, startIconClass, endIconClass, startContent, endContent, tailContent, showClearButton, clearInput, disabled, multiline, decoration, error, search, onClick, style, renderError, children, }: InputProps) => React.JSX.Element;
35
+ export default Input;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Input/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAazC,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,qDAAqD;IACrD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC/C,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,QAAA,MAAM,KAAK,GAAI,yMAmBZ,UAAU,sBAmDZ,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { default as React } from 'react';
2
+ import { default as PropTypes } from 'prop-types';
3
+ import { VALID_ICON_NAMES } from '../icons/iconNames';
4
+ export { VALID_ICON_NAMES };
5
+ export interface MenuButtonItemProps {
6
+ /** Display label for menu item */
7
+ label: string;
8
+ /** Selection handler */
9
+ onSelect: () => void;
10
+ /** Optional start icon for menu item */
11
+ startIcon?: string;
12
+ /** Optional end icon for menu item */
13
+ endIcon?: string;
14
+ }
15
+ declare const MenuButtonItem: {
16
+ ({ label, startIcon, endIcon, onSelect, }: MenuButtonItemProps): React.JSX.Element;
17
+ propTypes: {
18
+ /** Display label for menu item */
19
+ label: PropTypes.Validator<string>;
20
+ /** Selection handler */
21
+ onSelect: PropTypes.Validator<(...args: any[]) => any>;
22
+ /** Optional start icon for menu item */
23
+ startIcon: PropTypes.Requireable<string>;
24
+ /** Optional end icon for menu item */
25
+ endIcon: PropTypes.Requireable<string>;
26
+ };
27
+ displayName: string;
28
+ };
29
+ export default MenuButtonItem;
30
+ //# sourceMappingURL=MenuButtonItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButtonItem.d.ts","sourceRoot":"","sources":["../../../src/MenuButton/MenuButtonItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,cAAc;+CAKjB,mBAAmB;;QAGpB,kCAAkC;;QAElC,wBAAwB;;QAExB,wCAAwC;;QAExC,sCAAsC;;;;CATR,CAAC;AAejC,eAAe,cAAc,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { default as React } from 'react';
2
+ import { VALID_ICON_NAMES } from '../icons/iconNames';
3
+ import { MenuButtonItemProps } from './MenuButtonItem';
4
+ import { Placement } from '../hooks/useDropdownLayer';
5
+ import { IconName } from '../types/Icon.types';
6
+ export { VALID_ICON_NAMES };
7
+ export declare const labelToItemId: (label: string) => string;
8
+ type MenuItemElement = React.ReactElement<MenuButtonItemProps>;
9
+ export interface MenuButtonProps {
10
+ /**
11
+ * Accessible label for the menu trigger (e.g. "Transaction Actions").
12
+ * Backs the trigger's `aria-label`; if omitted, it falls back to "Menu".
13
+ */
14
+ label?: string;
15
+ /** Optional value for `data-testid` attribute */
16
+ testId?: string;
17
+ /** Name of NDS icon to use as a trigger */
18
+ triggerIcon?: IconName;
19
+ /**
20
+ * The root node of JSX passed in acts as the menu trigger.
21
+ *
22
+ * @deprecated use `renderTrigger` instead.
23
+ */
24
+ trigger?: React.ReactNode;
25
+ /**
26
+ * Render function for rendering a custom trigger element.
27
+ * Called with `(isOpen)`, the open state of the menu.
28
+ */
29
+ renderTrigger?: (isOpen: boolean) => React.ReactNode;
30
+ /** MenuButton.Item children */
31
+ children?: React.ReactNode;
32
+ /**
33
+ * If true, a caret indicator is rendered as the end icon
34
+ * within the trigger. The icon will change direction when
35
+ * the expanded state of the menulist changes.
36
+ */
37
+ showDropdownIndicator?: boolean;
38
+ /** Sets preferred side of the trigger the tooltip should appear */
39
+ side?: Placement;
40
+ /** Optional footer content to render below the menu items */
41
+ footerItem?: MenuItemElement;
42
+ }
43
+ /**
44
+ * Keyboard navigable popover menu following the
45
+ * [WIA-ARIA "MenuButton" pattern](https://www.w3.org/TR/wai-aria-practices-1.2/#menubutton).
46
+ */
47
+ declare const MenuButton: {
48
+ ({ label, testId, trigger, renderTrigger, triggerIcon, showDropdownIndicator, side, children, footerItem, }: MenuButtonProps): React.JSX.Element;
49
+ Item: {
50
+ ({ label, startIcon, endIcon, onSelect, }: MenuButtonItemProps): React.JSX.Element;
51
+ propTypes: {
52
+ label: import('prop-types').Validator<string>;
53
+ onSelect: import('prop-types').Validator<(...args: any[]) => any>;
54
+ startIcon: import('prop-types').Requireable<string>;
55
+ endIcon: import('prop-types').Requireable<string>;
56
+ };
57
+ displayName: string;
58
+ };
59
+ };
60
+ export default MenuButton;
61
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/MenuButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAuB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WACD,CAAC;AAE3C,KAAK,eAAe,GAAG,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;IACrD,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED;;;GAGG;AACH,QAAA,MAAM,UAAU;iHAUb,eAAe;;;;;;;;;;;CA4HjB,CAAC;AAGF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { default as React } from 'react';
2
+ import { Placement } from '../hooks/useDropdownLayer';
3
+ export interface PopoverProps {
4
+ /** Content of popover */
5
+ content: React.ReactNode;
6
+ /**
7
+ * The root node of JSX passed into Tooltip as children will act as the tooltip trigger
8
+ *
9
+ * @deprecated use `renderTrigger` instead.
10
+ */
11
+ children?: React.ReactNode;
12
+ /**
13
+ * Render function for a custom trigger aware of the open state of the Popover.
14
+ * Called with `(isOpen) => {}`, the state of the Popover.
15
+ */
16
+ renderTrigger?: (isOpen?: boolean) => React.ReactNode;
17
+ /** Sets preferred side of the trigger the tooltip should appear */
18
+ side?: Placement;
19
+ /** CSS `display` value for the element that wraps the Tooltip children */
20
+ wrapperDisplay?: "inline-flex" | "inline-block" | "inline" | "block" | "flex";
21
+ /** When `true`, the Popover container will match the width of its triggering element */
22
+ matchTriggerWidth?: boolean;
23
+ /** Optional value for `data-testid` attribute */
24
+ testId?: string;
25
+ /** Close the popover if the User clicks on the content */
26
+ closeOnContentClick?: boolean;
27
+ /** If isOpen is set the component becomes a controlled component. Use the `onUserDismiss` callback to update. */
28
+ isOpen?: boolean;
29
+ /**
30
+ * Callback to handle user taking an action to __dismiss__ the popover
31
+ * (click outside, Escape key)
32
+ */
33
+ onUserDismiss?: () => void;
34
+ /**
35
+ * Callback to handle user taking an action to __enable__ the popover
36
+ * (click or key interaction on the trigger button rendered in Popover)
37
+ */
38
+ onUserEnable?: () => void;
39
+ /**
40
+ * When set to `true`, the first focusable element will automatically receive focus
41
+ * whenever the popover opens
42
+ */
43
+ autoFocus?: boolean;
44
+ /**
45
+ * When set to `false` the popover positioned element will not have a box shadow.
46
+ * Useful for adding a custom box shadow.
47
+ */
48
+ hasShadow?: boolean;
49
+ }
50
+ /**
51
+ * Generic Popover component. Renders a floating element that can contain any content,
52
+ * positioned relatively to its triggering element.
53
+ *
54
+ * This Popover only appears on "click" (focus + activate or mouse click) interactions.
55
+ * The Escape key and clicking outside of the Popover will dismiss it.
56
+ * For a hover-based informative popover, use `Tooltip`.
57
+ *
58
+ * The popover will position itself based on the `side` prop, but will
59
+ * automatically reposition to avoid collisions with viewport edges.
60
+ */
61
+ declare const Popover: ({ side, content, children, renderTrigger, wrapperDisplay, matchTriggerWidth, testId, closeOnContentClick, isOpen, autoFocus, hasShadow, onUserDismiss, onUserEnable, }: PopoverProps) => React.JSX.Element;
62
+ export default Popover;
63
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Popover/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;IACtD,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,aAAa,GAAG,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC9E,wFAAwF;IACxF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iHAAiH;IACjH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,OAAO,GAAI,wKAcd,YAAY,sBA0Hd,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -26,7 +26,7 @@ export interface TableDateInputProps {
26
26
  testId?: string;
27
27
  /** When true, appends the calendar popup to the parent of the input instead to document body */
28
28
  disablePortal?: boolean;
29
- /** Whether the input has an errorj */
29
+ /** Whether the input has an error */
30
30
  hasError?: boolean;
31
31
  }
32
32
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TableDateInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,mBAAmB;IAClC,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sHAAsH;IACtH,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC;IAChE,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2HAA2H;IAC3H,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,cAAc;sDAKjB,mBAAmB;;CA2BrB,CAAC;AAIF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TableDateInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,mBAAmB;IAClC,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sHAAsH;IACtH,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC;IAChE,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2HAA2H;IAC3H,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,cAAc;sDAKjB,mBAAmB;;CA2BrB,CAAC;AAIF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsList.d.ts","sourceRoot":"","sources":["../../../src/Tabs/TabsList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAMN,MAAM,OAAO,CAAC;AAef,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;SAGK;IACL,QAAQ,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,MAAM,CAAC;CAC3D;AAED,QAAA,MAAM,QAAQ,GAAI,wBAAiC,aAAa,sBAyM/D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"TabsList.d.ts","sourceRoot":"","sources":["../../../src/Tabs/TabsList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAMN,MAAM,OAAO,CAAC;AAwBf,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;SAGK;IACL,QAAQ,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,MAAM,CAAC;CAC3D;AAED,QAAA,MAAM,QAAQ,GAAI,wBAAiC,aAAa,sBA6M/D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabsPanel.d.ts","sourceRoot":"","sources":["../../../src/Tabs/TabsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,SAAS,GAAI,6BAA6B,cAAc,sBA4B7D,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"TabsPanel.d.ts","sourceRoot":"","sources":["../../../src/Tabs/TabsPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAGrD,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,SAAS,GAAI,6BAA6B,cAAc,sBA0B7D,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { default as React } from 'react';
2
+ export interface TagProps {
3
+ /** Variant of Tag. The "dismissible" kind is deprecated in favor of the dismissible property. */
4
+ kind?: "subdued" | "subdued-secondary" | "dismissible" | "outline" | "success" | "warn" | "error";
5
+ /**
6
+ * Callback for user dismissal action
7
+ * (only applicable for `dismissible` kind)
8
+ */
9
+ onDismiss?: () => void;
10
+ /** Whether the tag is dismissible */
11
+ dismissible?: boolean;
12
+ /** Label content of tag. */
13
+ label?: React.ReactNode;
14
+ /** Optional value for `data-testid` attribute */
15
+ testId?: string;
16
+ }
17
+ /**
18
+ * ⚠️ DEPRECATED - Will be removed in a future release. Use `Chip` instead.
19
+ *
20
+ * A rounded rectangle inline label.
21
+ * The user has the option of firing a callback for 'dismissible' Tags.
22
+ *
23
+ * @deprecated Will be removed in a future release. Use `Chip` instead.
24
+ */
25
+ declare const Tag: ({ kind, onDismiss, dismissible, label, testId, }: TagProps) => React.JSX.Element;
26
+ export default Tag;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Tag/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,QAAQ;IACvB,iGAAiG;IACjG,IAAI,CAAC,EACD,SAAS,GACT,mBAAmB,GACnB,aAAa,GACb,SAAS,GACT,SAAS,GACT,MAAM,GACN,OAAO,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,qCAAqC;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,GAAG,GAAI,kDAMV,QAAQ,sBAsBV,CAAC;AAEF,eAAe,GAAG,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { VALID_ICON_NAMES } from '../icons/iconNames';
3
+ import { IconName } from '../types/Icon.types';
4
+ export { VALID_ICON_NAMES };
5
+ type TextInputElement = HTMLInputElement | HTMLTextAreaElement;
6
+ interface TextInputBaseProps {
7
+ /**
8
+ * Label used as input placeholder _and_ floating label.
9
+ * Also wired to `aria-label` — when omitted, provide an accessible
10
+ * name some other way (e.g. `aria-label` or `aria-labelledby`).
11
+ */
12
+ label?: string;
13
+ /** Sets the controlled value of the input */
14
+ value?: string | number;
15
+ /** Sets the [uncontrolled](https://reactjs.org/docs/uncontrolled-components.html) value of the input */
16
+ defaultValue?: string | number;
17
+ /** function that formats the input value on blur */
18
+ formatter?: (value: string) => string;
19
+ /** Name of Narmi icon to place at the start of the input box */
20
+ startIcon?: IconName;
21
+ /** Name of Narmi icon to place at the end of the input box */
22
+ endIcon?: IconName;
23
+ /** JSX content slot at input start for custom buttons and icons */
24
+ startContent?: ReactNode;
25
+ /** JSX content slot at input end for custom buttons and icons */
26
+ endContent?: ReactNode;
27
+ /** Display an X at the end of label that clears input and calls onChange on click. */
28
+ showClearButton?: boolean;
29
+ /** Applies search styling to the input box (forwarded to the base Input) */
30
+ search?: boolean;
31
+ /** When false, the consumer can take full control over where the error renders */
32
+ renderError?: boolean;
33
+ /** Text of error message to display under the input */
34
+ error?: string | string[] | null;
35
+ /** Maximum number of characters allowed in the input */
36
+ maxLength?: number;
37
+ /** Optional value for `data-testid` attribute */
38
+ testId?: string;
39
+ /** Native `type` of the input element; ignored when `multiline` is set */
40
+ type?: "text" | "tel" | "number" | "email" | "password" | "search" | "time" | "date" | "datetime-local";
41
+ /** Native element prop passed to the underlying input/textarea element. Defaults to false. */
42
+ required?: boolean;
43
+ /**
44
+ * Form-integration key read by parent form wrappers (e.g. cerulean
45
+ * `ContextForm.Field`) via element props. Not used by this component
46
+ * and not forwarded to the DOM.
47
+ */
48
+ field?: string;
49
+ }
50
+ type OverriddenNativeKeys = "onChange" | "onBlur" | "type" | "value" | "defaultValue" | "children" | "maxLength" | "required";
51
+ export interface SingleLineTextInputProps extends TextInputBaseProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, OverriddenNativeKeys> {
52
+ /** When true, the input is displayed as an auto-growing textarea */
53
+ multiline?: false;
54
+ /** Callback invoked with event object on input change */
55
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
56
+ /** Callback invoked with event object on input blur */
57
+ onBlur?: React.FocusEventHandler<HTMLInputElement>;
58
+ }
59
+ export interface MultilineTextInputProps extends TextInputBaseProps, Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, OverriddenNativeKeys> {
60
+ /** When true, the input is displayed as an auto-growing textarea */
61
+ multiline: true;
62
+ /** Callback invoked with event object on textarea change */
63
+ onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
64
+ /** Callback invoked with event object on textarea blur */
65
+ onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
66
+ }
67
+ export type TextInputProps = SingleLineTextInputProps | MultilineTextInputProps;
68
+ /**
69
+ * Narmi flavored text input with floating label
70
+ */
71
+ declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<TextInputElement>>;
72
+ export default TextInput;
73
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TextInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,KAAK,gBAAgB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAE/D,UAAU,kBAAkB;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,oDAAoD;IACpD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,gEAAgE;IAChE,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,oEAAoE;IACpE,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,kEAAkE;IAClE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,sFAAsF;IACtF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kFAAkF;IAClF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,IAAI,CAAC,EACD,MAAM,GACN,KAAK,GACL,QAAQ,GACR,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,MAAM,GACN,gBAAgB,CAAC;IACrB,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD,KAAK,oBAAoB,GACrB,UAAU,GACV,QAAQ,GACR,MAAM,GACN,OAAO,GACP,cAAc,GACd,UAAU,GACV,WAAW,GACX,UAAU,CAAC;AAEf,MAAM,WAAW,wBACf,SACE,kBAAkB,EAClB,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACzE,oEAAoE;IACpE,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,uDAAuD;IACvD,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,uBACf,SACE,kBAAkB,EAClB,IAAI,CACF,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EACjD,oBAAoB,CACrB;IACH,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;IAChB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IACzD,0DAA0D;IAC1D,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;CACvD;AAED,MAAM,MAAM,cAAc,GAAG,wBAAwB,GAAG,uBAAuB,CAAC;AAyBhF;;GAEG;AACH,QAAA,MAAM,SAAS,yFA+Gd,CAAC;AAIF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { default as React } from 'react';
2
+ import { SingleLineTextInputProps } from '../TextInput';
3
+ export declare const createToken: (inputValue: string, delimiter: string) => string;
4
+ export interface TokenInputProps extends Omit<SingleLineTextInputProps, "onChange" | "value" | "label"> {
5
+ /** Label for input; also rendered as the fieldset legend */
6
+ label: string;
7
+ /**
8
+ * Name of input that holds the submission value.
9
+ * This should be the name of the field in the submitted form.
10
+ */
11
+ fieldName: string;
12
+ /**
13
+ * Value for the input with the given `name` prop.
14
+ * This should be the value of the field in the submitted form.
15
+ */
16
+ fieldValue: string;
17
+ /** Input change callback */
18
+ onInputChange?: (event: {
19
+ target: {
20
+ value: string;
21
+ };
22
+ }) => void;
23
+ /** Value of input element */
24
+ inputValue?: string;
25
+ /**
26
+ * Called with the list of selected tokens
27
+ * as the argument when user updates tokens list
28
+ */
29
+ onTokensChange?: (tokens: string[]) => void;
30
+ /** List of selected tokens by name */
31
+ tokens?: string[];
32
+ /** Delimiter users can enter to tokenize text */
33
+ delimiter?: string;
34
+ }
35
+ /**
36
+ * `TokenInput` is a **fully controlled** component used to show a list of "tokens"
37
+ * a user has entered into the accompanying text input.
38
+ */
39
+ declare const TokenInput: ({ fieldName, label, fieldValue, onInputChange, onTokensChange, inputValue, tokens, delimiter, disabled, ...otherProps }: TokenInputProps) => React.JSX.Element;
40
+ export default TokenInput;
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TokenInput/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAkB,EAAE,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAOxE,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,EAAE,WAAW,MAAM,WAGK,CAAC;AAEvE,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,wBAAwB,EACxB,UAAU,GAAG,OAAO,GAAG,OAAO,CAC/B;IACC,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/D,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,QAAA,MAAM,UAAU,GAAI,yHAWjB,eAAe,sBAoEjB,CAAC;AAEF,eAAe,UAAU,CAAC"}