solid-uix 0.5.1 → 0.6.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/main.css +62 -0
- package/dist/main.d.ts +15 -1
- package/dist/main.js +86 -24
- package/dist/main.jsx +61 -4
- package/package.json +3 -3
package/dist/main.css
CHANGED
|
@@ -194,6 +194,68 @@
|
|
|
194
194
|
border-color: var(--colors-error-400);
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
/* src/stepper/stepper.module.css */
|
|
198
|
+
.stepper_stepper {
|
|
199
|
+
width: 100%;
|
|
200
|
+
display: flex;
|
|
201
|
+
list-style: none;
|
|
202
|
+
padding: 0;
|
|
203
|
+
margin: 0;
|
|
204
|
+
}
|
|
205
|
+
.stepper_step {
|
|
206
|
+
position: relative;
|
|
207
|
+
flex: auto;
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
gap: 6px;
|
|
211
|
+
font-family: Inter;
|
|
212
|
+
font-weight: 400;
|
|
213
|
+
font-size: 16px;
|
|
214
|
+
text-align: center;
|
|
215
|
+
}
|
|
216
|
+
.stepper_step:last-child {
|
|
217
|
+
flex: none;
|
|
218
|
+
}
|
|
219
|
+
.stepper_step::after {
|
|
220
|
+
content: "";
|
|
221
|
+
display: block;
|
|
222
|
+
height: 1px;
|
|
223
|
+
flex: 1 1 0%;
|
|
224
|
+
background: var(--colors-black-600);
|
|
225
|
+
margin-right: 6px;
|
|
226
|
+
}
|
|
227
|
+
.stepper_step:last-child::after {
|
|
228
|
+
display: none;
|
|
229
|
+
}
|
|
230
|
+
.stepper_indicator {
|
|
231
|
+
display: flex;
|
|
232
|
+
align-items: center;
|
|
233
|
+
justify-content: center;
|
|
234
|
+
width: 24px;
|
|
235
|
+
height: 24px;
|
|
236
|
+
border-radius: 50%;
|
|
237
|
+
}
|
|
238
|
+
.stepper_indicator.stepper_accent {
|
|
239
|
+
background: var(--colors-accent-500);
|
|
240
|
+
color: var(--colors-black-900);
|
|
241
|
+
}
|
|
242
|
+
.stepper_indicator.stepper_secondary {
|
|
243
|
+
background: var(--colors-black-700);
|
|
244
|
+
}
|
|
245
|
+
.stepper_button {
|
|
246
|
+
padding: 0;
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
gap: 6px;
|
|
250
|
+
background: none;
|
|
251
|
+
border: none;
|
|
252
|
+
cursor: pointer;
|
|
253
|
+
font-family: Inter;
|
|
254
|
+
font-weight: 400;
|
|
255
|
+
font-size: 16px;
|
|
256
|
+
text-align: center;
|
|
257
|
+
}
|
|
258
|
+
|
|
197
259
|
/* src/dialog/dialog.module.css */
|
|
198
260
|
.dialog_dialog[open] {
|
|
199
261
|
background: var(--colors-black-800);
|
package/dist/main.d.ts
CHANGED
|
@@ -33,6 +33,20 @@ type TextInputProps = JSX.InputHTMLAttributes<HTMLInputElement> & {
|
|
|
33
33
|
|
|
34
34
|
declare const TextInput: (props: TextInputProps) => solid_js.JSX.Element;
|
|
35
35
|
|
|
36
|
+
type StepperProps = JSX.OlHTMLAttributes<HTMLOListElement>;
|
|
37
|
+
type StepProps = JSX.LiHTMLAttributes<HTMLLIElement>;
|
|
38
|
+
type StepIndicatorProps = JSX.HTMLAttributes<HTMLDivElement> & {
|
|
39
|
+
color?: "accent" | "secondary";
|
|
40
|
+
};
|
|
41
|
+
type StepButtonProps = JSX.LiHTMLAttributes<HTMLLIElement>;
|
|
42
|
+
|
|
43
|
+
declare const Stepper: {
|
|
44
|
+
(props: StepperProps): solid_js.JSX.Element;
|
|
45
|
+
Step: (props: StepProps) => solid_js.JSX.Element;
|
|
46
|
+
StepIndicator: (props: StepIndicatorProps) => solid_js.JSX.Element;
|
|
47
|
+
StepButton: (props: StepButtonProps) => solid_js.JSX.Element;
|
|
48
|
+
};
|
|
49
|
+
|
|
36
50
|
type OnOpenChange = (isOpen: boolean) => void;
|
|
37
51
|
/**
|
|
38
52
|
* Use event.preventDefault() to prevent dialog close
|
|
@@ -76,4 +90,4 @@ declare const Field: {
|
|
|
76
90
|
Message: (props: FieldMessageProps) => solid_js.JSX.Element;
|
|
77
91
|
};
|
|
78
92
|
|
|
79
|
-
export { Button, Checkbox, Dialog, Field, Link, TextInput, cls };
|
|
93
|
+
export { Button, Checkbox, Dialog, Field, Link, Stepper, TextInput, cls };
|
package/dist/main.js
CHANGED
|
@@ -5,8 +5,9 @@ export { default as buttonSx } from './button.module.css';
|
|
|
5
5
|
import sx2 from './link.module.css';
|
|
6
6
|
import sx3 from './checkbox.module.css';
|
|
7
7
|
import sx4 from './text_input.module.css';
|
|
8
|
-
import sx5 from './
|
|
9
|
-
import sx6 from './
|
|
8
|
+
import sx5 from './stepper.module.css';
|
|
9
|
+
import sx6 from './dialog.module.css';
|
|
10
|
+
import sx7 from './field.module.css';
|
|
10
11
|
|
|
11
12
|
// src/main.ts
|
|
12
13
|
|
|
@@ -186,6 +187,67 @@ var TextInput = (props) => {
|
|
|
186
187
|
return _el$;
|
|
187
188
|
})();
|
|
188
189
|
};
|
|
190
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<ol>`);
|
|
191
|
+
var _tmpl$23 = /* @__PURE__ */ template(`<li>`);
|
|
192
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<div>`);
|
|
193
|
+
var _tmpl$42 = /* @__PURE__ */ template(`<button type=button>`);
|
|
194
|
+
var Stepper = (props) => {
|
|
195
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
196
|
+
return (() => {
|
|
197
|
+
var _el$ = _tmpl$5();
|
|
198
|
+
spread(_el$, mergeProps$1(rest, {
|
|
199
|
+
get ["class"]() {
|
|
200
|
+
return cls(sx5.stepper, local.class);
|
|
201
|
+
}
|
|
202
|
+
}), false, true);
|
|
203
|
+
insert(_el$, () => props.children);
|
|
204
|
+
return _el$;
|
|
205
|
+
})();
|
|
206
|
+
};
|
|
207
|
+
var Step = (props) => {
|
|
208
|
+
const [local, rest] = splitProps(props, ["class"]);
|
|
209
|
+
return (() => {
|
|
210
|
+
var _el$2 = _tmpl$23();
|
|
211
|
+
spread(_el$2, mergeProps$1(rest, {
|
|
212
|
+
get ["class"]() {
|
|
213
|
+
return cls(sx5.step, local.class);
|
|
214
|
+
}
|
|
215
|
+
}), false, true);
|
|
216
|
+
insert(_el$2, () => props.children);
|
|
217
|
+
return _el$2;
|
|
218
|
+
})();
|
|
219
|
+
};
|
|
220
|
+
var defaultProps2 = {
|
|
221
|
+
color: "secondary"
|
|
222
|
+
};
|
|
223
|
+
var StepIndicator = (props) => {
|
|
224
|
+
const merged = mergeProps(defaultProps2, props);
|
|
225
|
+
const [local, rest] = splitProps(merged, ["class", "color"]);
|
|
226
|
+
return (() => {
|
|
227
|
+
var _el$3 = _tmpl$32();
|
|
228
|
+
spread(_el$3, mergeProps$1(rest, {
|
|
229
|
+
get ["class"]() {
|
|
230
|
+
return cls(sx5.indicator, local.class, local.color === "accent" && sx5.accent, local.color === "secondary" && sx5.secondary);
|
|
231
|
+
}
|
|
232
|
+
}), false, true);
|
|
233
|
+
insert(_el$3, () => props.children);
|
|
234
|
+
return _el$3;
|
|
235
|
+
})();
|
|
236
|
+
};
|
|
237
|
+
var StepButton = (props) => {
|
|
238
|
+
const [local, rest] = splitProps(props, ["children"]);
|
|
239
|
+
return createComponent(Step, mergeProps$1(rest, {
|
|
240
|
+
get children() {
|
|
241
|
+
var _el$4 = _tmpl$42();
|
|
242
|
+
insert(_el$4, () => local.children);
|
|
243
|
+
effect(() => className(_el$4, sx5.button));
|
|
244
|
+
return _el$4;
|
|
245
|
+
}
|
|
246
|
+
}));
|
|
247
|
+
};
|
|
248
|
+
Stepper.Step = Step;
|
|
249
|
+
Stepper.StepIndicator = StepIndicator;
|
|
250
|
+
Stepper.StepButton = StepButton;
|
|
189
251
|
var defaultValue2 = {
|
|
190
252
|
setDialogRef() {
|
|
191
253
|
},
|
|
@@ -247,10 +309,10 @@ var DialogProvider = (props) => {
|
|
|
247
309
|
}
|
|
248
310
|
});
|
|
249
311
|
};
|
|
250
|
-
var _tmpl$
|
|
251
|
-
var _tmpl$
|
|
252
|
-
var _tmpl$
|
|
253
|
-
var _tmpl$
|
|
312
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<dialog>`);
|
|
313
|
+
var _tmpl$24 = /* @__PURE__ */ template(`<h2>`);
|
|
314
|
+
var _tmpl$33 = /* @__PURE__ */ template(`<p>`);
|
|
315
|
+
var _tmpl$43 = /* @__PURE__ */ template(`<div>`);
|
|
254
316
|
var Dialog = (props) => {
|
|
255
317
|
return createComponent(DialogProvider, mergeProps$1(props, {
|
|
256
318
|
get children() {
|
|
@@ -272,14 +334,14 @@ var Trigger = (props) => {
|
|
|
272
334
|
var Content = (props) => {
|
|
273
335
|
const context = useDialogContext();
|
|
274
336
|
return (() => {
|
|
275
|
-
var _el$ = _tmpl$
|
|
337
|
+
var _el$ = _tmpl$6();
|
|
276
338
|
use((element) => {
|
|
277
339
|
props.ref = element;
|
|
278
340
|
context.setDialogRef(element);
|
|
279
341
|
}, _el$);
|
|
280
342
|
spread(_el$, mergeProps$1(props, {
|
|
281
343
|
get ["class"]() {
|
|
282
|
-
return cls(
|
|
344
|
+
return cls(sx6.dialog, props.class);
|
|
283
345
|
},
|
|
284
346
|
get ["aria-labelledby"]() {
|
|
285
347
|
return context.ariaLabelledBy();
|
|
@@ -301,11 +363,11 @@ var Title = (props) => {
|
|
|
301
363
|
const titleId = createUniqueId();
|
|
302
364
|
context.setTitleId(titleId);
|
|
303
365
|
return (() => {
|
|
304
|
-
var _el$2 = _tmpl$
|
|
366
|
+
var _el$2 = _tmpl$24();
|
|
305
367
|
spread(_el$2, mergeProps$1(props, {
|
|
306
368
|
"id": titleId,
|
|
307
369
|
get ["class"]() {
|
|
308
|
-
return cls(
|
|
370
|
+
return cls(sx6.title, props.class);
|
|
309
371
|
}
|
|
310
372
|
}), false, true);
|
|
311
373
|
insert(_el$2, () => props.children);
|
|
@@ -317,11 +379,11 @@ var Description = (props) => {
|
|
|
317
379
|
const descriptionId = createUniqueId();
|
|
318
380
|
context.setDescriptionId(descriptionId);
|
|
319
381
|
return (() => {
|
|
320
|
-
var _el$3 = _tmpl$
|
|
382
|
+
var _el$3 = _tmpl$33();
|
|
321
383
|
spread(_el$3, mergeProps$1(props, {
|
|
322
384
|
"id": descriptionId,
|
|
323
385
|
get ["class"]() {
|
|
324
|
-
return cls(
|
|
386
|
+
return cls(sx6.description, props.class);
|
|
325
387
|
}
|
|
326
388
|
}), false, true);
|
|
327
389
|
insert(_el$3, () => props.children);
|
|
@@ -341,10 +403,10 @@ var Close = (props) => {
|
|
|
341
403
|
};
|
|
342
404
|
var Actions = (props) => {
|
|
343
405
|
return (() => {
|
|
344
|
-
var _el$4 = _tmpl$
|
|
406
|
+
var _el$4 = _tmpl$43();
|
|
345
407
|
spread(_el$4, mergeProps$1(props, {
|
|
346
408
|
get ["class"]() {
|
|
347
|
-
return cls(
|
|
409
|
+
return cls(sx6.actions, props.class);
|
|
348
410
|
}
|
|
349
411
|
}), false, true);
|
|
350
412
|
insert(_el$4, () => props.children);
|
|
@@ -357,9 +419,9 @@ Dialog.Title = Title;
|
|
|
357
419
|
Dialog.Description = Description;
|
|
358
420
|
Dialog.Close = Close;
|
|
359
421
|
Dialog.Actions = Actions;
|
|
360
|
-
var _tmpl$
|
|
361
|
-
var _tmpl$
|
|
362
|
-
var _tmpl$
|
|
422
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div>`);
|
|
423
|
+
var _tmpl$25 = /* @__PURE__ */ template(`<label>`);
|
|
424
|
+
var _tmpl$34 = /* @__PURE__ */ template(`<p>`);
|
|
363
425
|
var Field = (props) => {
|
|
364
426
|
const [local, rest] = splitProps(props, ["class", "error"]);
|
|
365
427
|
return createComponent(FieldProvider, {
|
|
@@ -367,10 +429,10 @@ var Field = (props) => {
|
|
|
367
429
|
return !!local.error;
|
|
368
430
|
},
|
|
369
431
|
get children() {
|
|
370
|
-
var _el$ = _tmpl$
|
|
432
|
+
var _el$ = _tmpl$7();
|
|
371
433
|
spread(_el$, mergeProps$1(rest, {
|
|
372
434
|
get ["class"]() {
|
|
373
|
-
return cls(
|
|
435
|
+
return cls(sx7.field, local.class);
|
|
374
436
|
}
|
|
375
437
|
}), false, true);
|
|
376
438
|
insert(_el$, () => props.children);
|
|
@@ -382,13 +444,13 @@ var FieldLabel = (props) => {
|
|
|
382
444
|
const [local, rest] = splitProps(props, ["class"]);
|
|
383
445
|
const context = useFieldContext();
|
|
384
446
|
return (() => {
|
|
385
|
-
var _el$2 = _tmpl$
|
|
447
|
+
var _el$2 = _tmpl$25();
|
|
386
448
|
spread(_el$2, mergeProps$1(rest, {
|
|
387
449
|
get ["for"]() {
|
|
388
450
|
return context.fieldId;
|
|
389
451
|
},
|
|
390
452
|
get ["class"]() {
|
|
391
|
-
return cls(
|
|
453
|
+
return cls(sx7.label, local.class);
|
|
392
454
|
}
|
|
393
455
|
}), false, true);
|
|
394
456
|
insert(_el$2, () => rest.children);
|
|
@@ -408,11 +470,11 @@ var FieldMessage = (props) => {
|
|
|
408
470
|
return rest.children;
|
|
409
471
|
},
|
|
410
472
|
get children() {
|
|
411
|
-
var _el$3 = _tmpl$
|
|
473
|
+
var _el$3 = _tmpl$34();
|
|
412
474
|
spread(_el$3, mergeProps$1(rest, {
|
|
413
475
|
"id": messageId,
|
|
414
476
|
get ["class"]() {
|
|
415
|
-
return cls(
|
|
477
|
+
return cls(sx7.message, local.class, local.level === "error" && sx7.error);
|
|
416
478
|
}
|
|
417
479
|
}), false, true);
|
|
418
480
|
insert(_el$3, () => rest.children);
|
|
@@ -423,4 +485,4 @@ var FieldMessage = (props) => {
|
|
|
423
485
|
Field.Label = FieldLabel;
|
|
424
486
|
Field.Message = FieldMessage;
|
|
425
487
|
|
|
426
|
-
export { Button, Checkbox, Dialog, Field, Link, TextInput, cls };
|
|
488
|
+
export { Button, Checkbox, Dialog, Field, Link, Stepper, TextInput, cls };
|
package/dist/main.jsx
CHANGED
|
@@ -184,6 +184,62 @@ var TextInput = (props) => {
|
|
|
184
184
|
/>;
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
+
// src/stepper/stepper.tsx
|
|
188
|
+
import { mergeProps as mergeProps2, splitProps as splitProps5 } from "solid-js";
|
|
189
|
+
|
|
190
|
+
// src/stepper/stepper.module.css
|
|
191
|
+
var stepper_default = {
|
|
192
|
+
stepper: "stepper_stepper",
|
|
193
|
+
step: "stepper_step",
|
|
194
|
+
indicator: "stepper_indicator",
|
|
195
|
+
accent: "stepper_accent",
|
|
196
|
+
secondary: "stepper_secondary",
|
|
197
|
+
button: "stepper_button"
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
// src/stepper/stepper.tsx
|
|
201
|
+
var Stepper = (props) => {
|
|
202
|
+
const [local, rest] = splitProps5(props, ["class"]);
|
|
203
|
+
return <ol {...rest} class={cls(stepper_default.stepper, local.class)}>
|
|
204
|
+
{props.children}
|
|
205
|
+
</ol>;
|
|
206
|
+
};
|
|
207
|
+
var Step = (props) => {
|
|
208
|
+
const [local, rest] = splitProps5(props, ["class"]);
|
|
209
|
+
return <li {...rest} class={cls(stepper_default.step, local.class)}>
|
|
210
|
+
{props.children}
|
|
211
|
+
</li>;
|
|
212
|
+
};
|
|
213
|
+
var defaultProps2 = {
|
|
214
|
+
color: "secondary"
|
|
215
|
+
};
|
|
216
|
+
var StepIndicator = (props) => {
|
|
217
|
+
const merged = mergeProps2(defaultProps2, props);
|
|
218
|
+
const [local, rest] = splitProps5(merged, ["class", "color"]);
|
|
219
|
+
return <div
|
|
220
|
+
{...rest}
|
|
221
|
+
class={cls(
|
|
222
|
+
stepper_default.indicator,
|
|
223
|
+
local.class,
|
|
224
|
+
local.color === "accent" && stepper_default.accent,
|
|
225
|
+
local.color === "secondary" && stepper_default.secondary
|
|
226
|
+
)}
|
|
227
|
+
>
|
|
228
|
+
{props.children}
|
|
229
|
+
</div>;
|
|
230
|
+
};
|
|
231
|
+
var StepButton = (props) => {
|
|
232
|
+
const [local, rest] = splitProps5(props, ["children"]);
|
|
233
|
+
return <Step {...rest}>
|
|
234
|
+
<button type="button" class={stepper_default.button}>
|
|
235
|
+
{local.children}
|
|
236
|
+
</button>
|
|
237
|
+
</Step>;
|
|
238
|
+
};
|
|
239
|
+
Stepper.Step = Step;
|
|
240
|
+
Stepper.StepIndicator = StepIndicator;
|
|
241
|
+
Stepper.StepButton = StepButton;
|
|
242
|
+
|
|
187
243
|
// src/dialog/dialog.tsx
|
|
188
244
|
import { children, createEffect as createEffect2, createUniqueId as createUniqueId3 } from "solid-js";
|
|
189
245
|
|
|
@@ -331,7 +387,7 @@ Dialog.Close = Close;
|
|
|
331
387
|
Dialog.Actions = Actions;
|
|
332
388
|
|
|
333
389
|
// src/field/field.tsx
|
|
334
|
-
import { createUniqueId as createUniqueId4, Show, splitProps as
|
|
390
|
+
import { createUniqueId as createUniqueId4, Show, splitProps as splitProps6 } from "solid-js";
|
|
335
391
|
|
|
336
392
|
// src/field/field.module.css
|
|
337
393
|
var field_default = {
|
|
@@ -343,7 +399,7 @@ var field_default = {
|
|
|
343
399
|
|
|
344
400
|
// src/field/field.tsx
|
|
345
401
|
var Field = (props) => {
|
|
346
|
-
const [local, rest] =
|
|
402
|
+
const [local, rest] = splitProps6(props, ["class", "error"]);
|
|
347
403
|
return <FieldProvider error={!!local.error}>
|
|
348
404
|
<div {...rest} class={cls(field_default.field, local.class)}>
|
|
349
405
|
{props.children}
|
|
@@ -351,14 +407,14 @@ var Field = (props) => {
|
|
|
351
407
|
</FieldProvider>;
|
|
352
408
|
};
|
|
353
409
|
var FieldLabel = (props) => {
|
|
354
|
-
const [local, rest] =
|
|
410
|
+
const [local, rest] = splitProps6(props, ["class"]);
|
|
355
411
|
const context = useFieldContext();
|
|
356
412
|
return <label {...rest} for={context.fieldId} class={cls(field_default.label, local.class)}>
|
|
357
413
|
{rest.children}
|
|
358
414
|
</label>;
|
|
359
415
|
};
|
|
360
416
|
var FieldMessage = (props) => {
|
|
361
|
-
const [local, rest] =
|
|
417
|
+
const [local, rest] = splitProps6(props, ["class", "level"]);
|
|
362
418
|
const context = useFieldContext();
|
|
363
419
|
const messageId = createUniqueId4();
|
|
364
420
|
context.setMessage({ level: local.level || "info", id: messageId });
|
|
@@ -380,6 +436,7 @@ export {
|
|
|
380
436
|
Dialog,
|
|
381
437
|
Field,
|
|
382
438
|
Link,
|
|
439
|
+
Stepper,
|
|
383
440
|
TextInput,
|
|
384
441
|
button_default as buttonSx,
|
|
385
442
|
cls
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-uix",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"module": "./dist/main.js",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"solid": "./dist/main.jsx",
|
|
12
12
|
"default": "./dist/main.js"
|
|
13
13
|
},
|
|
14
|
-
"./css": {
|
|
15
|
-
"
|
|
14
|
+
"./dist/main.css": {
|
|
15
|
+
"default": "./dist/main.css"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"files": [
|