gbs-add-block 2.1.0 → 2.3.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/.gbs/skills/gbs-components/SKILL.md +190 -134
- package/.gbs/skills/gbs-components/references/install.md +25 -3
- package/.gbs/skills/gbs-components/references/styling.md +246 -207
- package/CHANGELOG.md +74 -0
- package/README.md +154 -23
- package/index.cjs +212 -3
- package/package.json +41 -10
- package/schema/passport-v1.schema.json +204 -0
- package/source/beta-components/accordion/passport.json +259 -0
- package/source/beta-components/accordion/styles.css +207 -208
- package/source/beta-components/alert/passport.json +250 -0
- package/source/beta-components/alert/styles.css +154 -155
- package/source/beta-components/avatar/passport.json +294 -0
- package/source/beta-components/avatar/styles.css +225 -226
- package/source/beta-components/badge/passport.json +332 -0
- package/source/beta-components/badge/styles.css +203 -204
- package/source/beta-components/breadcrumb/passport.json +243 -0
- package/source/beta-components/breadcrumb/styles.css +138 -140
- package/source/beta-components/button/passport.json +402 -0
- package/source/beta-components/button/passport.manual.json +31 -0
- package/source/beta-components/button/styles.css +232 -234
- package/source/beta-components/card/passport.json +337 -0
- package/source/beta-components/card/styles.css +230 -232
- package/source/beta-components/checkbox/passport.json +456 -0
- package/source/beta-components/checkbox/styles.css +211 -213
- package/source/beta-components/combobox/passport.json +456 -0
- package/source/beta-components/combobox/styles.css +419 -417
- package/source/beta-components/data-grid/agent/coerce.ts +368 -0
- package/source/beta-components/data-grid/agent/contract.ts +410 -0
- package/source/beta-components/data-grid/agent/dataset.ts +92 -0
- package/source/beta-components/data-grid/agent/engine.ts +470 -0
- package/source/beta-components/data-grid/agent/executors.ts +155 -0
- package/source/beta-components/data-grid/agent/index.ts +79 -0
- package/source/beta-components/data-grid/agent/intent.ts +324 -0
- package/source/beta-components/data-grid/agent/operations.ts +335 -0
- package/source/beta-components/data-grid/agent/validate.ts +630 -0
- package/source/beta-components/data-grid/agent/webmcp.ts +107 -0
- package/source/beta-components/data-grid/index.ts +14 -7
- package/source/beta-components/data-grid/passport.json +1051 -0
- package/source/beta-components/data-grid/passport.manual.json +255 -0
- package/source/beta-components/data-grid/react/AskGrid.tsx +164 -0
- package/source/beta-components/data-grid/react/DataGrid.tsx +39 -0
- package/source/beta-components/data-grid/styles.css +874 -716
- package/source/beta-components/date-picker/passport.json +407 -0
- package/source/beta-components/date-picker/styles.css +445 -446
- package/source/beta-components/dialog/passport.json +344 -0
- package/source/beta-components/dialog/styles.css +280 -279
- package/source/beta-components/file-uploader/passport.json +518 -0
- package/source/beta-components/file-uploader/styles.css +394 -396
- package/source/beta-components/input/passport.json +536 -0
- package/source/beta-components/input/styles.css +295 -297
- package/source/beta-components/menu/passport.json +322 -0
- package/source/beta-components/menu/styles.css +224 -223
- package/source/beta-components/modal/passport.json +289 -0
- package/source/beta-components/modal/styles.css +241 -240
- package/source/beta-components/number-input/passport.json +541 -0
- package/source/beta-components/number-input/styles.css +230 -231
- package/source/beta-components/popover/passport.json +238 -0
- package/source/beta-components/popover/styles.css +148 -147
- package/source/beta-components/progress/passport.json +270 -0
- package/source/beta-components/progress/styles.css +200 -201
- package/source/beta-components/radio-group/passport.json +477 -0
- package/source/beta-components/radio-group/styles.css +269 -270
- package/source/beta-components/shared/core/agent/adapter.ts +65 -0
- package/source/beta-components/shared/core/agent/history.ts +120 -0
- package/source/beta-components/shared/core/agent/index.ts +46 -0
- package/source/beta-components/shared/core/agent/numbers.ts +217 -0
- package/source/beta-components/shared/core/agent/schema.ts +180 -0
- package/source/beta-components/shared/core/agent/types.ts +169 -0
- package/source/beta-components/shared/core/agent/webmcp.ts +328 -0
- package/source/beta-components/shared/index.ts +9 -0
- package/source/beta-components/shared/react/GramproAIProvider.tsx +50 -0
- package/source/beta-components/shared/react/useAskAgent.ts +217 -0
- package/source/beta-components/shared/styles.css +79 -0
- package/source/beta-components/shared/version.json +4 -4
- package/source/beta-components/shared/version.ts +6 -6
- package/source/beta-components/skeleton/passport.json +251 -0
- package/source/beta-components/skeleton/styles.css +185 -187
- package/source/beta-components/spinner/passport.json +245 -0
- package/source/beta-components/spinner/styles.css +173 -174
- package/source/beta-components/switch/passport.json +421 -0
- package/source/beta-components/switch/styles.css +227 -229
- package/source/beta-components/tabs/passport.json +315 -0
- package/source/beta-components/tabs/styles.css +263 -264
- package/source/beta-components/textarea/passport.json +382 -0
- package/source/beta-components/textarea/styles.css +158 -160
- package/source/beta-components/toaster/passport.json +221 -0
- package/source/beta-components/toaster/styles.css +282 -282
- package/source/beta-components/tooltip/passport.json +170 -0
- package/source/beta-components/tooltip/styles.css +71 -73
- package/tools/env.cjs +61 -0
- package/tools/passport/cli.cjs +79 -0
- package/tools/passport/extract.cjs +493 -0
- package/tools/passport/index.cjs +185 -0
- package/tools/passport/merge.cjs +131 -0
- package/tools/passport/policy.cjs +65 -0
- package/tools/passport/validate.cjs +277 -0
- package/tools/ts-require.cjs +79 -0
- package/source/beta-components/accordion/__tests__/core.test.ts +0 -58
- package/source/beta-components/alert/__tests__/core.test.ts +0 -17
- package/source/beta-components/avatar/__tests__/core.test.ts +0 -88
- package/source/beta-components/badge/__tests__/core.test.ts +0 -46
- package/source/beta-components/breadcrumb/__tests__/core.test.ts +0 -58
- package/source/beta-components/button/__tests__/core.test.ts +0 -31
- package/source/beta-components/card/__tests__/core.test.ts +0 -57
- package/source/beta-components/checkbox/__tests__/core.test.ts +0 -40
- package/source/beta-components/combobox/__tests__/core.test.ts +0 -134
- package/source/beta-components/data-grid/__tests__/core.test.ts +0 -356
- package/source/beta-components/data-grid/__tests__/export.test.ts +0 -70
- package/source/beta-components/data-grid/__tests__/pdf.test.ts +0 -209
- package/source/beta-components/date-picker/__tests__/core.test.ts +0 -273
- package/source/beta-components/dialog/__tests__/core.test.ts +0 -86
- package/source/beta-components/file-uploader/__tests__/core.test.ts +0 -395
- package/source/beta-components/input/__tests__/core.test.ts +0 -75
- package/source/beta-components/menu/__tests__/core.test.ts +0 -120
- package/source/beta-components/modal/__tests__/core.test.ts +0 -55
- package/source/beta-components/number-input/__tests__/core.test.ts +0 -151
- package/source/beta-components/progress/__tests__/core.test.ts +0 -56
- package/source/beta-components/radio-group/__tests__/core.test.ts +0 -64
- package/source/beta-components/shared/__tests__/boundaries.test.ts +0 -95
- package/source/beta-components/shared/__tests__/core.test.ts +0 -55
- package/source/beta-components/shared/__tests__/position.test.ts +0 -143
- package/source/beta-components/skeleton/__tests__/core.test.ts +0 -41
- package/source/beta-components/spinner/__tests__/core.test.ts +0 -48
- package/source/beta-components/switch/__tests__/core.test.ts +0 -64
- package/source/beta-components/tabs/__tests__/core.test.ts +0 -51
- package/source/beta-components/textarea/__tests__/core.test.ts +0 -38
- package/source/beta-components/toaster/__tests__/core.test.ts +0 -256
- package/source/beta-components/tooltip/__tests__/core.test.ts +0 -42
|
@@ -1,140 +1,138 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Breadcrumb styles.
|
|
3
|
-
*
|
|
4
|
-
* Tokens read the shared --gbs-* variables when they are set on an ancestor
|
|
5
|
-
* (set them on :root to theme every component at once) and fall back to the
|
|
6
|
-
* same default palette otherwise. Rules
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Breadcrumb styles.
|
|
3
|
+
*
|
|
4
|
+
* Tokens read the shared --gbs-* variables when they are set on an ancestor
|
|
5
|
+
* (set them on :root to theme every component at once) and fall back to the
|
|
6
|
+
* same default palette otherwise. Rules are unlayered: they beat a framework
|
|
7
|
+
* reset on specificity, and lose to anything you pass through `className`.
|
|
8
|
+
* With Tailwind v4, import this file after the framework and inside its
|
|
9
|
+
* components layer - see the README.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
.bc-root {
|
|
13
|
+
--bc-fg: var(--gbs-fg, var(--dg-fg, light-dark(#18181b, #f4f4f5)));
|
|
14
|
+
--bc-muted: var(--gbs-muted, var(--dg-muted, light-dark(#71717a, #a1a1aa)));
|
|
15
|
+
--bc-hover: var(--gbs-hover, var(--dg-hover, light-dark(#f4f4f5, #1f1f23)));
|
|
16
|
+
--bc-focus: var(--gbs-focus, var(--dg-focus, light-dark(#2563eb, #60a5fa)));
|
|
17
|
+
--bc-font-size: var(--gbs-font-size, var(--dg-font-size, 13px));
|
|
18
|
+
/* Long labels are cut with an ellipsis; the full text is in the tooltip. */
|
|
19
|
+
--bc-max-label: 24ch;
|
|
20
|
+
|
|
21
|
+
color-scheme: inherit;
|
|
22
|
+
font-size: var(--bc-font-size);
|
|
23
|
+
line-height: 1.4;
|
|
24
|
+
color: var(--bc-muted);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:where(.dark, [data-theme="dark"]) .bc-root {
|
|
28
|
+
color-scheme: dark;
|
|
29
|
+
}
|
|
30
|
+
:where(.light, [data-theme="light"]) .bc-root {
|
|
31
|
+
color-scheme: light;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:where(.bc-root) *,
|
|
35
|
+
:where(.bc-root) *::before,
|
|
36
|
+
:where(.bc-root) *::after {
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.bc-root[data-size="sm"] {
|
|
41
|
+
--bc-font-size: 12px;
|
|
42
|
+
}
|
|
43
|
+
.bc-root[data-size="lg"] {
|
|
44
|
+
--bc-font-size: 14px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.bc-list {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 4px 6px;
|
|
52
|
+
margin: 0;
|
|
53
|
+
padding: 0;
|
|
54
|
+
list-style: none;
|
|
55
|
+
}
|
|
56
|
+
.bc-item {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 6px;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.bc-link,
|
|
64
|
+
.bc-current {
|
|
65
|
+
display: inline-flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 5px;
|
|
68
|
+
min-width: 0;
|
|
69
|
+
}
|
|
70
|
+
.bc-link {
|
|
71
|
+
margin: -2px -4px;
|
|
72
|
+
padding: 2px 4px;
|
|
73
|
+
border: 0;
|
|
74
|
+
border-radius: 4px;
|
|
75
|
+
background: none;
|
|
76
|
+
color: inherit;
|
|
77
|
+
font: inherit;
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
}
|
|
81
|
+
.bc-link:hover {
|
|
82
|
+
color: var(--bc-fg);
|
|
83
|
+
text-decoration: underline;
|
|
84
|
+
text-underline-offset: 3px;
|
|
85
|
+
}
|
|
86
|
+
.bc-link:focus-visible,
|
|
87
|
+
.bc-ellipsis:focus-visible {
|
|
88
|
+
outline: 2px solid var(--bc-focus);
|
|
89
|
+
outline-offset: 1px;
|
|
90
|
+
}
|
|
91
|
+
.bc-current {
|
|
92
|
+
color: var(--bc-fg);
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.bc-text {
|
|
97
|
+
max-width: var(--bc-max-label);
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
text-overflow: ellipsis;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
}
|
|
102
|
+
.bc-icon {
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
flex: none;
|
|
105
|
+
}
|
|
106
|
+
.bc-icon > svg {
|
|
107
|
+
width: 1.1em;
|
|
108
|
+
height: 1.1em;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.bc-separator {
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
flex: none;
|
|
114
|
+
opacity: 0.7;
|
|
115
|
+
}
|
|
116
|
+
/* A chevron points the reading direction. */
|
|
117
|
+
.bc-separator > svg:dir(rtl) {
|
|
118
|
+
transform: scaleX(-1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.bc-ellipsis {
|
|
122
|
+
display: inline-grid;
|
|
123
|
+
place-items: center;
|
|
124
|
+
min-width: 24px;
|
|
125
|
+
height: 22px;
|
|
126
|
+
padding: 0 4px;
|
|
127
|
+
border: 0;
|
|
128
|
+
border-radius: 4px;
|
|
129
|
+
background: transparent;
|
|
130
|
+
color: inherit;
|
|
131
|
+
font: inherit;
|
|
132
|
+
letter-spacing: 1px;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
}
|
|
135
|
+
.bc-ellipsis:hover {
|
|
136
|
+
background: var(--bc-hover);
|
|
137
|
+
color: var(--bc-fg);
|
|
138
|
+
}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
{
|
|
2
|
+
"passportVersion": "1.0.0",
|
|
3
|
+
"identity": {
|
|
4
|
+
"component": "Button",
|
|
5
|
+
"folder": "button",
|
|
6
|
+
"exports": [
|
|
7
|
+
"Button"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"source": {
|
|
11
|
+
"libraryVersion": "2.3.0",
|
|
12
|
+
"files": [
|
|
13
|
+
"core/index.ts",
|
|
14
|
+
"core/state.ts",
|
|
15
|
+
"core/types.ts",
|
|
16
|
+
"index.ts",
|
|
17
|
+
"react/Button.tsx",
|
|
18
|
+
"react/locale.ts",
|
|
19
|
+
"react/props.ts"
|
|
20
|
+
],
|
|
21
|
+
"sourceHash": "sha256:f53690b4e1fe89f40756aac2e995bf2d4163e1a53d657053459d657eae7f75d0"
|
|
22
|
+
},
|
|
23
|
+
"purpose": "Trigger an action. Not for navigation unless `render` supplies a link element.",
|
|
24
|
+
"props": [
|
|
25
|
+
{
|
|
26
|
+
"name": "aria-describedby",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"typeText": "string | undefined",
|
|
29
|
+
"required": false,
|
|
30
|
+
"origin": "inherited"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "aria-label",
|
|
34
|
+
"type": "string",
|
|
35
|
+
"typeText": "string | undefined",
|
|
36
|
+
"required": false,
|
|
37
|
+
"origin": "inherited"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "aria-labelledby",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"typeText": "string | undefined",
|
|
43
|
+
"required": false,
|
|
44
|
+
"origin": "inherited"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "autoFocus",
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"typeText": "boolean | undefined",
|
|
50
|
+
"required": false,
|
|
51
|
+
"origin": "inherited"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "className",
|
|
55
|
+
"type": "string",
|
|
56
|
+
"typeText": "string | undefined",
|
|
57
|
+
"required": false,
|
|
58
|
+
"origin": "inherited"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "classNames",
|
|
62
|
+
"type": "other",
|
|
63
|
+
"typeText": "Partial<Record<ButtonSlot, string>> | undefined",
|
|
64
|
+
"required": false,
|
|
65
|
+
"origin": "derived"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "disabled",
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"typeText": "boolean | undefined",
|
|
71
|
+
"required": false,
|
|
72
|
+
"origin": "inherited"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "form",
|
|
76
|
+
"type": "string",
|
|
77
|
+
"typeText": "string | undefined",
|
|
78
|
+
"required": false,
|
|
79
|
+
"origin": "inherited"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "fullWidth",
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"typeText": "boolean | undefined",
|
|
85
|
+
"required": false,
|
|
86
|
+
"default": false,
|
|
87
|
+
"origin": "derived"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "hidden",
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"typeText": "boolean | undefined",
|
|
93
|
+
"required": false,
|
|
94
|
+
"origin": "inherited"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "icon",
|
|
98
|
+
"type": "other",
|
|
99
|
+
"typeText": "ReactNode",
|
|
100
|
+
"required": false,
|
|
101
|
+
"origin": "derived",
|
|
102
|
+
"description": "An icon-only button. Give it an `aria-label`.",
|
|
103
|
+
"descriptionOrigin": "jsdoc"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "id",
|
|
107
|
+
"type": "string",
|
|
108
|
+
"typeText": "string | undefined",
|
|
109
|
+
"required": false,
|
|
110
|
+
"origin": "inherited"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "leading",
|
|
114
|
+
"type": "other",
|
|
115
|
+
"typeText": "ReactNode",
|
|
116
|
+
"required": false,
|
|
117
|
+
"origin": "derived",
|
|
118
|
+
"description": "Icon before the label.",
|
|
119
|
+
"descriptionOrigin": "jsdoc"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "loading",
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"typeText": "boolean | undefined",
|
|
125
|
+
"required": false,
|
|
126
|
+
"default": false,
|
|
127
|
+
"origin": "derived",
|
|
128
|
+
"description": "Show a spinner and ignore clicks, while keeping focus and the button's width.",
|
|
129
|
+
"descriptionOrigin": "jsdoc",
|
|
130
|
+
"note": "Managed automatically when `onClick` returns a promise. Setting it manually opts out of that."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "loadingText",
|
|
134
|
+
"type": "other",
|
|
135
|
+
"typeText": "ReactNode",
|
|
136
|
+
"required": false,
|
|
137
|
+
"origin": "derived",
|
|
138
|
+
"description": "Text shown next to the spinner while busy, instead of keeping the label.",
|
|
139
|
+
"descriptionOrigin": "jsdoc"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "localeText",
|
|
143
|
+
"type": "other",
|
|
144
|
+
"typeText": "Partial<ButtonLocaleText> | undefined",
|
|
145
|
+
"required": false,
|
|
146
|
+
"origin": "derived"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "name",
|
|
150
|
+
"type": "string",
|
|
151
|
+
"typeText": "string | undefined",
|
|
152
|
+
"required": false,
|
|
153
|
+
"origin": "inherited"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "onClick",
|
|
157
|
+
"type": "function",
|
|
158
|
+
"signature": "((event: MouseEvent<HTMLElement>) => unknown) | undefined",
|
|
159
|
+
"required": false,
|
|
160
|
+
"origin": "derived",
|
|
161
|
+
"description": "Return a promise to show the loading state until it settles.",
|
|
162
|
+
"descriptionOrigin": "jsdoc"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "ref",
|
|
166
|
+
"type": "other",
|
|
167
|
+
"typeText": "Ref<HTMLButtonElement> | undefined",
|
|
168
|
+
"required": false,
|
|
169
|
+
"origin": "derived"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "render",
|
|
173
|
+
"type": "function",
|
|
174
|
+
"signature": "((props: ButtonRenderProps) => ReactElement) | undefined",
|
|
175
|
+
"required": false,
|
|
176
|
+
"origin": "derived",
|
|
177
|
+
"description": "Render another element with the button's look and behavior, e.g. a router\nlink: `render={(props) => <Link href=\"/billing\" {...props} />}`.",
|
|
178
|
+
"descriptionOrigin": "jsdoc",
|
|
179
|
+
"note": "Escape hatch for router links. Changes the rendered element, so composition rules apply to whatever it returns."
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "role",
|
|
183
|
+
"type": "other",
|
|
184
|
+
"typeText": "AriaRole | undefined",
|
|
185
|
+
"required": false,
|
|
186
|
+
"origin": "inherited"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "size",
|
|
190
|
+
"type": "enum",
|
|
191
|
+
"values": [
|
|
192
|
+
"lg",
|
|
193
|
+
"md",
|
|
194
|
+
"sm"
|
|
195
|
+
],
|
|
196
|
+
"typeText": "ButtonSize | undefined",
|
|
197
|
+
"required": false,
|
|
198
|
+
"default": "md",
|
|
199
|
+
"origin": "derived",
|
|
200
|
+
"description": "Default `md`.",
|
|
201
|
+
"descriptionOrigin": "jsdoc"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "style",
|
|
205
|
+
"type": "other",
|
|
206
|
+
"typeText": "CSSProperties | undefined",
|
|
207
|
+
"required": false,
|
|
208
|
+
"origin": "inherited"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "tabIndex",
|
|
212
|
+
"type": "number",
|
|
213
|
+
"typeText": "number | undefined",
|
|
214
|
+
"required": false,
|
|
215
|
+
"origin": "inherited"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "title",
|
|
219
|
+
"type": "string",
|
|
220
|
+
"typeText": "string | undefined",
|
|
221
|
+
"required": false,
|
|
222
|
+
"origin": "inherited"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "trailing",
|
|
226
|
+
"type": "other",
|
|
227
|
+
"typeText": "ReactNode",
|
|
228
|
+
"required": false,
|
|
229
|
+
"origin": "derived",
|
|
230
|
+
"description": "Icon after the label.",
|
|
231
|
+
"descriptionOrigin": "jsdoc"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "type",
|
|
235
|
+
"type": "enum",
|
|
236
|
+
"values": [
|
|
237
|
+
"button",
|
|
238
|
+
"reset",
|
|
239
|
+
"submit"
|
|
240
|
+
],
|
|
241
|
+
"typeText": "'button' | 'submit' | 'reset' | undefined",
|
|
242
|
+
"required": false,
|
|
243
|
+
"origin": "inherited"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "value",
|
|
247
|
+
"type": "other",
|
|
248
|
+
"typeText": "string | number | readonly string[] | undefined",
|
|
249
|
+
"required": false,
|
|
250
|
+
"origin": "inherited"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "variant",
|
|
254
|
+
"type": "enum",
|
|
255
|
+
"values": [
|
|
256
|
+
"danger",
|
|
257
|
+
"ghost",
|
|
258
|
+
"link",
|
|
259
|
+
"outline",
|
|
260
|
+
"primary",
|
|
261
|
+
"secondary"
|
|
262
|
+
],
|
|
263
|
+
"typeText": "ButtonVariant | undefined",
|
|
264
|
+
"required": false,
|
|
265
|
+
"default": "primary",
|
|
266
|
+
"origin": "derived",
|
|
267
|
+
"description": "Default `primary`.",
|
|
268
|
+
"descriptionOrigin": "jsdoc"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"inherits": [
|
|
272
|
+
{
|
|
273
|
+
"from": "ButtonHTMLAttributes<HTMLButtonElement>",
|
|
274
|
+
"omitted": [
|
|
275
|
+
"onClick"
|
|
276
|
+
],
|
|
277
|
+
"passthrough": true
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
"events": [
|
|
281
|
+
{
|
|
282
|
+
"name": "onClick",
|
|
283
|
+
"signature": "((event: MouseEvent<HTMLElement>) => unknown) | undefined"
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"slots": [
|
|
287
|
+
"root",
|
|
288
|
+
"content",
|
|
289
|
+
"spinner",
|
|
290
|
+
"icon"
|
|
291
|
+
],
|
|
292
|
+
"states": [
|
|
293
|
+
{
|
|
294
|
+
"attr": "data-busy",
|
|
295
|
+
"values": [
|
|
296
|
+
"state"
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"attr": "data-full-width",
|
|
301
|
+
"values": [
|
|
302
|
+
"full"
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"attr": "data-hidden"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"attr": "data-icon-only",
|
|
310
|
+
"values": [
|
|
311
|
+
"icon"
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"attr": "data-loading-text",
|
|
316
|
+
"values": [
|
|
317
|
+
"state"
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"attr": "data-size",
|
|
322
|
+
"values": [
|
|
323
|
+
"lg",
|
|
324
|
+
"size",
|
|
325
|
+
"sm"
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"attr": "data-theme",
|
|
330
|
+
"values": [
|
|
331
|
+
"dark",
|
|
332
|
+
"light"
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"attr": "data-variant",
|
|
337
|
+
"values": [
|
|
338
|
+
"danger",
|
|
339
|
+
"ghost",
|
|
340
|
+
"link",
|
|
341
|
+
"outline",
|
|
342
|
+
"secondary",
|
|
343
|
+
"variant"
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"accessibility": {
|
|
348
|
+
"supplied": [
|
|
349
|
+
"native <button> semantics, including Enter and Space activation",
|
|
350
|
+
"disabled state via the native attribute",
|
|
351
|
+
"focus-visible ring",
|
|
352
|
+
"the spinner is aria-hidden; loadingText is announced"
|
|
353
|
+
],
|
|
354
|
+
"required": [
|
|
355
|
+
"aria-label when the button is icon-only (`icon` with no children)",
|
|
356
|
+
"type=\"submit\" on the button that submits a form; the default is \"button\""
|
|
357
|
+
]
|
|
358
|
+
},
|
|
359
|
+
"composition": {
|
|
360
|
+
"mustNotContain": [
|
|
361
|
+
"Button",
|
|
362
|
+
"a"
|
|
363
|
+
],
|
|
364
|
+
"notes": "Nesting interactive elements is invalid HTML and traps keyboard focus. Use `render` to change the element instead of wrapping it."
|
|
365
|
+
},
|
|
366
|
+
"operations": {},
|
|
367
|
+
"intentDomains": [
|
|
368
|
+
"ActionIntent"
|
|
369
|
+
],
|
|
370
|
+
"safeMutations": {
|
|
371
|
+
"allowed": [
|
|
372
|
+
"variant",
|
|
373
|
+
"size",
|
|
374
|
+
"fullWidth",
|
|
375
|
+
"leading",
|
|
376
|
+
"trailing",
|
|
377
|
+
"icon",
|
|
378
|
+
"loadingText"
|
|
379
|
+
],
|
|
380
|
+
"forbidden": [
|
|
381
|
+
"type",
|
|
382
|
+
"onClick",
|
|
383
|
+
"render",
|
|
384
|
+
"loading",
|
|
385
|
+
"disabled"
|
|
386
|
+
],
|
|
387
|
+
"rationale": "Appearance is safe for an agent to change. `type` and `onClick` change behaviour; `loading` and `disabled` are owned by the component's own async handling."
|
|
388
|
+
},
|
|
389
|
+
"examples": [],
|
|
390
|
+
"coverage": {
|
|
391
|
+
"propsTotal": 29,
|
|
392
|
+
"propsDescribed": 9,
|
|
393
|
+
"describedPct": 31,
|
|
394
|
+
"authoredSections": [
|
|
395
|
+
"accessibility",
|
|
396
|
+
"composition",
|
|
397
|
+
"intentDomains",
|
|
398
|
+
"purpose",
|
|
399
|
+
"safeMutations"
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
}
|