banhatten-ui 0.1.2 → 0.2.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/dist/CURSOR_RULE.md +106 -0
- package/dist/specs/accordion.json +115 -0
- package/dist/specs/alert.json +178 -0
- package/dist/specs/avatar-group.json +91 -0
- package/dist/specs/avatar-profile.json +65 -0
- package/dist/specs/avatar.json +87 -0
- package/dist/specs/badge.json +142 -0
- package/dist/specs/breadcrumb.json +160 -0
- package/dist/specs/button-group.json +91 -0
- package/dist/specs/button.json +110 -0
- package/dist/specs/checkbox-card.json +120 -0
- package/dist/specs/checkbox.json +69 -0
- package/dist/specs/close-button.json +64 -0
- package/dist/specs/divider.json +32 -0
- package/dist/specs/dropdown-input.json +87 -0
- package/dist/specs/dropdown.json +71 -0
- package/dist/specs/featured-icon.json +80 -0
- package/dist/specs/icon.json +48 -0
- package/dist/specs/input.json +81 -0
- package/dist/specs/menu.json +135 -0
- package/dist/specs/progress-bar.json +104 -0
- package/dist/specs/radio-card.json +111 -0
- package/dist/specs/radio.json +64 -0
- package/dist/specs/sidebar.json +254 -0
- package/dist/specs/slider.json +91 -0
- package/dist/specs/tag.json +104 -0
- package/dist/specs/textarea.json +63 -0
- package/dist/specs/toggle.json +79 -0
- package/dist/specs/tooltip.json +78 -0
- package/package.json +4 -2
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Checkbox",
|
|
3
|
+
"description": "Checkbox input with optional label and support text. Supports checked, unchecked, and indeterminate states.",
|
|
4
|
+
|
|
5
|
+
"base": {
|
|
6
|
+
"display": "inline-flex",
|
|
7
|
+
"gap": "{spacing.md}",
|
|
8
|
+
"cursor": "pointer"
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
"indicator": {
|
|
12
|
+
"size": "16px",
|
|
13
|
+
"outerSize": "20px",
|
|
14
|
+
"borderRadius": "{radius.xs}",
|
|
15
|
+
"unchecked": {
|
|
16
|
+
"bg": "{alias.bg-primary}",
|
|
17
|
+
"border": { "width": "1px", "color": "{alias.border-strong}" }
|
|
18
|
+
},
|
|
19
|
+
"checked": {
|
|
20
|
+
"bg": "{alias.bg-brand}",
|
|
21
|
+
"hover": { "bg": "{alias.bg-brand-hover}" },
|
|
22
|
+
"iconColor": "{alias.icon-primary-inverse}",
|
|
23
|
+
"icon": "check"
|
|
24
|
+
},
|
|
25
|
+
"indeterminate": {
|
|
26
|
+
"bg": "{alias.bg-brand}",
|
|
27
|
+
"hover": { "bg": "{alias.bg-brand-hover}" },
|
|
28
|
+
"iconColor": "{alias.icon-primary-inverse}",
|
|
29
|
+
"icon": "remove"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
"states": {
|
|
34
|
+
"disabled": {
|
|
35
|
+
"cursor": "default",
|
|
36
|
+
"indicator": {
|
|
37
|
+
"bg": "{alias.bg-inactive-subtle}",
|
|
38
|
+
"border": { "color": "{alias.border-inactive}" },
|
|
39
|
+
"iconColor": "{alias.icon-inactive-subtle}"
|
|
40
|
+
},
|
|
41
|
+
"labelColor": "{alias.text-inactive}"
|
|
42
|
+
},
|
|
43
|
+
"focused": {
|
|
44
|
+
"indicator": {
|
|
45
|
+
"ring": { "width": "2px", "color": "{alias.border-focused}" },
|
|
46
|
+
"border": { "color": "{alias.border-brand}" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
"props": {
|
|
52
|
+
"label": { "type": "string", "description": "Label text next to the checkbox." },
|
|
53
|
+
"supportText": { "type": "string", "description": "Support text below the label." },
|
|
54
|
+
"checkboxPosition": { "type": "enum", "values": ["leading", "trailing"], "default": "leading" },
|
|
55
|
+
"indeterminate": { "type": "boolean", "default": false },
|
|
56
|
+
"checked": { "type": "boolean" },
|
|
57
|
+
"disabled": { "type": "boolean", "default": false }
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
"slots": {
|
|
61
|
+
"label": { "fontSize": "14px", "fontWeight": 500, "lineHeight": "16px", "color": "{alias.text-primary}" },
|
|
62
|
+
"supportText": { "fontSize": "14px", "lineHeight": "20px", "color": "{alias.text-secondary}", "gap": "{spacing.xxs}" }
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
"accessibility": {
|
|
66
|
+
"role": "checkbox",
|
|
67
|
+
"notes": "aria-checked set to 'mixed' when indeterminate. Native input is visually hidden (sr-only)."
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "CloseButton",
|
|
3
|
+
"description": "Icon-only circular button for close/dismiss actions. Uses Icon component with 'close' icon.",
|
|
4
|
+
|
|
5
|
+
"base": {
|
|
6
|
+
"display": "inline-flex",
|
|
7
|
+
"alignItems": "center",
|
|
8
|
+
"justifyContent": "center",
|
|
9
|
+
"flexShrink": 0,
|
|
10
|
+
"borderRadius": "{radius.full}",
|
|
11
|
+
"transition": "background-color, color",
|
|
12
|
+
"focusVisible": { "outline": "none", "ring": "2px", "ringColor": "{alias.border-brand}", "ringOffset": "2px" },
|
|
13
|
+
"disabled": { "opacity": 0.5, "pointerEvents": "none" }
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
"variants": {
|
|
17
|
+
"ghost": {
|
|
18
|
+
"bg": "transparent",
|
|
19
|
+
"text": "{alias.icon-primary}",
|
|
20
|
+
"hover": { "bg": "{alias.bg-tertiary}" },
|
|
21
|
+
"active": { "bg": "{alias.bg-quarterary}" },
|
|
22
|
+
"disabled": { "text": "{alias.text-inactive}" }
|
|
23
|
+
},
|
|
24
|
+
"outlined": {
|
|
25
|
+
"bg": "transparent",
|
|
26
|
+
"border": { "width": "1px", "color": "{alias.border-strong}" },
|
|
27
|
+
"text": "{alias.icon-primary}",
|
|
28
|
+
"hover": { "borderColor": "{alias.border-strong}", "bg": "{alias.bg-secondary}" },
|
|
29
|
+
"active": { "bg": "{alias.bg-tertiary}" },
|
|
30
|
+
"disabled": { "borderColor": "{alias.border-inactive-subtle}", "bg": "{alias.bg-secondary}", "text": "{alias.text-inactive}" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
"sizes": {
|
|
35
|
+
"sm": { "width": "24px", "height": "24px", "iconSize": "sm" },
|
|
36
|
+
"md": { "width": "32px", "height": "32px", "iconSize": "md" },
|
|
37
|
+
"lg": { "width": "40px", "height": "40px", "iconSize": "md" },
|
|
38
|
+
"xl": { "width": "48px", "height": "48px", "iconSize": "lg" }
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
"slots": {
|
|
42
|
+
"icon": {
|
|
43
|
+
"element": "Icon",
|
|
44
|
+
"name": "close",
|
|
45
|
+
"iconSizeByButtonSize": { "sm": "sm", "md": "md", "lg": "md", "xl": "lg" }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
"props": {
|
|
50
|
+
"variant": { "type": "enum", "values": ["ghost", "outlined"], "default": "ghost" },
|
|
51
|
+
"size": { "type": "enum", "values": ["sm", "md", "lg", "xl"], "default": "md" },
|
|
52
|
+
"iconVariant": { "type": "enum", "values": ["outlined", "rounded", "sharp"], "default": "outlined" },
|
|
53
|
+
"iconFilled": { "type": "boolean", "default": false },
|
|
54
|
+
"aria-label": { "type": "string", "default": "Close", "description": "Accessible name for the close action." },
|
|
55
|
+
"disabled": { "type": "boolean", "default": false }
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
"defaults": { "variant": "ghost", "size": "md" },
|
|
59
|
+
|
|
60
|
+
"accessibility": {
|
|
61
|
+
"role": "button",
|
|
62
|
+
"notes": "Requires aria-label for accessible name. Default: 'Close'."
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Divider",
|
|
3
|
+
"description": "Visual separator line for sectioning content. Supports horizontal and vertical orientation with solid or dashed styles.",
|
|
4
|
+
|
|
5
|
+
"base": {
|
|
6
|
+
"borderColor": "{alias.border-default}"
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
"variants": {
|
|
10
|
+
"solid": { "borderStyle": "solid" },
|
|
11
|
+
"dashed": { "borderStyle": "dashed" }
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
"sizes": {},
|
|
15
|
+
|
|
16
|
+
"orientations": {
|
|
17
|
+
"horizontal": { "width": "100%", "borderTop": "1px" },
|
|
18
|
+
"vertical": { "height": "100%", "borderLeft": "1px" }
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
"props": {
|
|
22
|
+
"orientation": { "type": "enum", "values": ["horizontal", "vertical"], "default": "horizontal" },
|
|
23
|
+
"variant": { "type": "enum", "values": ["solid", "dashed"], "default": "solid" }
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"defaults": { "orientation": "horizontal", "variant": "solid" },
|
|
27
|
+
|
|
28
|
+
"accessibility": {
|
|
29
|
+
"role": "separator",
|
|
30
|
+
"notes": "Renders as <hr> for horizontal, <div> for vertical. aria-orientation reflects the orientation prop."
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "DropdownInput",
|
|
3
|
+
"description": "Select trigger button with label, helper text, error state, and selection indicator. Used as the trigger for Dropdown/Select components.",
|
|
4
|
+
|
|
5
|
+
"base": {
|
|
6
|
+
"display": "flex",
|
|
7
|
+
"width": "100%",
|
|
8
|
+
"alignItems": "center",
|
|
9
|
+
"bg": "{alias.component-input-bg}",
|
|
10
|
+
"borderRadius": "{radius.sm}",
|
|
11
|
+
"transition": "border-color",
|
|
12
|
+
"cursor": "pointer"
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"sizes": {
|
|
16
|
+
"sm": { "height": "36px", "paddingX": "{spacing.sm}", "fontSize": "14px" },
|
|
17
|
+
"md": { "height": "40px", "paddingX": "{spacing.sm}", "fontSize": "14px" },
|
|
18
|
+
"lg": { "height": "44px", "paddingX": "{spacing.sm}", "fontSize": "14px" }
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
"states": {
|
|
22
|
+
"default": {
|
|
23
|
+
"border": { "width": "1px", "color": "{alias.border-strong}" },
|
|
24
|
+
"shadow": "{shadow.xs}"
|
|
25
|
+
},
|
|
26
|
+
"disabled": {
|
|
27
|
+
"bg": "{alias.bg-secondary}",
|
|
28
|
+
"border": { "color": "{alias.border-inactive}" },
|
|
29
|
+
"shadow": "none",
|
|
30
|
+
"cursor": "default",
|
|
31
|
+
"pointerEvents": "none",
|
|
32
|
+
"text": "{alias.text-inactive}"
|
|
33
|
+
},
|
|
34
|
+
"error": {
|
|
35
|
+
"border": { "color": "{alias.border-danger-secondary}" }
|
|
36
|
+
},
|
|
37
|
+
"focused": {
|
|
38
|
+
"border": { "color": "{alias.border-brand}" },
|
|
39
|
+
"focusRing": { "width": "4px", "color": "{alias.border-focused}", "inset": "-1px", "borderRadius": "{radius.sm}" }
|
|
40
|
+
},
|
|
41
|
+
"focused+error": {
|
|
42
|
+
"border": { "color": "{alias.border-danger}" },
|
|
43
|
+
"focusRing": { "width": "4px", "color": "{alias.border-focused-danger}", "inset": "-1px", "borderRadius": "{radius.sm}" }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
"props": {
|
|
48
|
+
"size": { "type": "enum", "values": ["sm", "md", "lg"], "default": "md" },
|
|
49
|
+
"label": { "type": "string", "description": "Label text above the trigger." },
|
|
50
|
+
"optional": { "type": "boolean", "default": false },
|
|
51
|
+
"helperText": { "type": "string" },
|
|
52
|
+
"errorMessage": { "type": "string", "description": "Error message. Overrides helperText." },
|
|
53
|
+
"placeholder": { "type": "string", "default": "Select an option" },
|
|
54
|
+
"value": { "type": "string | string[]" },
|
|
55
|
+
"displayValue": { "type": "string", "description": "Custom display text for the selected value." },
|
|
56
|
+
"open": { "type": "boolean", "default": false },
|
|
57
|
+
"showIndicator": { "type": "boolean", "default": false, "description": "Show selection count badge." },
|
|
58
|
+
"indicatorCount": { "type": "number" },
|
|
59
|
+
"leftIcon": { "type": "string", "description": "Material Symbol name for leading icon." },
|
|
60
|
+
"leftElement": { "type": "ReactNode", "description": "Custom left element. Overrides leftIcon." },
|
|
61
|
+
"disabled": { "type": "boolean", "default": false }
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
"slots": {
|
|
65
|
+
"leftIcon": { "position": "start", "element": "Icon", "size": "md", "color": "{alias.text-tertiary}", "disabledColor": "{alias.icon-inactive-subtle}" },
|
|
66
|
+
"chevron": { "position": "end", "element": "Icon", "openIcon": "expand_less", "closedIcon": "expand_more", "size": "md", "color": "{alias.text-tertiary}" },
|
|
67
|
+
"indicator": {
|
|
68
|
+
"position": "before-chevron",
|
|
69
|
+
"height": "24px",
|
|
70
|
+
"borderRadius": "{radius.full}",
|
|
71
|
+
"paddingX": "{spacing.xs}",
|
|
72
|
+
"fontSize": "12px",
|
|
73
|
+
"fontWeight": 500,
|
|
74
|
+
"bg": "{alias.bg-brand}",
|
|
75
|
+
"text": "{alias.text-on-color}"
|
|
76
|
+
},
|
|
77
|
+
"label": { "position": "above", "fontSize": "14px", "fontWeight": 500, "color": "{alias.text-primary}", "marginBottom": "{spacing.sm}" },
|
|
78
|
+
"helperText": { "position": "below", "fontSize": "14px", "color": "{alias.text-secondary}", "errorColor": "{alias.text-error}", "marginTop": "{spacing.sm}" }
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
"defaults": { "size": "md" },
|
|
82
|
+
|
|
83
|
+
"accessibility": {
|
|
84
|
+
"role": "button",
|
|
85
|
+
"notes": "aria-haspopup='listbox', aria-expanded reflects open state, aria-invalid when error, aria-describedby links to helperText/errorMessage."
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Dropdown",
|
|
3
|
+
"description": "Complete select/dropdown component combining a trigger (DropdownInput), popover positioning, and menu with options. Supports single and multi-select.",
|
|
4
|
+
|
|
5
|
+
"composition": {
|
|
6
|
+
"trigger": "DropdownInput",
|
|
7
|
+
"popover": "Positioned overlay anchored to trigger",
|
|
8
|
+
"menu": "Menu with MenuGroup and MenuItem/DropdownItem children"
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
"props": {
|
|
12
|
+
"options": { "type": "DropdownOption[]", "description": "Array of { value, label, leftIcon?, disabled? } for simple usage." },
|
|
13
|
+
"value": { "type": "string | string[]", "description": "Selected value(s)." },
|
|
14
|
+
"onValueChange": { "type": "function", "description": "(value: string | string[]) => void" },
|
|
15
|
+
"multiple": { "type": "boolean", "default": false, "description": "Enable multi-select mode." },
|
|
16
|
+
"displayValue": { "type": "string", "description": "Custom display text override." },
|
|
17
|
+
"menuWidth": { "type": "enum", "values": ["trigger", "auto"], "default": "trigger", "description": "Menu width behavior. 'trigger' matches trigger width." },
|
|
18
|
+
"maxHeight": { "type": "number", "default": 300, "description": "Max menu height before scrolling." },
|
|
19
|
+
"align": { "type": "enum", "values": ["start", "center", "end"], "default": "start" },
|
|
20
|
+
"sideOffset": { "type": "number", "default": 4 },
|
|
21
|
+
"placeholder": { "type": "string", "default": "Select an option" },
|
|
22
|
+
"disabled": { "type": "boolean", "default": false }
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
"behavior": {
|
|
26
|
+
"singleSelect": "Selecting an option closes the dropdown and sets the value.",
|
|
27
|
+
"multiSelect": "Selecting an option toggles it. Dropdown stays open. Trigger shows count badge.",
|
|
28
|
+
"keyboard": "Escape closes the dropdown and returns focus to trigger."
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
"subComponents": {
|
|
32
|
+
"DropdownItem": {
|
|
33
|
+
"description": "Individual selectable option within the dropdown menu.",
|
|
34
|
+
"props": {
|
|
35
|
+
"value": { "type": "string", "required": true },
|
|
36
|
+
"selected": { "type": "boolean", "default": false },
|
|
37
|
+
"leftIcon": { "type": "string" },
|
|
38
|
+
"disabled": { "type": "boolean", "default": false },
|
|
39
|
+
"multiple": { "type": "boolean", "default": false }
|
|
40
|
+
},
|
|
41
|
+
"singleSelectIndicator": {
|
|
42
|
+
"selected": { "icon": "check", "size": "sm", "color": "{alias.text-brand}", "position": "end" },
|
|
43
|
+
"active": { "uses": "MenuItem active state" }
|
|
44
|
+
},
|
|
45
|
+
"multiSelectIndicator": {
|
|
46
|
+
"position": "start",
|
|
47
|
+
"size": "16px",
|
|
48
|
+
"borderRadius": "{radius.xs}",
|
|
49
|
+
"unchecked": { "bg": "{alias.component-input-bg}", "border": "{alias.border-strong}" },
|
|
50
|
+
"checked": { "bg": "{alias.bg-brand}", "border": "{alias.border-brand}", "icon": "check", "iconColor": "{alias.text-on-color}" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"DropdownGroup": {
|
|
54
|
+
"description": "Groups options with an optional heading. Wraps MenuGroup.",
|
|
55
|
+
"props": {
|
|
56
|
+
"heading": { "type": "ReactNode" },
|
|
57
|
+
"headingId": { "type": "string" }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
"popover": {
|
|
63
|
+
"animation": "fade-in + zoom-in-95 on open, reverse on close",
|
|
64
|
+
"slideDirection": "from-top when below trigger, from-bottom when above"
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
"accessibility": {
|
|
68
|
+
"role": "listbox",
|
|
69
|
+
"notes": "Menu has role='listbox'. DropdownItem has role='option' with aria-selected. Multi-select sets aria-multiselectable on the listbox."
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "FeaturedIcon",
|
|
3
|
+
"description": "Decorative icon container with 5 visual variants, 5 semantic types, and 3 sizes. Used to emphasize icon meaning in cards, empty states, and alerts.",
|
|
4
|
+
|
|
5
|
+
"base": {
|
|
6
|
+
"display": "inline-flex",
|
|
7
|
+
"alignItems": "center",
|
|
8
|
+
"justifyContent": "center",
|
|
9
|
+
"flexShrink": 0
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
"variants": {
|
|
13
|
+
"circle-light": { "borderRadius": "{radius.full}" },
|
|
14
|
+
"square-light": { "borderRadius": "{radius.lg}" },
|
|
15
|
+
"circle-pulse": { "borderRadius": "{radius.full}", "border": { "width": "8px" } },
|
|
16
|
+
"solid-circle": { "borderRadius": "{radius.full}" },
|
|
17
|
+
"solid-square": { "borderRadius": "{radius.lg}" }
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"sizes": {
|
|
21
|
+
"sm": { "padding": "{spacing.sm}", "iconSize": "md" },
|
|
22
|
+
"md": { "padding": "{spacing.md}", "iconSize": "lg" },
|
|
23
|
+
"lg": { "padding": "{spacing.lg}", "iconSize": "xl" }
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"compoundVariants": [
|
|
27
|
+
{ "when": { "variant": "circle-light", "type": "brand" }, "apply": { "bg": "{alias.bg-brand-tertiary}", "text": "{alias.text-brand}" } },
|
|
28
|
+
{ "when": { "variant": "circle-light", "type": "success" }, "apply": { "bg": "{alias.bg-success-tertiary}", "text": "{alias.text-success}" } },
|
|
29
|
+
{ "when": { "variant": "circle-light", "type": "danger" }, "apply": { "bg": "{alias.bg-danger-tertiary}", "text": "{alias.text-danger}" } },
|
|
30
|
+
{ "when": { "variant": "circle-light", "type": "warning" }, "apply": { "bg": "{alias.bg-warning-tertiary}", "text": "{alias.text-warning}" } },
|
|
31
|
+
{ "when": { "variant": "circle-light", "type": "neutral" }, "apply": { "bg": "{alias.bg-tertiary}", "text": "{alias.text-secondary}" } },
|
|
32
|
+
|
|
33
|
+
{ "when": { "variant": "square-light", "type": "brand" }, "apply": { "bg": "{alias.bg-brand-tertiary}", "text": "{alias.text-brand}" } },
|
|
34
|
+
{ "when": { "variant": "square-light", "type": "success" }, "apply": { "bg": "{alias.bg-success-tertiary}", "text": "{alias.text-success}" } },
|
|
35
|
+
{ "when": { "variant": "square-light", "type": "danger" }, "apply": { "bg": "{alias.bg-danger-tertiary}", "text": "{alias.text-danger}" } },
|
|
36
|
+
{ "when": { "variant": "square-light", "type": "warning" }, "apply": { "bg": "{alias.bg-warning-tertiary}", "text": "{alias.text-warning}" } },
|
|
37
|
+
{ "when": { "variant": "square-light", "type": "neutral" }, "apply": { "bg": "{alias.bg-tertiary}", "text": "{alias.text-secondary}" } },
|
|
38
|
+
|
|
39
|
+
{ "when": { "variant": "circle-pulse", "type": "brand" }, "apply": { "borderColor": "{alias.border-brand-tertiary}", "bg": "{alias.bg-brand-secondary}", "text": "{alias.text-brand}" } },
|
|
40
|
+
{ "when": { "variant": "circle-pulse", "type": "success" }, "apply": { "borderColor": "{alias.border-success-tertiary}", "bg": "{alias.bg-success-secondary}", "text": "{alias.text-success}" } },
|
|
41
|
+
{ "when": { "variant": "circle-pulse", "type": "danger" }, "apply": { "borderColor": "{alias.border-danger-tertiary}", "bg": "{alias.bg-danger-secondary}", "text": "{alias.text-danger}" } },
|
|
42
|
+
{ "when": { "variant": "circle-pulse", "type": "warning" }, "apply": { "borderColor": "{alias.border-warning-tertiary}", "bg": "{alias.bg-warning-secondary}", "text": "{alias.text-warning}" } },
|
|
43
|
+
{ "when": { "variant": "circle-pulse", "type": "neutral" }, "apply": { "borderColor": "{alias.border-secondary}", "bg": "{alias.bg-quarterary}", "text": "{alias.text-secondary}" } },
|
|
44
|
+
|
|
45
|
+
{ "when": { "variant": "solid-circle", "type": "brand" }, "apply": { "bg": "{alias.bg-brand}", "text": "{alias.text-on-color}" } },
|
|
46
|
+
{ "when": { "variant": "solid-circle", "type": "success" }, "apply": { "bg": "{alias.bg-success}", "text": "{alias.text-on-color}" } },
|
|
47
|
+
{ "when": { "variant": "solid-circle", "type": "danger" }, "apply": { "bg": "{alias.bg-danger}", "text": "{alias.text-on-color}" } },
|
|
48
|
+
{ "when": { "variant": "solid-circle", "type": "warning" }, "apply": { "bg": "{alias.bg-warning}", "text": "{alias.text-on-color}" } },
|
|
49
|
+
{ "when": { "variant": "solid-circle", "type": "neutral" }, "apply": { "bg": "{alias.bg-primary-inverse}", "text": "{alias.text-on-color}" } },
|
|
50
|
+
|
|
51
|
+
{ "when": { "variant": "solid-square", "type": "brand" }, "apply": { "bg": "{alias.bg-brand}", "text": "{alias.text-on-color}" } },
|
|
52
|
+
{ "when": { "variant": "solid-square", "type": "success" }, "apply": { "bg": "{alias.bg-success}", "text": "{alias.text-on-color}" } },
|
|
53
|
+
{ "when": { "variant": "solid-square", "type": "danger" }, "apply": { "bg": "{alias.bg-danger}", "text": "{alias.text-on-color}" } },
|
|
54
|
+
{ "when": { "variant": "solid-square", "type": "warning" }, "apply": { "bg": "{alias.bg-warning}", "text": "{alias.text-on-color}" } },
|
|
55
|
+
{ "when": { "variant": "solid-square", "type": "neutral" }, "apply": { "bg": "{alias.bg-primary-inverse}", "text": "{alias.text-on-color}" } }
|
|
56
|
+
],
|
|
57
|
+
|
|
58
|
+
"props": {
|
|
59
|
+
"variant": { "type": "enum", "values": ["circle-light", "square-light", "circle-pulse", "solid-circle", "solid-square"], "default": "solid-circle" },
|
|
60
|
+
"type": { "type": "enum", "values": ["brand", "success", "danger", "warning", "neutral"], "default": "brand" },
|
|
61
|
+
"size": { "type": "enum", "values": ["sm", "md", "lg"], "default": "md" },
|
|
62
|
+
"name": { "type": "string", "description": "Material Symbol name in snake_case." },
|
|
63
|
+
"label": { "type": "string", "description": "Accessible label. If omitted, icon is decorative (aria-hidden)." }
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
"slots": {
|
|
67
|
+
"icon": {
|
|
68
|
+
"element": "Icon",
|
|
69
|
+
"filled": true,
|
|
70
|
+
"sizeByFeaturedSize": { "sm": "md", "md": "lg", "lg": "xl" }
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
"defaults": { "variant": "solid-circle", "type": "brand", "size": "md" },
|
|
75
|
+
|
|
76
|
+
"accessibility": {
|
|
77
|
+
"role": "img (when label is provided)",
|
|
78
|
+
"notes": "aria-label from label prop. aria-hidden when no label (decorative)."
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Icon",
|
|
3
|
+
"description": "Material Symbols icon rendered via variable font. Supports outlined, rounded, and sharp styles with configurable optical size, weight, fill, and grade.",
|
|
4
|
+
|
|
5
|
+
"base": {
|
|
6
|
+
"display": "inline",
|
|
7
|
+
"flexShrink": 0,
|
|
8
|
+
"userSelect": "none",
|
|
9
|
+
"fontFamily": "Material Symbols (variable font)"
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
"variants": {
|
|
13
|
+
"outlined": { "fontFamily": "Material Symbols Outlined" },
|
|
14
|
+
"rounded": { "fontFamily": "Material Symbols Rounded" },
|
|
15
|
+
"sharp": { "fontFamily": "Material Symbols Sharp" }
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
"sizes": {
|
|
19
|
+
"xs": { "fontSize": "12px" },
|
|
20
|
+
"sm": { "fontSize": "16px" },
|
|
21
|
+
"md": { "fontSize": "20px" },
|
|
22
|
+
"lg": { "fontSize": "24px" },
|
|
23
|
+
"xl": { "fontSize": "32px" }
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"props": {
|
|
27
|
+
"name": { "type": "string", "description": "Material Symbol name in snake_case (e.g. 'home', 'arrow_forward', 'settings')." },
|
|
28
|
+
"variant": { "type": "enum", "values": ["outlined", "rounded", "sharp"], "default": "outlined" },
|
|
29
|
+
"size": { "type": "enum", "values": ["xs", "sm", "md", "lg", "xl"], "default": "md" },
|
|
30
|
+
"filled": { "type": "boolean", "default": false, "description": "Render the filled variant of the icon." },
|
|
31
|
+
"weight": { "type": "number", "default": 400, "description": "Font weight: 100–700." },
|
|
32
|
+
"grade": { "type": "number", "default": 0, "description": "Grade: -25 to 200." },
|
|
33
|
+
"label": { "type": "string", "description": "Accessible label. If omitted, the icon is treated as decorative (aria-hidden)." }
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"fontVariationSettings": {
|
|
37
|
+
"FILL": { "off": 0, "on": 1 },
|
|
38
|
+
"wght": { "default": 400, "min": 100, "max": 700 },
|
|
39
|
+
"GRAD": { "default": 0, "min": -25, "max": 200 }
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
"defaults": { "variant": "outlined", "size": "md", "filled": false, "weight": 400, "grade": 0 },
|
|
43
|
+
|
|
44
|
+
"accessibility": {
|
|
45
|
+
"role": "img",
|
|
46
|
+
"notes": "When label is provided, renders with role='img' and aria-label. When omitted, aria-hidden='true' treats the icon as decorative."
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Input",
|
|
3
|
+
"description": "Single-line text input with label, helper text, error state, character counter, and icon slots. Supports presets for common input types.",
|
|
4
|
+
|
|
5
|
+
"base": {
|
|
6
|
+
"display": "flex",
|
|
7
|
+
"width": "100%",
|
|
8
|
+
"alignItems": "center",
|
|
9
|
+
"bg": "{alias.component-input-bg}",
|
|
10
|
+
"border": { "width": "1px", "color": "{alias.border-strong}" },
|
|
11
|
+
"borderRadius": "{radius.sm}",
|
|
12
|
+
"shadow": "{shadow.xs}",
|
|
13
|
+
"transition": "border-color"
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
"sizes": {
|
|
17
|
+
"sm": { "height": "36px", "paddingX": "{spacing.sm}", "fontSize": "14px" },
|
|
18
|
+
"md": { "height": "40px", "paddingX": "{spacing.sm}", "fontSize": "14px" },
|
|
19
|
+
"lg": { "height": "44px", "paddingX": "{spacing.sm}", "fontSize": "14px" }
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
"states": {
|
|
23
|
+
"disabled": {
|
|
24
|
+
"bg": "{alias.bg-secondary}",
|
|
25
|
+
"border": { "color": "{alias.border-inactive}" },
|
|
26
|
+
"shadow": "none",
|
|
27
|
+
"pointerEvents": "none",
|
|
28
|
+
"text": "{alias.text-inactive}"
|
|
29
|
+
},
|
|
30
|
+
"error": {
|
|
31
|
+
"border": { "color": "{alias.border-danger-secondary}" }
|
|
32
|
+
},
|
|
33
|
+
"focused": {
|
|
34
|
+
"border": { "color": "{alias.border-brand}" },
|
|
35
|
+
"focusRing": { "width": "4px", "color": "{alias.border-focused}", "inset": "-1px", "borderRadius": "{radius.sm}" }
|
|
36
|
+
},
|
|
37
|
+
"focused+error": {
|
|
38
|
+
"border": { "color": "{alias.border-danger}" },
|
|
39
|
+
"focusRing": { "width": "4px", "color": "{alias.border-focused-danger}", "inset": "-1px", "borderRadius": "{radius.sm}" }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
"props": {
|
|
44
|
+
"size": { "type": "enum", "values": ["sm", "md", "lg"], "default": "md" },
|
|
45
|
+
"label": { "type": "string", "description": "Label text above the input." },
|
|
46
|
+
"optional": { "type": "boolean", "default": false, "description": "Displays (Optional) next to label." },
|
|
47
|
+
"helperText": { "type": "string", "description": "Helper text below the input." },
|
|
48
|
+
"helperTextIcon": { "type": "string", "description": "Material Symbol name for helper text icon." },
|
|
49
|
+
"errorMessage": { "type": "string", "description": "Error message below the input. Overrides helperText." },
|
|
50
|
+
"maxLength": { "type": "number", "description": "Shows character counter beside the input." },
|
|
51
|
+
"leftIcon": { "type": "string", "description": "Material Symbol name for leading icon." },
|
|
52
|
+
"rightIcon": { "type": "string", "description": "Material Symbol name for trailing icon." },
|
|
53
|
+
"preset": { "type": "enum", "values": ["user", "email", "password", "date", "amount", "description", "search"], "description": "Preset that auto-configures icons, type, and behaviors." },
|
|
54
|
+
"disabled": { "type": "boolean", "default": false }
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
"presets": {
|
|
58
|
+
"user": { "leftIcon": "account_circle" },
|
|
59
|
+
"email": { "leftIcon": "email", "inputType": "email" },
|
|
60
|
+
"password": { "leftIcon": "lock", "rightIcon": "visibility", "inputType": "password", "hasPasswordToggle": true },
|
|
61
|
+
"date": { "leftIcon": "calendar_month", "inputType": "date" },
|
|
62
|
+
"amount": { "leftIcon": "attach_money", "rightIcon": "close", "inputType": "number", "hasClearBehavior": true },
|
|
63
|
+
"description": { "leftIcon": "description", "optional": true },
|
|
64
|
+
"search": { "leftIcon": "search", "rightIcon": "close", "optional": true, "hasClearBehavior": true }
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
"slots": {
|
|
68
|
+
"leftIcon": { "position": "start", "element": "Icon", "size": "md", "color": "{alias.text-tertiary}", "disabledColor": "{alias.icon-inactive-subtle}" },
|
|
69
|
+
"rightIcon": { "position": "end", "element": "Icon", "size": "md", "color": "{alias.text-tertiary}", "disabledColor": "{alias.icon-inactive-subtle}" },
|
|
70
|
+
"label": { "position": "above", "fontSize": "14px", "fontWeight": 500, "color": "{alias.text-primary}", "marginBottom": "{spacing.sm}" },
|
|
71
|
+
"helperText": { "position": "below", "fontSize": "14px", "color": "{alias.text-secondary}", "errorColor": "{alias.text-error}", "marginTop": "{spacing.sm}" },
|
|
72
|
+
"characterCounter": { "position": "end-outside", "fontSize": "14px", "color": "{alias.text-tertiary}", "errorColor": "{alias.text-error}" }
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
"defaults": { "size": "md" },
|
|
76
|
+
|
|
77
|
+
"accessibility": {
|
|
78
|
+
"role": "textbox",
|
|
79
|
+
"notes": "aria-invalid set when error. aria-describedby links to helperText or errorMessage. Label uses htmlFor."
|
|
80
|
+
}
|
|
81
|
+
}
|