@public-ui/sample-react 2.1.7 → 2.1.8
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/1487.js +1 -1
- package/dist/1636.js +1 -1
- package/dist/1792.js +1 -1
- package/dist/1795.js +1 -1
- package/dist/2017.js +1 -1
- package/dist/2322.js +1 -1
- package/dist/2538.js +1 -1
- package/dist/2567.js +1 -1
- package/dist/263.js +1 -1
- package/dist/2719.js +1 -1
- package/dist/3064.js +1 -1
- package/dist/3077.js +1 -1
- package/dist/3238.js +1 -1
- package/dist/3301.js +2 -0
- package/dist/3395.js +1 -1
- package/dist/35.js +1 -1
- package/dist/3521.js +1 -1
- package/dist/356.js +1 -1
- package/dist/3714.js +1 -1
- package/dist/3735.js +1 -1
- package/dist/3766.js +1 -1
- package/dist/3994.js +1 -1
- package/dist/4025.js +1 -1
- package/dist/4065.js +2 -0
- package/dist/4118.js +1 -1
- package/dist/4182.js +1 -1
- package/dist/4188.js +1 -1
- package/dist/4332.js +1 -1
- package/dist/4402.js +1 -1
- package/dist/4795.js +2 -0
- package/dist/4818.js +1 -1
- package/dist/4892.js +1 -1
- package/dist/4933.js +1 -1
- package/dist/4943.js +1 -1
- package/dist/495.js +1 -1
- package/dist/5034.js +1 -1
- package/dist/5056.js +1 -1
- package/dist/5138.js +1 -1
- package/dist/5296.js +1 -1
- package/dist/5356.js +1 -1
- package/dist/5551.js +1 -1
- package/dist/5835.js +1 -1
- package/dist/5840.js +1 -1
- package/dist/5889.js +1 -1
- package/dist/5912.js +1 -1
- package/dist/6082.js +1 -1
- package/dist/6099.js +1 -1
- package/dist/6181.js +1 -1
- package/dist/619.js +1 -1
- package/dist/6671.js +1 -1
- package/dist/6775.js +1 -1
- package/dist/7274.js +1 -1
- package/dist/7440.js +2 -0
- package/dist/7795.js +1 -1
- package/dist/7802.js +1 -1
- package/dist/7860.js +1 -1
- package/dist/8092.js +1 -1
- package/dist/8111.js +1 -1
- package/dist/8146.js +1 -1
- package/dist/8427.js +1 -1
- package/dist/8495.js +1 -1
- package/dist/8672.js +1 -1
- package/dist/8737.js +1 -1
- package/dist/8786.js +1 -1
- package/dist/8796.js +1 -1
- package/dist/8977.js +1 -1
- package/dist/9333.js +1 -1
- package/dist/9389.js +1 -1
- package/dist/9561.js +1 -1
- package/dist/9599.js +1 -1
- package/dist/9612.js +1 -1
- package/dist/9890.js +1 -1
- package/dist/index.html +1 -1
- package/dist/main.css +3 -3
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +16 -16
- package/public/index.html +1 -1
- package/src/@shared/_mixins.scss +3 -0
- package/src/App.tsx +1 -1
- package/src/components/FormWrap.tsx +1 -1
- package/src/components/Navigation.tsx +63 -0
- package/src/components/Sidebar.tsx +5 -41
- package/src/components/abbr/basic.tsx +12 -12
- package/src/components/alert/card-msg.tsx +3 -1
- package/src/components/alert/html.tsx +4 -2
- package/src/components/button/access-key.tsx +34 -25
- package/src/components/button/aria-description.tsx +20 -11
- package/src/components/button/baselined.tsx +22 -13
- package/src/components/button/icons.tsx +33 -26
- package/src/components/button/partials/cases.tsx +13 -6
- package/src/components/button/partials/variants.tsx +15 -17
- package/src/components/button/width.tsx +33 -28
- package/src/components/button-group/basic.tsx +25 -16
- package/src/components/button-link/basic.tsx +3 -3
- package/src/components/button-link/image.tsx +0 -1
- package/src/components/card/basic.tsx +1 -1
- package/src/components/combobox/partials/variants.tsx +1 -1
- package/src/components/details/basic.tsx +2 -2
- package/src/components/form/basic.tsx +1 -1
- package/src/components/form/error-list.tsx +1 -0
- package/src/components/handout/basic.tsx +304 -279
- package/src/components/input-checkbox/partials/variants.tsx +22 -10
- package/src/components/input-date/reset.tsx +1 -1
- package/src/components/input-password/show-password.tsx +1 -1
- package/src/components/input-text/partials/cases.tsx +1 -1
- package/src/components/input-text/routes.ts +2 -0
- package/src/components/input-text/smart-button.tsx +33 -0
- package/src/components/input-text/text-formatter.tsx +98 -45
- package/src/components/link/image.tsx +0 -1
- package/src/components/link/target.tsx +1 -1
- package/src/components/modal/basic.tsx +1 -1
- package/src/components/nav/basic.tsx +23 -12
- package/src/components/nav/horizontal.tsx +12 -3
- package/src/components/nav/links.ts +36 -0
- package/src/components/table/column-alignment.tsx +64 -62
- package/src/components/table/complex-headers.tsx +80 -78
- package/src/components/table/horizontal-scrollbar.tsx +30 -28
- package/src/components/table/interactive-child-elements.tsx +81 -69
- package/src/components/table/pagination-position.tsx +15 -13
- package/src/components/table/render-cell.tsx +14 -3
- package/src/components/table/sort-data.tsx +11 -8
- package/src/components/table/stateful-with-selection.tsx +47 -27
- package/src/components/table/stateful-with-single-selection.tsx +47 -27
- package/src/components/table/stateless-with-selection.tsx +37 -17
- package/src/components/table/stateless-with-single-selection.tsx +37 -17
- package/src/components/table/stateless.tsx +29 -27
- package/src/components/table/with-footer.tsx +1 -0
- package/src/components/table/with-pagination.tsx +1 -1
- package/src/components/tabs/behavior.tsx +61 -0
- package/src/components/tabs/routes.ts +2 -0
- package/src/components/textarea/adjust-height.tsx +1 -1
- package/src/components/textarea/counter.tsx +4 -1
- package/src/components/textarea/resize.tsx +1 -1
- package/src/components/textarea/rows.tsx +1 -1
- package/src/components/toast/basic.tsx +13 -11
- package/src/hooks/useToasterService.ts +21 -0
- package/src/react.main.tsx +6 -1
- package/src/scenarios/appointment-form/AppointmentForm.tsx +1 -0
- package/src/scenarios/custom-tooltip-width.tsx +26 -11
- package/src/scenarios/disabled-interactive-elements.tsx +123 -114
- package/src/scenarios/focus-elements.tsx +21 -16
- package/src/scenarios/horizontal-scrollbar-advanced/TableHorizontalScrollbarAdvanced.tsx +1 -1
- package/src/scenarios/horizontal-scrollbar-advanced/layout.scss +19 -0
- package/src/scenarios/input-group-with-error.tsx +41 -0
- package/src/scenarios/inputs-get-value.tsx +121 -119
- package/src/scenarios/routes.ts +4 -2
- package/src/scenarios/static-form.tsx +65 -62
- package/src/style.scss +10 -13
- package/tsconfig.json +1 -2
- package/unocss.config.ts +213 -0
- package/dist/3171.js +0 -2
- package/dist/4262.js +0 -2
- package/dist/479.js +0 -2
- package/dist/8710.js +0 -2
- package/src/scenarios/horizontal-scrollbar-advanced/layout.css +0 -31
- /package/dist/{3171.js.LICENSE.txt → 3301.js.LICENSE.txt} +0 -0
- /package/dist/{4262.js.LICENSE.txt → 4065.js.LICENSE.txt} +0 -0
- /package/dist/{479.js.LICENSE.txt → 4795.js.LICENSE.txt} +0 -0
- /package/dist/{8710.js.LICENSE.txt → 7440.js.LICENSE.txt} +0 -0
|
@@ -80,7 +80,7 @@ const Scenario = (props: Props) => {
|
|
|
80
80
|
},
|
|
81
81
|
}}
|
|
82
82
|
></KolButton>
|
|
83
|
-
<pre>{formatter(value)}</pre>
|
|
83
|
+
<pre className="text-base">{formatter(value)}</pre>
|
|
84
84
|
</div>
|
|
85
85
|
);
|
|
86
86
|
};
|
|
@@ -100,127 +100,129 @@ export const InputsGetValue: FC = () => {
|
|
|
100
100
|
</p>
|
|
101
101
|
</SampleDescription>
|
|
102
102
|
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
<section className="w-full flex flex-col">
|
|
104
|
+
<KolCard _label="Sample options" className="block ha mb-8">
|
|
105
|
+
<KolInputCheckbox
|
|
106
|
+
_label="Log events to console"
|
|
107
|
+
_value={true}
|
|
108
|
+
_checked={eventLoggerActive}
|
|
109
|
+
_on={{ onChange: (_, active) => setEventLoggerActive(active as boolean) }}
|
|
110
|
+
/>
|
|
111
|
+
</KolCard>
|
|
111
112
|
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}}
|
|
185
|
-
/>
|
|
186
|
-
<Scenario
|
|
187
|
-
testId="scenario-textarea"
|
|
188
|
-
InputComponent={KolTextarea}
|
|
189
|
-
inputProps={{
|
|
190
|
-
_label: 'KolTextarea',
|
|
191
|
-
}}
|
|
192
|
-
/>
|
|
193
|
-
<Scenario
|
|
194
|
-
testId="scenario-button"
|
|
195
|
-
InputComponent={KolButton}
|
|
196
|
-
inputProps={{
|
|
197
|
-
_label: 'KolButton',
|
|
198
|
-
_variant: 'ghost',
|
|
199
|
-
_value: 'KolButton value',
|
|
200
|
-
}}
|
|
201
|
-
/>
|
|
202
|
-
<Scenario
|
|
203
|
-
testId="scenario-buttonLink"
|
|
204
|
-
InputComponent={KolButtonLink}
|
|
205
|
-
inputProps={{
|
|
206
|
-
_label: 'KolButtonLink',
|
|
207
|
-
_value: 'KolButtonLink value',
|
|
208
|
-
}}
|
|
209
|
-
/>
|
|
210
|
-
|
|
211
|
-
<div className="grid grid-cols-3 gap-4">
|
|
212
|
-
<div></div>
|
|
213
|
-
<KolButton
|
|
214
|
-
_label="Run all"
|
|
215
|
-
_variant="primary"
|
|
216
|
-
_on={{
|
|
217
|
-
onClick: () => {
|
|
218
|
-
eventTarget.dispatchEvent(new Event('runAll'));
|
|
219
|
-
},
|
|
113
|
+
<div className="grid gap-4">
|
|
114
|
+
<Scenario testId="scenario-inputText" InputComponent={KolInputText} inputProps={{ _label: 'InputText' }} />
|
|
115
|
+
<Scenario
|
|
116
|
+
testId="scenario-inputCheckboxString"
|
|
117
|
+
InputComponent={KolInputCheckbox}
|
|
118
|
+
inputProps={{ _label: 'KolInputCheckbox (value)', _value: 'Checkbox True Value' }}
|
|
119
|
+
/>
|
|
120
|
+
<Scenario testId="scenario-inputCheckboxBoolean" InputComponent={KolInputCheckbox} inputProps={{ _label: 'KolInputCheckbox (boolean)' }} />
|
|
121
|
+
<Scenario testId="scenario-inputColor" InputComponent={KolInputColor} inputProps={{ _label: 'KolInputColor' }} />
|
|
122
|
+
<Scenario testId="scenario-inputDate" InputComponent={KolInputDate} inputProps={{ _label: 'KolInputDate' }} />
|
|
123
|
+
<Scenario testId="scenario-inputEmail" InputComponent={KolInputEmail} inputProps={{ _label: 'KolInputEmail' }} />
|
|
124
|
+
<Scenario
|
|
125
|
+
testId="scenario-inputFile"
|
|
126
|
+
InputComponent={KolInputFile}
|
|
127
|
+
inputProps={{ _label: 'KolInputFile' }}
|
|
128
|
+
formatter={(value) =>
|
|
129
|
+
value instanceof FileList
|
|
130
|
+
? `FileList{${Array.from(value)
|
|
131
|
+
.map((file: File) => file.name)
|
|
132
|
+
.join(', ')}}`
|
|
133
|
+
: JSON.stringify(value)
|
|
134
|
+
}
|
|
135
|
+
/>
|
|
136
|
+
<Scenario testId="scenario-inputNumber" InputComponent={KolInputNumber} inputProps={{ _label: 'KolInputNumber' }} />
|
|
137
|
+
<Scenario testId="scenario-inputPassword" InputComponent={KolInputPassword} inputProps={{ _label: 'KolInputPassword' }} />
|
|
138
|
+
<Scenario testId="scenario-inputRange" InputComponent={KolInputRange} inputProps={{ _label: 'KolInputRange' }} />
|
|
139
|
+
<Scenario
|
|
140
|
+
testId="scenario-inputRadio"
|
|
141
|
+
InputComponent={KolInputRadio}
|
|
142
|
+
inputProps={{
|
|
143
|
+
_label: 'KolInputRadio',
|
|
144
|
+
_orientation: 'horizontal',
|
|
145
|
+
_options: [
|
|
146
|
+
{ label: 'New York', value: 'New York' },
|
|
147
|
+
{ label: 'Rio de Janeiro', value: 'Rio de Janeiro' },
|
|
148
|
+
{ label: 'Rosenheim', value: 'Rosenheim' },
|
|
149
|
+
],
|
|
150
|
+
_value: 'New York',
|
|
151
|
+
}}
|
|
152
|
+
/>
|
|
153
|
+
<Scenario
|
|
154
|
+
testId="scenario-select"
|
|
155
|
+
InputComponent={KolSelect}
|
|
156
|
+
inputProps={{
|
|
157
|
+
_label: 'KolSelect',
|
|
158
|
+
_options: [
|
|
159
|
+
{ label: 'New York', value: 'New York' },
|
|
160
|
+
{ label: 'Rio de Janeiro', value: 'Rio de Janeiro' },
|
|
161
|
+
{ label: 'Rosenheim', value: 'Rosenheim' },
|
|
162
|
+
],
|
|
163
|
+
}}
|
|
164
|
+
/>
|
|
165
|
+
<Scenario
|
|
166
|
+
testId="scenario-singleSelect"
|
|
167
|
+
InputComponent={KolSingleSelect}
|
|
168
|
+
inputProps={{
|
|
169
|
+
_label: 'KolSingleSelect',
|
|
170
|
+
_options: [
|
|
171
|
+
{ label: 'New York', value: 'New York' },
|
|
172
|
+
{ label: 'Rio de Janeiro', value: 'Rio de Janeiro' },
|
|
173
|
+
{ label: 'Rosenheim', value: 'Rosenheim' },
|
|
174
|
+
],
|
|
175
|
+
_value: 'Rosenheim',
|
|
176
|
+
}}
|
|
177
|
+
/>
|
|
178
|
+
<Scenario
|
|
179
|
+
testId="scenario-combobox"
|
|
180
|
+
InputComponent={KolCombobox}
|
|
181
|
+
inputProps={{
|
|
182
|
+
_label: 'KolCombobox',
|
|
183
|
+
_suggestions: COUNTRY_SUGGESTIONS,
|
|
184
|
+
_value: 'Deutschland',
|
|
220
185
|
}}
|
|
221
|
-
|
|
186
|
+
/>
|
|
187
|
+
<Scenario
|
|
188
|
+
testId="scenario-textarea"
|
|
189
|
+
InputComponent={KolTextarea}
|
|
190
|
+
inputProps={{
|
|
191
|
+
_label: 'KolTextarea',
|
|
192
|
+
}}
|
|
193
|
+
/>
|
|
194
|
+
<Scenario
|
|
195
|
+
testId="scenario-button"
|
|
196
|
+
InputComponent={KolButton}
|
|
197
|
+
inputProps={{
|
|
198
|
+
_label: 'KolButton',
|
|
199
|
+
_variant: 'ghost',
|
|
200
|
+
_value: 'KolButton value',
|
|
201
|
+
}}
|
|
202
|
+
/>
|
|
203
|
+
<Scenario
|
|
204
|
+
testId="scenario-buttonLink"
|
|
205
|
+
InputComponent={KolButtonLink}
|
|
206
|
+
inputProps={{
|
|
207
|
+
_label: 'KolButtonLink',
|
|
208
|
+
_value: 'KolButtonLink value',
|
|
209
|
+
}}
|
|
210
|
+
/>
|
|
211
|
+
|
|
212
|
+
<div className="grid grid-cols-3 gap-4">
|
|
213
|
+
<div></div>
|
|
214
|
+
<KolButton
|
|
215
|
+
_label="Run all"
|
|
216
|
+
_variant="primary"
|
|
217
|
+
_on={{
|
|
218
|
+
onClick: () => {
|
|
219
|
+
eventTarget.dispatchEvent(new Event('runAll'));
|
|
220
|
+
},
|
|
221
|
+
}}
|
|
222
|
+
></KolButton>
|
|
223
|
+
</div>
|
|
222
224
|
</div>
|
|
223
|
-
</
|
|
225
|
+
</section>
|
|
224
226
|
</EventLoggerActiveContext.Provider>
|
|
225
227
|
</EventTargetContext.Provider>
|
|
226
228
|
</>
|
package/src/scenarios/routes.ts
CHANGED
|
@@ -6,15 +6,17 @@ import { InputsGetValue } from './inputs-get-value';
|
|
|
6
6
|
import { StaticForm } from './static-form';
|
|
7
7
|
import { FocusElements } from './focus-elements';
|
|
8
8
|
import { TableHorizontalScrollAdvanced } from './horizontal-scrollbar-advanced';
|
|
9
|
+
import { InputGroupWithError } from './input-group-with-error';
|
|
9
10
|
|
|
10
11
|
export const SCENARIO_ROUTES: Routes = {
|
|
11
12
|
scenarios: {
|
|
12
13
|
'appointment-form': AppointmentForm,
|
|
13
|
-
'inputs-get-value': InputsGetValue,
|
|
14
14
|
'custom-tooltip-width': CustomTooltipWidth,
|
|
15
|
-
'static-form': StaticForm,
|
|
16
15
|
'disabled-interactive-scenario': DisabledInteractiveElements,
|
|
17
16
|
'focus-elements': FocusElements,
|
|
17
|
+
'input-group-with-error': InputGroupWithError,
|
|
18
|
+
'inputs-get-value': InputsGetValue,
|
|
19
|
+
'static-form': StaticForm,
|
|
18
20
|
'table-horizontal-scrollbar-advanced': TableHorizontalScrollAdvanced,
|
|
19
21
|
},
|
|
20
22
|
};
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
KolSingleSelect,
|
|
15
15
|
KolCombobox,
|
|
16
16
|
KolTextarea,
|
|
17
|
+
KolHeading,
|
|
17
18
|
} from '@public-ui/react';
|
|
18
19
|
import type { FC } from 'react';
|
|
19
20
|
import React from 'react';
|
|
@@ -47,70 +48,72 @@ export const StaticForm: FC = () => {
|
|
|
47
48
|
</ol>
|
|
48
49
|
</SampleDescription>
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
<section className="w-full flex flex-col">
|
|
52
|
+
{searchParams.size > 0 && (
|
|
53
|
+
<div className="grid gap-4">
|
|
54
|
+
<KolHeading _level={2} _label="Submitted data" />
|
|
55
|
+
<pre className="text-base">
|
|
56
|
+
<code>{JSON.stringify(Object.fromEntries(searchParams.entries()), null, 2)}</code>
|
|
57
|
+
</pre>
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
58
60
|
|
|
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
|
-
|
|
61
|
+
<form className="grid gap-4" method="get" noValidate>
|
|
62
|
+
<KolInputCheckbox _name="checkbox" _label="Checkbox" />
|
|
63
|
+
<KolInputColor _name="color" _label="Color" />
|
|
64
|
+
<KolInputDate _name="date" _label="Date" />
|
|
65
|
+
<KolInputEmail _name="email" _label="Email" />
|
|
66
|
+
<KolInputFile _name="file" _label="File" />
|
|
67
|
+
<KolInputFile _name="file" _label="Files (multiple)" _multiple />
|
|
68
|
+
<KolInputNumber _name="number" _label="Number" />
|
|
69
|
+
<KolInputPassword _name="password" _label="Password" />
|
|
70
|
+
<KolInputRadio
|
|
71
|
+
_name="radio"
|
|
72
|
+
_label="Radio"
|
|
73
|
+
_options={[
|
|
74
|
+
{ label: 'Option A', value: 'A' },
|
|
75
|
+
{ label: 'Option B', value: 'B' },
|
|
76
|
+
]}
|
|
77
|
+
/>
|
|
78
|
+
<KolInputRange _name="range" _label="Range" />
|
|
79
|
+
<KolInputText _name="text" _label="Text" />
|
|
80
|
+
<KolSelect
|
|
81
|
+
_name="select"
|
|
82
|
+
_label="Select"
|
|
83
|
+
_options={[
|
|
84
|
+
{ label: 'Option A', value: 'A' },
|
|
85
|
+
{ label: 'Option B', value: 'B' },
|
|
86
|
+
]}
|
|
87
|
+
/>
|
|
88
|
+
<KolSelect
|
|
89
|
+
_name="select"
|
|
90
|
+
_label="Select (multiple)"
|
|
91
|
+
_multiple
|
|
92
|
+
_options={[
|
|
93
|
+
{ label: 'Option A', value: 'A' },
|
|
94
|
+
{ label: 'Option B', value: 'B' },
|
|
95
|
+
]}
|
|
96
|
+
_rows={2}
|
|
97
|
+
/>
|
|
98
|
+
<KolSingleSelect
|
|
99
|
+
_name="singleSelect"
|
|
100
|
+
_label="Single Select"
|
|
101
|
+
_options={[
|
|
102
|
+
{ label: 'Option A', value: 'A' },
|
|
103
|
+
{ label: 'Option B', value: 'B' },
|
|
104
|
+
]}
|
|
105
|
+
/>
|
|
106
|
+
<KolCombobox _name="combobox" _label="Combobox" _suggestions={COUNTRY_SUGGESTIONS} />
|
|
107
|
+
<KolTextarea _name="textarea" _label="Textarea" _rows={5} />
|
|
108
|
+
<div className="flex flex-wrap gap-4">
|
|
109
|
+
<KolButton _label="Submit" _type="submit" _variant="primary" />
|
|
110
|
+
<KolButton _label="Reset" _type="reset" />
|
|
111
|
+
</div>
|
|
110
112
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
{/* Add a random string to allow the form to be always submitted. Without it, if theres no change to the data, the form simply won't submit when requested. */}
|
|
114
|
+
<input type="hidden" value={crypto.randomUUID()} name="random" />
|
|
115
|
+
</form>
|
|
116
|
+
</section>
|
|
114
117
|
</>
|
|
115
118
|
);
|
|
116
119
|
};
|
package/src/style.scss
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
@import './@shared/mixins';
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--kolibri-root-font-size: 100;
|
|
5
|
+
font-size: 625%;
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
body {
|
|
2
9
|
margin: 0;
|
|
3
10
|
font-family: Verdana;
|
|
11
|
+
font-size: rem(16);
|
|
12
|
+
line-height: normal;
|
|
4
13
|
}
|
|
5
14
|
|
|
6
15
|
dl,
|
|
@@ -8,18 +17,6 @@ hr {
|
|
|
8
17
|
margin: 0;
|
|
9
18
|
}
|
|
10
19
|
|
|
11
|
-
.w-4rem {
|
|
12
|
-
width: 4rem;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.w-8rem {
|
|
16
|
-
width: 8rem;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.w-12rem {
|
|
20
|
-
width: 12rem;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
20
|
.grid-cols-2 {
|
|
24
21
|
grid-template-columns: auto auto;
|
|
25
22
|
}
|
|
@@ -42,7 +39,7 @@ hr {
|
|
|
42
39
|
bottom: 0;
|
|
43
40
|
left: 0;
|
|
44
41
|
width: 330px;
|
|
45
|
-
margin:
|
|
42
|
+
margin: rem(16);
|
|
46
43
|
flex-direction: column;
|
|
47
44
|
display: flex;
|
|
48
45
|
|
package/tsconfig.json
CHANGED
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"preserveSymlinks": true,
|
|
10
10
|
"moduleResolution": "node",
|
|
11
11
|
"lib": ["es2017", "dom"],
|
|
12
|
-
"
|
|
13
|
-
"typeRoots": ["node_modules/@types", "src/types"],
|
|
12
|
+
"typeRoots": ["node_modules/@types"],
|
|
14
13
|
"noUnusedLocals": true,
|
|
15
14
|
"resolveJsonModule": true,
|
|
16
15
|
"noEmit": true,
|