@revikornmann/muka-ui 0.17.0 → 0.19.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.
- package/README.md +81 -60
- package/cli/bin/muka-ui.js +12 -5
- package/cli/commands/brand.js +33 -14
- package/cli/commands/init.js +21 -17
- package/cli/commands/install-skill.js +84 -26
- package/cli/templates/AGENTS.md +128 -0
- package/cli/templates/CLAUDE.md +8 -88
- package/cli/templates/muka-ui-guidelines.md +50 -14
- package/dist/cjs/components/ActionSheet/ActionSheet.js +1 -1
- package/dist/cjs/components/Breadcrumb/Breadcrumb.css +11 -3
- package/dist/cjs/components/Breadcrumb/Breadcrumb.js +19 -1
- package/dist/cjs/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/cjs/components/Combobox/Combobox.css +116 -132
- package/dist/cjs/components/Combobox/Combobox.js +175 -52
- package/dist/cjs/components/Combobox/Combobox.js.map +1 -1
- package/dist/cjs/components/Combobox/index.js.map +1 -1
- package/dist/cjs/components/ContextSelect/ContextSelect.css +117 -0
- package/dist/cjs/components/ContextSelect/ContextSelect.js +49 -0
- package/dist/cjs/components/ContextSelect/ContextSelect.js.map +1 -0
- package/dist/cjs/components/ContextSelect/index.js +11 -0
- package/dist/cjs/components/ContextSelect/index.js.map +1 -0
- package/dist/cjs/components/DropdownSelect/DropdownSelect.css +225 -0
- package/dist/cjs/components/DropdownSelect/DropdownSelect.js +106 -0
- package/dist/cjs/components/DropdownSelect/DropdownSelect.js.map +1 -0
- package/dist/cjs/components/DropdownSelect/index.js +6 -0
- package/dist/cjs/components/DropdownSelect/index.js.map +1 -0
- package/dist/cjs/components/Icon/custom/ArrowDropUpDownIcon.js +11 -0
- package/dist/cjs/components/Icon/custom/ArrowDropUpDownIcon.js.map +1 -0
- package/dist/cjs/components/Icon/custom/ArrowReturnIcon.js +11 -0
- package/dist/cjs/components/Icon/custom/ArrowReturnIcon.js.map +1 -0
- package/dist/cjs/components/Icon/iconRegistry.js +11 -0
- package/dist/cjs/components/Icon/iconRegistry.js.map +1 -1
- package/dist/cjs/components/Input/Input.css +45 -8
- package/dist/cjs/components/Input/Input.js +14 -3
- package/dist/cjs/components/Input/Input.js.map +1 -1
- package/dist/cjs/components/Menu/Menu.css +213 -17
- package/dist/cjs/components/Menu/Menu.js +429 -39
- package/dist/cjs/components/Menu/Menu.js.map +1 -1
- package/dist/cjs/components/Menu/index.js +5 -1
- package/dist/cjs/components/Menu/index.js.map +1 -1
- package/dist/cjs/components/ProgressTracker/ProgressTracker.css +273 -22
- package/dist/cjs/components/ProgressTracker/ProgressTracker.js +109 -9
- package/dist/cjs/components/ProgressTracker/ProgressTracker.js.map +1 -1
- package/dist/cjs/components/Scrollbar/Scrollbar.css +124 -0
- package/dist/cjs/components/Scrollbar/Scrollbar.js +118 -0
- package/dist/cjs/components/Scrollbar/Scrollbar.js.map +1 -0
- package/dist/cjs/components/Scrollbar/index.js +11 -0
- package/dist/cjs/components/Scrollbar/index.js.map +1 -0
- package/dist/cjs/components/index.js +13 -16
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/esm/components/ActionSheet/ActionSheet.js +1 -1
- package/dist/esm/components/Breadcrumb/Breadcrumb.css +11 -3
- package/dist/esm/components/Breadcrumb/Breadcrumb.js +19 -1
- package/dist/esm/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.css +116 -132
- package/dist/esm/components/Combobox/Combobox.js +177 -54
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Combobox/index.js +1 -1
- package/dist/esm/components/Combobox/index.js.map +1 -1
- package/dist/esm/components/ContextSelect/ContextSelect.css +117 -0
- package/dist/esm/components/ContextSelect/ContextSelect.js +45 -0
- package/dist/esm/components/ContextSelect/ContextSelect.js.map +1 -0
- package/dist/esm/components/ContextSelect/index.js +3 -0
- package/dist/esm/components/ContextSelect/index.js.map +1 -0
- package/dist/esm/components/DropdownSelect/DropdownSelect.css +225 -0
- package/dist/esm/components/DropdownSelect/DropdownSelect.js +102 -0
- package/dist/esm/components/DropdownSelect/DropdownSelect.js.map +1 -0
- package/dist/esm/components/DropdownSelect/index.js +2 -0
- package/dist/esm/components/DropdownSelect/index.js.map +1 -0
- package/dist/esm/components/Icon/custom/ArrowDropUpDownIcon.js +7 -0
- package/dist/esm/components/Icon/custom/ArrowDropUpDownIcon.js.map +1 -0
- package/dist/esm/components/Icon/custom/ArrowReturnIcon.js +7 -0
- package/dist/esm/components/Icon/custom/ArrowReturnIcon.js.map +1 -0
- package/dist/esm/components/Icon/iconRegistry.js +11 -0
- package/dist/esm/components/Icon/iconRegistry.js.map +1 -1
- package/dist/esm/components/Input/Input.css +45 -8
- package/dist/esm/components/Input/Input.js +14 -3
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Menu/Menu.css +213 -17
- package/dist/esm/components/Menu/Menu.js +428 -40
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/index.js +1 -1
- package/dist/esm/components/Menu/index.js.map +1 -1
- package/dist/esm/components/ProgressTracker/ProgressTracker.css +273 -22
- package/dist/esm/components/ProgressTracker/ProgressTracker.js +110 -10
- package/dist/esm/components/ProgressTracker/ProgressTracker.js.map +1 -1
- package/dist/esm/components/Scrollbar/Scrollbar.css +124 -0
- package/dist/esm/components/Scrollbar/Scrollbar.js +114 -0
- package/dist/esm/components/Scrollbar/Scrollbar.js.map +1 -0
- package/dist/esm/components/Scrollbar/index.js +3 -0
- package/dist/esm/components/Scrollbar/index.js.map +1 -0
- package/dist/esm/components/index.js +4 -2
- package/dist/esm/components/index.js.map +1 -1
- package/dist/styles/components/Breadcrumb.css +11 -3
- package/dist/styles/components/Combobox.css +116 -132
- package/dist/styles/components/ContextSelect.css +117 -0
- package/dist/styles/components/DropdownSelect.css +225 -0
- package/dist/styles/components/Input.css +45 -8
- package/dist/styles/components/Menu.css +213 -17
- package/dist/styles/components/ProgressTracker.css +273 -22
- package/dist/styles/components/Scrollbar.css +124 -0
- package/dist/styles/components/Typography.css +89 -0
- package/dist/styles/index.css +1526 -480
- package/dist/styles/muka-dark.css +1526 -480
- package/dist/styles/muka-light.css +1526 -480
- package/dist/styles/tokens-bouwplan-dark.css +9 -6
- package/dist/styles/tokens-bouwplan-light.css +9 -6
- package/dist/styles/tokens-fscl-dark.css +29 -26
- package/dist/styles/tokens-fscl-light.css +29 -26
- package/dist/styles/tokens-grip-dark.css +8 -5
- package/dist/styles/tokens-grip-light.css +8 -5
- package/dist/styles/tokens-muka-dark.css +8 -5
- package/dist/styles/tokens-muka-light.css +8 -5
- package/dist/styles/tokens-wireframe-dark.css +53 -50
- package/dist/styles/tokens-wireframe-light.css +53 -50
- package/dist/styles/wireframe-dark.css +1571 -525
- package/dist/styles/wireframe-light.css +1571 -525
- package/dist/types/components/ActionSheet/ActionSheet.d.ts +1 -1
- package/dist/types/components/Breadcrumb/Breadcrumb.d.ts +27 -3
- package/dist/types/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/components/Combobox/Combobox.d.ts +38 -38
- package/dist/types/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/components/Combobox/index.d.ts +1 -1
- package/dist/types/components/Combobox/index.d.ts.map +1 -1
- package/dist/types/components/ContextSelect/ContextSelect.d.ts +62 -0
- package/dist/types/components/ContextSelect/ContextSelect.d.ts.map +1 -0
- package/dist/types/components/ContextSelect/index.d.ts +3 -0
- package/dist/types/components/ContextSelect/index.d.ts.map +1 -0
- package/dist/types/components/DataTable/DataTable.d.ts +1 -1
- package/dist/types/components/DropdownSelect/DropdownSelect.d.ts +71 -0
- package/dist/types/components/DropdownSelect/DropdownSelect.d.ts.map +1 -0
- package/dist/types/components/DropdownSelect/index.d.ts +2 -0
- package/dist/types/components/DropdownSelect/index.d.ts.map +1 -0
- package/dist/types/components/Icon/custom/ArrowDropUpDownIcon.d.ts +9 -0
- package/dist/types/components/Icon/custom/ArrowDropUpDownIcon.d.ts.map +1 -0
- package/dist/types/components/Icon/custom/ArrowReturnIcon.d.ts +9 -0
- package/dist/types/components/Icon/custom/ArrowReturnIcon.d.ts.map +1 -0
- package/dist/types/components/Icon/iconRegistry.d.ts.map +1 -1
- package/dist/types/components/Input/Input.d.ts +5 -0
- package/dist/types/components/Input/Input.d.ts.map +1 -1
- package/dist/types/components/Menu/Menu.d.ts +99 -29
- package/dist/types/components/Menu/Menu.d.ts.map +1 -1
- package/dist/types/components/Menu/index.d.ts +2 -2
- package/dist/types/components/Menu/index.d.ts.map +1 -1
- package/dist/types/components/ProgressTracker/ProgressTracker.d.ts +29 -8
- package/dist/types/components/ProgressTracker/ProgressTracker.d.ts.map +1 -1
- package/dist/types/components/Scrollbar/Scrollbar.d.ts +19 -0
- package/dist/types/components/Scrollbar/Scrollbar.d.ts.map +1 -0
- package/dist/types/components/Scrollbar/index.d.ts +3 -0
- package/dist/types/components/Scrollbar/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +5 -4
- package/dist/types/components/index.d.ts.map +1 -1
- package/docs/consumers/README.md +116 -37
- package/docs/consumers/brand.md +261 -0
- package/docs/consumers/figma-console-mcp.md +116 -0
- package/docs/consumers/setup-instructions.md +98 -12
- package/docs/consumers/skills.md +79 -0
- package/package.json +4 -6
- package/scripts/postinstall-nudge.js +8 -4
- package/skills/add-brand/SKILL.md +204 -0
- package/skills/add-brand/reference.md +160 -0
- package/skills/figma-to-code/SKILL.md +127 -0
- package/skills/pull-from-figma/SKILL.md +123 -0
- package/skills/push-to-figma/SKILL.md +172 -0
- package/skills/setup-muka/SKILL.md +73 -13
- package/tokens/README.md +40 -18
- package/tokens/t2-alias/brand/bouwplan/fonts.json +1 -1
- package/tokens/t2-alias/brand/fscl/fonts.json +3 -3
- package/tokens/t2-alias/brand/wireframe/fonts.json +2 -2
- package/tokens/t4-components/menu.json +20 -5
- package/dist/cjs/components/ContextMenu/ContextMenu.js +0 -186
- package/dist/cjs/components/ContextMenu/ContextMenu.js.map +0 -1
- package/dist/cjs/components/ContextMenu/index.js +0 -17
- package/dist/cjs/components/ContextMenu/index.js.map +0 -1
- package/dist/esm/components/ContextMenu/ContextMenu.js +0 -145
- package/dist/esm/components/ContextMenu/ContextMenu.js.map +0 -1
- package/dist/esm/components/ContextMenu/index.js +0 -2
- package/dist/esm/components/ContextMenu/index.js.map +0 -1
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +0 -188
- package/dist/types/components/ContextMenu/ContextMenu.d.ts.map +0 -1
- package/dist/types/components/ContextMenu/index.d.ts +0 -3
- package/dist/types/components/ContextMenu/index.d.ts.map +0 -1
|
@@ -42,7 +42,7 @@ export interface ActionSheetProps {
|
|
|
42
42
|
/**
|
|
43
43
|
* ActionSheet — iOS-style action menu sliding up from the bottom.
|
|
44
44
|
*
|
|
45
|
-
* Built on `Sheet`. Use as the touch replacement for `
|
|
45
|
+
* Built on `Sheet`. Use as the touch replacement for `Menu` with `trigger="context"` and as the
|
|
46
46
|
* primary pattern for "options" menus on motorcycles, service records, etc.
|
|
47
47
|
*
|
|
48
48
|
* Each action's `onClick` runs, then the sheet auto-closes.
|
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type ContextSelectOption } from '../ContextSelect';
|
|
2
3
|
import './Breadcrumb.css';
|
|
3
4
|
export interface BreadcrumbItem {
|
|
4
|
-
/** Display label */
|
|
5
|
+
/** Display label (also used as ContextSelect label when `contextSelect` is set) */
|
|
5
6
|
label: string;
|
|
6
|
-
/** Link URL */
|
|
7
|
+
/** Link URL for plain crumbs, or ContextSelect label navigation */
|
|
7
8
|
href?: string;
|
|
8
|
-
/** Click handler */
|
|
9
|
+
/** Click handler for plain crumbs, or ContextSelect label navigation */
|
|
9
10
|
onClick?: () => void;
|
|
10
11
|
/** Optional icon */
|
|
11
12
|
icon?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* When set, this segment renders a ContextSelect:
|
|
15
|
+
* label navigates (href/onClick), chevron switches context via the menu.
|
|
16
|
+
*/
|
|
17
|
+
contextSelect?: {
|
|
18
|
+
options: ReadonlyArray<ContextSelectOption>;
|
|
19
|
+
value?: string;
|
|
20
|
+
onValueChange?: (value: string) => void;
|
|
21
|
+
/** Optional leading icon (falls back to `item.icon`) */
|
|
22
|
+
icon?: React.ReactNode;
|
|
23
|
+
searchable?: boolean;
|
|
24
|
+
searchPlaceholder?: string;
|
|
25
|
+
scrollbar?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
};
|
|
12
29
|
}
|
|
13
30
|
export interface BreadcrumbProps {
|
|
14
31
|
/** Breadcrumb items */
|
|
@@ -22,6 +39,13 @@ export interface BreadcrumbProps {
|
|
|
22
39
|
/** Additional CSS classes */
|
|
23
40
|
className?: string;
|
|
24
41
|
}
|
|
42
|
+
export type { ContextSelectOption };
|
|
43
|
+
/**
|
|
44
|
+
* Breadcrumb — hierarchical navigation.
|
|
45
|
+
*
|
|
46
|
+
* Supports plain link/button crumbs and **contextual** segments via
|
|
47
|
+
* `item.contextSelect` (ContextSelect: label → overview, chevron → switch).
|
|
48
|
+
*/
|
|
25
49
|
export declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
26
50
|
export default Breadcrumb;
|
|
27
51
|
//# sourceMappingURL=Breadcrumb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../../components/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,cAAc;IAC7B,
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../../components/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,kBAAkB,CAAC;AAE1B,MAAM,WAAW,cAAc;IAC7B,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oBAAoB;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE;QACd,OAAO,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;QAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACxC,wDAAwD;QACxD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgGhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Combobox.css';
|
|
3
3
|
export interface ComboboxOption {
|
|
4
|
-
/** Option value (
|
|
4
|
+
/** Option value (stored in the value array) */
|
|
5
5
|
value: string;
|
|
6
6
|
/** Visible label */
|
|
7
7
|
label: string;
|
|
8
|
-
/** Optional caption
|
|
8
|
+
/** Optional caption used for filtering */
|
|
9
9
|
caption?: string;
|
|
10
|
-
/** Optional leading icon */
|
|
11
|
-
icon?: React.ReactNode;
|
|
12
10
|
/** Disabled (non-selectable) */
|
|
13
11
|
disabled?: boolean;
|
|
14
12
|
}
|
|
15
13
|
export interface ComboboxProps {
|
|
16
|
-
/** Selected
|
|
17
|
-
value: string
|
|
18
|
-
/** Change handler
|
|
19
|
-
onChange: (value: string
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
/** Selected values (controlled). Each entry becomes a chip. */
|
|
15
|
+
value: string[];
|
|
16
|
+
/** Change handler for the selected values. */
|
|
17
|
+
onChange: (value: string[]) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Suggestion options. When `creatable` is true, values not in this list can
|
|
20
|
+
* still be committed as free-text chips.
|
|
21
|
+
*/
|
|
22
|
+
options?: ComboboxOption[];
|
|
23
|
+
/** Placeholder shown when empty and not typing. Default: 'Hint text' */
|
|
23
24
|
placeholder?: string;
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
clearable?: boolean;
|
|
34
|
-
/** Disabled state on the trigger */
|
|
25
|
+
/** Label text above the field */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Helper text below the field */
|
|
28
|
+
helperText?: string;
|
|
29
|
+
/** Error state */
|
|
30
|
+
error?: boolean;
|
|
31
|
+
/** Error message (shown when error is true) */
|
|
32
|
+
errorMessage?: string;
|
|
33
|
+
/** Disabled state */
|
|
35
34
|
disabled?: boolean;
|
|
36
|
-
/**
|
|
35
|
+
/** Size variant. Default: 'md' */
|
|
37
36
|
size?: 'sm' | 'md' | 'lg';
|
|
37
|
+
/** Full width */
|
|
38
|
+
fullWidth?: boolean;
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
+
* Allow committing typed values that are not in `options`.
|
|
41
|
+
* Default: true (Figma Input Combobox free-input).
|
|
42
|
+
*/
|
|
43
|
+
creatable?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Custom filter. Receives the option and the lowercased query.
|
|
40
46
|
* Defaults to substring match against `label` and `caption`.
|
|
41
47
|
*/
|
|
42
48
|
filter?: (option: ComboboxOption, query: string) => boolean;
|
|
43
|
-
/** Accessible label
|
|
49
|
+
/** Accessible label when there is no visible label */
|
|
44
50
|
'aria-label'?: string;
|
|
45
51
|
/** Form name */
|
|
46
52
|
name?: string;
|
|
47
53
|
/** HTML id */
|
|
48
54
|
id?: string;
|
|
49
|
-
/** Additional CSS classes on the
|
|
55
|
+
/** Additional CSS classes on the root */
|
|
50
56
|
className?: string;
|
|
51
57
|
}
|
|
52
58
|
/**
|
|
53
|
-
* Combobox —
|
|
54
|
-
*
|
|
55
|
-
* Mobile-first: tap the trigger to open a full sheet with a search input and a
|
|
56
|
-
* scrollable list of options. Works on desktop too — the sheet renders centered
|
|
57
|
-
* by the underlying Vaul drawer's responsive behavior.
|
|
59
|
+
* Combobox — free-input multi-value field with chips and a suggestion Menu.
|
|
58
60
|
*
|
|
59
|
-
*
|
|
61
|
+
* Matches Figma "Input Combobox": type in the field, pick a suggestion (or
|
|
62
|
+
* press Enter to create), and selected values render as dismissible chips.
|
|
63
|
+
* Uses `Menu` for the suggestion list (not a Sheet).
|
|
60
64
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* - The `clearable` control is a sibling `<button>`, not nested in the trigger:
|
|
64
|
-
* it is in the tab order, operable with Enter/Space, and its label stays out
|
|
65
|
-
* of the trigger's accessible name
|
|
66
|
-
* - Clearing returns focus to the trigger, since the clear button unmounts
|
|
65
|
+
* For fixed-option single/multi select with a chevron, use `DropdownSelect`.
|
|
66
|
+
* For a native platform select, use `Select`.
|
|
67
67
|
*/
|
|
68
68
|
export declare const Combobox: React.FC<ComboboxProps>;
|
|
69
69
|
export default Combobox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../components/Combobox/Combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../components/Combobox/Combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAQ3E,OAAO,gBAAgB,CAAC;AAExB,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,KAAK,EAAE,MAAM,EAAE,CAAC;IAEhB,8CAA8C;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAEpC;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAE3B,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,kCAAkC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1B,iBAAiB;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAE5D,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,cAAc;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+BD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA2T5C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Combobox, type ComboboxProps, type ComboboxOption
|
|
1
|
+
export { Combobox, type ComboboxProps, type ComboboxOption } from './Combobox';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/Combobox/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/Combobox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ContextSelect.css';
|
|
3
|
+
export interface ContextSelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ContextSelectProps {
|
|
9
|
+
/** Available contexts */
|
|
10
|
+
options: ReadonlyArray<ContextSelectOption>;
|
|
11
|
+
/** Controlled selected value */
|
|
12
|
+
value?: string;
|
|
13
|
+
/** Called when selection changes (instant context switch) */
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Trigger label. Defaults to the selected option's label, or the first option,
|
|
17
|
+
* or "Context".
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional leading icon before the label (16px / icon.size.xs).
|
|
22
|
+
* Omit to render label-only. Spaced 8px (spacing/2) from the label.
|
|
23
|
+
*/
|
|
24
|
+
icon?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Navigate when the label is clicked (context overview).
|
|
27
|
+
* Independent from the chevron menu trigger.
|
|
28
|
+
*/
|
|
29
|
+
href?: string;
|
|
30
|
+
/** Called when the label is activated (alternative to `href`) */
|
|
31
|
+
onLabelClick?: () => void;
|
|
32
|
+
/** Enable sticky search in the menu. Default: true */
|
|
33
|
+
searchable?: boolean;
|
|
34
|
+
/** Search placeholder. Default: 'Search' */
|
|
35
|
+
searchPlaceholder?: string;
|
|
36
|
+
/** Show custom scrollbar when the list overflows. Default: false */
|
|
37
|
+
scrollbar?: boolean;
|
|
38
|
+
/** Controlled open state */
|
|
39
|
+
open?: boolean;
|
|
40
|
+
/** Called when open state changes */
|
|
41
|
+
onOpenChange?: (open: boolean) => void;
|
|
42
|
+
/** Default open state */
|
|
43
|
+
defaultOpen?: boolean;
|
|
44
|
+
/** Disable the control */
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/** Accessible name for the chevron menu button */
|
|
47
|
+
'aria-label'?: string;
|
|
48
|
+
/** Additional CSS classes on the root */
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* ContextSelect — split control for contextual navigation.
|
|
53
|
+
*
|
|
54
|
+
* - **Label** (and icon): navigates to the context overview (`href` / `onLabelClick`)
|
|
55
|
+
* - **Chevron button**: opens a searchable single-select menu to switch context instantly
|
|
56
|
+
*
|
|
57
|
+
* Designed to compose inside Breadcrumb (contextual breadcrumb).
|
|
58
|
+
* Not a form Select — use `Select` / `Combobox` for forms.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ContextSelect: React.FC<ContextSelectProps>;
|
|
61
|
+
export default ContextSelect;
|
|
62
|
+
//# sourceMappingURL=ContextSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextSelect.d.ts","sourceRoot":"","sources":["../../../../components/ContextSelect/ContextSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAUjD,OAAO,qBAAqB,CAAC;AAE7B,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,yBAAyB;IACzB,OAAO,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC5C,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qCAAqC;IACrC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,yBAAyB;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmItD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/ContextSelect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -97,7 +97,7 @@ export interface DataTableProps<T> {
|
|
|
97
97
|
isRowDisabled?: (row: T, index: number) => boolean;
|
|
98
98
|
/**
|
|
99
99
|
* Render a trailing action for each row (a `Button`, an icon-only `Button`,
|
|
100
|
-
* or a `
|
|
100
|
+
* or a `Menu` trigger). Rendered in a pinned trailing column;
|
|
101
101
|
* clicks on it never trigger the row click/href.
|
|
102
102
|
*/
|
|
103
103
|
rowAction?: (row: T, index: number) => React.ReactNode;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './DropdownSelect.css';
|
|
3
|
+
export interface DropdownSelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DropdownSelectProps {
|
|
9
|
+
/** Fixed options shown in the menu */
|
|
10
|
+
options: ReadonlyArray<DropdownSelectOption>;
|
|
11
|
+
/**
|
|
12
|
+
* Selected value(s). Pass a string for single-select, or `string[]` when
|
|
13
|
+
* `multiple` is true.
|
|
14
|
+
*/
|
|
15
|
+
value?: string | string[];
|
|
16
|
+
/** Called when the selection changes */
|
|
17
|
+
onValueChange?: (value: string | string[]) => void;
|
|
18
|
+
/** Enable multi-select with chips in the field. Default: false */
|
|
19
|
+
multiple?: boolean;
|
|
20
|
+
/** Placeholder when nothing is selected. Default: 'Select item...' */
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/** Label text above the field */
|
|
23
|
+
label?: string;
|
|
24
|
+
/** Helper text below the field */
|
|
25
|
+
helperText?: string;
|
|
26
|
+
/** Error state */
|
|
27
|
+
error?: boolean;
|
|
28
|
+
/** Error message (shown when error is true) */
|
|
29
|
+
errorMessage?: string;
|
|
30
|
+
/** Disabled state */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Size variant */
|
|
33
|
+
size?: 'sm' | 'md' | 'lg';
|
|
34
|
+
/** Full width */
|
|
35
|
+
fullWidth?: boolean;
|
|
36
|
+
/** Required field */
|
|
37
|
+
required?: boolean;
|
|
38
|
+
/** Show sticky search in the menu. Default: true */
|
|
39
|
+
searchable?: boolean;
|
|
40
|
+
/** Search placeholder. Default: 'Search' */
|
|
41
|
+
searchPlaceholder?: string;
|
|
42
|
+
/** Show the custom Figma scrollbar when the list overflows. Default: false */
|
|
43
|
+
scrollbar?: boolean;
|
|
44
|
+
/** Controlled open state */
|
|
45
|
+
open?: boolean;
|
|
46
|
+
/** Called when open state changes */
|
|
47
|
+
onOpenChange?: (open: boolean) => void;
|
|
48
|
+
/** Default open state */
|
|
49
|
+
defaultOpen?: boolean;
|
|
50
|
+
/** HTML name attribute */
|
|
51
|
+
name?: string;
|
|
52
|
+
/** HTML id */
|
|
53
|
+
id?: string;
|
|
54
|
+
/** Accessible label when there is no visible label */
|
|
55
|
+
'aria-label'?: string;
|
|
56
|
+
/** Additional CSS classes on the root */
|
|
57
|
+
className?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* DropdownSelect — form select built on Menu (Figma "Dropdown Menu").
|
|
61
|
+
*
|
|
62
|
+
* Fixed options with optional search + scrollbar. Single-select shows the
|
|
63
|
+
* chosen label; multi-select renders dismissible chips and trailing checkmarks
|
|
64
|
+
* in the menu.
|
|
65
|
+
*
|
|
66
|
+
* Not the native `<Select>` — use that for simple platform-native fields.
|
|
67
|
+
* Not free-text — use `Combobox` for creatable chip input.
|
|
68
|
+
*/
|
|
69
|
+
export declare const DropdownSelect: React.FC<DropdownSelectProps>;
|
|
70
|
+
export default DropdownSelect;
|
|
71
|
+
//# sourceMappingURL=DropdownSelect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownSelect.d.ts","sourceRoot":"","sources":["../../../../components/DropdownSelect/DropdownSelect.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAY3E,OAAO,sBAAsB,CAAC;AAE9B,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAE7C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE1B,wCAAwC;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAEnD,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,mBAAmB;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1B,iBAAiB;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,8EAA8E;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,qCAAqC;IACrC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC,yBAAyB;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,cAAc;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyPxD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/DropdownSelect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Custom icon from Figma: arrow-drop-up-down-line (node 5578:7253).
|
|
4
|
+
* Combined drop-up + drop-down carets — not available as a single Remix glyph.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ArrowDropUpDownIcon: React.FC<{
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=ArrowDropUpDownIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowDropUpDownIcon.d.ts","sourceRoot":"","sources":["../../../../../components/Icon/custom/ArrowDropUpDownIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAmBhE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Custom icon from Figma: arrow-return (Dropdown Menu Item focus / Combobox enter hint).
|
|
4
|
+
* Rounded return/enter glyph — not available as a single Remix export.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ArrowReturnIcon: React.FC<{
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=ArrowReturnIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowReturnIcon.d.ts","sourceRoot":"","sources":["../../../../../components/Icon/custom/ArrowReturnIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAe5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconRegistry.d.ts","sourceRoot":"","sources":["../../../../components/Icon/iconRegistry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"iconRegistry.d.ts","sourceRoot":"","sources":["../../../../components/Icon/iconRegistry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD,CAAC;AAiBF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAM,CAAC;AAoElE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,MAAM,GAAG,MAAM,GACvB,KAAK,CAAC,aAAa,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAI7C"}
|
|
@@ -25,6 +25,11 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
25
25
|
iconLeft?: React.ReactNode;
|
|
26
26
|
/** Icon for right side */
|
|
27
27
|
iconRight?: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Show a trailing clear button while the field has a value (Figma Typing / Filled).
|
|
30
|
+
* Requires a controlled `value`.
|
|
31
|
+
*/
|
|
32
|
+
clearable?: boolean;
|
|
28
33
|
/** Full width input */
|
|
29
34
|
fullWidth?: boolean;
|
|
30
35
|
/** Additional CSS classes (applied to the wrapper, not the native input) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../components/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../components/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAGvD,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,UACf,SAAQ,IAAI,CACV,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,MAAM,GAAG,MAAM,GAAG,UAAU,CAC7B;IACD,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qBAAqB;IACrB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE5D,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,kBAAkB;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE1B,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;IAE3E,yBAAyB;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,0BAA0B;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,uBAAuB;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,kEAAkE;IAClE,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEzD,4DAA4D;IAC5D,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC3D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,qFA6KhB,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -1,80 +1,121 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Menu.css';
|
|
3
|
+
export type MenuTriggerMode = 'click' | 'context';
|
|
4
|
+
interface MenuSearchContextValue {
|
|
5
|
+
query: string;
|
|
6
|
+
setQuery: (query: string) => void;
|
|
7
|
+
searchable: boolean;
|
|
8
|
+
/** Id of the item highlighted for search-field arrow/Enter navigation. */
|
|
9
|
+
highlightedId: string | null;
|
|
10
|
+
registerSearchNavItem: (item: SearchNavItem) => () => void;
|
|
11
|
+
moveHighlight: (delta: number) => void;
|
|
12
|
+
selectHighlighted: () => void;
|
|
13
|
+
}
|
|
14
|
+
type SearchNavItem = {
|
|
15
|
+
id: string;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
select: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare function useMenuSearch(): MenuSearchContextValue;
|
|
20
|
+
/** Bold the first case-insensitive match of `query` within `text`. */
|
|
21
|
+
export declare function highlightMenuMatch(text: string, query: string): React.ReactNode;
|
|
3
22
|
export interface MenuProps {
|
|
4
23
|
/** Menu content */
|
|
5
24
|
children: React.ReactNode;
|
|
6
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* How the menu opens:
|
|
27
|
+
* - `click` — button / pointer click (Radix DropdownMenu)
|
|
28
|
+
* - `context` — right-click / long-press context menu
|
|
29
|
+
*/
|
|
30
|
+
trigger?: MenuTriggerMode;
|
|
31
|
+
/** Controlled open state (click trigger only; context menus are pointer-driven) */
|
|
7
32
|
open?: boolean;
|
|
8
33
|
/** Called when the open state changes */
|
|
9
34
|
onOpenChange?: (open: boolean) => void;
|
|
10
|
-
/** Default open state for uncontrolled usage */
|
|
35
|
+
/** Default open state for uncontrolled usage (click trigger) */
|
|
11
36
|
defaultOpen?: boolean;
|
|
12
37
|
/** Modal behavior - if true, interactions outside will close the menu */
|
|
13
38
|
modal?: boolean;
|
|
14
39
|
}
|
|
15
40
|
/**
|
|
16
|
-
* Menu
|
|
17
|
-
*
|
|
18
|
-
* A dropdown menu for displaying actions and options.
|
|
19
|
-
* Built on Radix UI DropdownMenu for accessibility and keyboard navigation.
|
|
41
|
+
* Menu (Dropdown Menu)
|
|
20
42
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* <Menu>
|
|
24
|
-
* <MenuTrigger asChild>
|
|
25
|
-
* <Button>Open Menu</Button>
|
|
26
|
-
* </MenuTrigger>
|
|
27
|
-
* <MenuContent>
|
|
28
|
-
* <MenuItem onSelect={() => console.log('Edit')}>Edit</MenuItem>
|
|
29
|
-
* <MenuItem onSelect={() => console.log('Delete')} destructive>Delete</MenuItem>
|
|
30
|
-
* </MenuContent>
|
|
31
|
-
* </Menu>
|
|
32
|
-
* ```
|
|
43
|
+
* Shared action-menu surface for click and right-click triggers.
|
|
44
|
+
* Built on Radix DropdownMenu / ContextMenu.
|
|
33
45
|
*/
|
|
34
46
|
export declare const Menu: React.FC<MenuProps>;
|
|
47
|
+
/** Alias for Figma / docs naming parity with "Dropdown Menu". */
|
|
48
|
+
export declare const DropdownMenu: React.FC<MenuProps>;
|
|
35
49
|
export interface MenuTriggerProps {
|
|
36
50
|
/** Trigger element */
|
|
37
51
|
children: React.ReactNode;
|
|
38
52
|
/** Merge trigger props onto child element instead of wrapping */
|
|
39
53
|
asChild?: boolean;
|
|
54
|
+
/** Disable the trigger (context menus) */
|
|
55
|
+
disabled?: boolean;
|
|
40
56
|
/** Additional CSS classes */
|
|
41
57
|
className?: string;
|
|
42
58
|
}
|
|
43
59
|
/**
|
|
44
|
-
* MenuTrigger
|
|
60
|
+
* MenuTrigger — opens the menu on click or right-click depending on `Menu.trigger`.
|
|
45
61
|
*/
|
|
46
62
|
export declare const MenuTrigger: React.ForwardRefExoticComponent<MenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
47
63
|
export interface MenuContentProps {
|
|
48
64
|
/** Menu items */
|
|
49
65
|
children: React.ReactNode;
|
|
50
|
-
/** Horizontal alignment relative to trigger */
|
|
66
|
+
/** Horizontal alignment relative to trigger (click mode) */
|
|
51
67
|
align?: 'start' | 'center' | 'end';
|
|
52
|
-
/** Side of the trigger to render on */
|
|
68
|
+
/** Side of the trigger to render on (click mode) */
|
|
53
69
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
54
|
-
/** Distance from the trigger */
|
|
70
|
+
/** Distance from the trigger (click mode) */
|
|
55
71
|
sideOffset?: number;
|
|
56
72
|
/** Distance from the alignment edge */
|
|
57
73
|
alignOffset?: number;
|
|
58
74
|
/** Additional CSS classes */
|
|
59
75
|
className?: string;
|
|
76
|
+
/** Inline styles (e.g. match a field width that is not the trigger) */
|
|
77
|
+
style?: React.CSSProperties;
|
|
60
78
|
/** Whether to loop focus within the menu */
|
|
61
79
|
loop?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Called when the menu opens and would move focus into the content.
|
|
82
|
+
* Call `event.preventDefault()` to leave focus where it is (e.g. Combobox input).
|
|
83
|
+
*/
|
|
84
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
62
85
|
/**
|
|
63
86
|
* Called when focus returns to the trigger after the menu closes.
|
|
64
|
-
* Call `event.preventDefault()` to leave focus where it is
|
|
65
|
-
* trigger is a hover-only affordance that should not stay revealed.
|
|
87
|
+
* Call `event.preventDefault()` to leave focus where it is.
|
|
66
88
|
*/
|
|
67
89
|
onCloseAutoFocus?: (event: Event) => void;
|
|
90
|
+
/** Enable search context for MenuSearch + item filtering */
|
|
91
|
+
searchable?: boolean;
|
|
92
|
+
/** Show the custom Figma scrollbar when content overflows */
|
|
93
|
+
scrollbar?: boolean;
|
|
94
|
+
}
|
|
95
|
+
export declare const MenuContent: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
96
|
+
export interface MenuSearchProps {
|
|
97
|
+
/** Placeholder text */
|
|
98
|
+
placeholder?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Matches inputfield content sizes.
|
|
101
|
+
* `md` — 20px search/clear in a 32px slot. `sm` — 16px in a 24px slot.
|
|
102
|
+
*/
|
|
103
|
+
size?: 'sm' | 'md';
|
|
104
|
+
/** Additional CSS classes */
|
|
105
|
+
className?: string;
|
|
106
|
+
/** Accessible label */
|
|
107
|
+
'aria-label'?: string;
|
|
68
108
|
}
|
|
69
109
|
/**
|
|
70
|
-
*
|
|
110
|
+
* MenuSearch — sticky search header for filtering menu items.
|
|
111
|
+
* Must be used inside a `MenuContent` with `searchable`.
|
|
71
112
|
*/
|
|
72
|
-
export declare const
|
|
113
|
+
export declare const MenuSearch: React.ForwardRefExoticComponent<MenuSearchProps & React.RefAttributes<HTMLInputElement>>;
|
|
73
114
|
export interface MenuItemProps {
|
|
74
115
|
/** Item content */
|
|
75
116
|
children: React.ReactNode;
|
|
76
117
|
/** Called when the item is selected */
|
|
77
|
-
onSelect?: () => void;
|
|
118
|
+
onSelect?: (event: Event) => void;
|
|
78
119
|
/** Disables the item */
|
|
79
120
|
disabled?: boolean;
|
|
80
121
|
/** Renders as a destructive/danger action */
|
|
@@ -83,8 +124,22 @@ export interface MenuItemProps {
|
|
|
83
124
|
icon?: React.ReactNode;
|
|
84
125
|
/** Keyboard shortcut to display */
|
|
85
126
|
shortcut?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Trailing affordance shown while highlighted (Figma Combobox suggestions).
|
|
129
|
+
* `enter` renders the custom arrow-return icon on the highlighted row.
|
|
130
|
+
*/
|
|
131
|
+
hint?: 'enter';
|
|
132
|
+
/**
|
|
133
|
+
* Force the hover/highlighted styles (and enter hint) without moving DOM focus.
|
|
134
|
+
* Used by Combobox while the caret stays in the text field.
|
|
135
|
+
*/
|
|
136
|
+
highlighted?: boolean;
|
|
137
|
+
/** DOM id (e.g. for aria-activedescendant from a Combobox input) */
|
|
138
|
+
id?: string;
|
|
86
139
|
/** Additional CSS classes */
|
|
87
140
|
className?: string;
|
|
141
|
+
/** Override text used for search filtering / highlighting */
|
|
142
|
+
textValue?: string;
|
|
88
143
|
}
|
|
89
144
|
/**
|
|
90
145
|
* MenuItem - An action item within the menu
|
|
@@ -121,12 +176,19 @@ export interface MenuCheckboxItemProps {
|
|
|
121
176
|
disabled?: boolean;
|
|
122
177
|
/**
|
|
123
178
|
* Icon to display before the label, in the same column as `MenuItem`'s icon.
|
|
124
|
-
*
|
|
125
|
-
* and checkable items keeps one icon column.
|
|
179
|
+
* When set, the checkmark moves to the end of the row.
|
|
126
180
|
*/
|
|
127
181
|
icon?: React.ReactNode;
|
|
182
|
+
/**
|
|
183
|
+
* Checkmark placement:
|
|
184
|
+
* - `leading` — start of the row (default)
|
|
185
|
+
* - `trailing` — end of the row (Figma Dropdown Menu multiselect)
|
|
186
|
+
*/
|
|
187
|
+
indicator?: 'leading' | 'trailing';
|
|
128
188
|
/** Additional CSS classes */
|
|
129
189
|
className?: string;
|
|
190
|
+
/** Override text used for search filtering / highlighting */
|
|
191
|
+
textValue?: string;
|
|
130
192
|
}
|
|
131
193
|
/**
|
|
132
194
|
* MenuCheckboxItem - A checkable menu item
|
|
@@ -155,6 +217,14 @@ export interface MenuRadioItemProps {
|
|
|
155
217
|
disabled?: boolean;
|
|
156
218
|
/** Additional CSS classes */
|
|
157
219
|
className?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Indicator style:
|
|
222
|
+
* - `dot` — classic leading radio dot (default)
|
|
223
|
+
* - `check` — trailing check + selected background (Context Select)
|
|
224
|
+
*/
|
|
225
|
+
indicator?: 'dot' | 'check';
|
|
226
|
+
/** Override text used for search filtering / highlighting */
|
|
227
|
+
textValue?: string;
|
|
158
228
|
}
|
|
159
229
|
/**
|
|
160
230
|
* MenuRadioItem - A radio option within a MenuRadioGroup
|