@bysages/solid 0.2.3 → 0.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.
Files changed (140) hide show
  1. package/README.md +16 -2
  2. package/dist/{ai-response-B_586r27.mjs → ai-response-ClGGptX3.mjs} +15 -15
  3. package/dist/chevron-D5RzcayK.mjs +9 -0
  4. package/dist/components/affix/index.mjs +15 -17
  5. package/dist/components/ai/index.d.mts +1 -1
  6. package/dist/components/ai/index.mjs +12 -10
  7. package/dist/components/ai-action/index.mjs +2 -2
  8. package/dist/components/ai-attachments/index.mjs +50 -38
  9. package/dist/components/ai-message/index.mjs +11 -13
  10. package/dist/components/ai-prompt-input/index.mjs +70 -53
  11. package/dist/components/ai-reasoning/index.mjs +10 -6
  12. package/dist/components/ai-response/index.mjs +1 -1
  13. package/dist/components/ai-source/index.mjs +23 -23
  14. package/dist/components/ai-suggestion/index.mjs +1 -1
  15. package/dist/components/ai-tool/index.mjs +29 -17
  16. package/dist/components/alert/index.mjs +37 -42
  17. package/dist/components/angle-slider/index.mjs +2 -2
  18. package/dist/components/aspect-ratio/index.mjs +14 -16
  19. package/dist/components/autocomplete/index.mjs +3 -2
  20. package/dist/components/avatar/index.d.mts +3 -0
  21. package/dist/components/avatar/index.mjs +10 -5
  22. package/dist/components/avatar-group/index.mjs +11 -13
  23. package/dist/components/back-top/index.mjs +31 -27
  24. package/dist/components/badge/index.mjs +14 -16
  25. package/dist/components/banner/index.mjs +24 -28
  26. package/dist/components/bento/index.d.mts +24 -0
  27. package/dist/components/bento/index.mjs +51 -0
  28. package/dist/components/block-ui/index.d.mts +12 -0
  29. package/dist/components/block-ui/index.mjs +43 -0
  30. package/dist/components/breadcrumb/index.mjs +7 -5
  31. package/dist/components/browser/index.d.mts +21 -0
  32. package/dist/components/browser/index.mjs +87 -0
  33. package/dist/components/button/index.mjs +27 -29
  34. package/dist/components/button-group/index.mjs +18 -20
  35. package/dist/components/calendar/index.mjs +141 -129
  36. package/dist/components/card/index.mjs +2 -2
  37. package/dist/components/cascade-select/index.mjs +160 -121
  38. package/dist/components/checkbox/index.mjs +2 -2
  39. package/dist/components/checkbox-group/index.mjs +53 -55
  40. package/dist/components/chip/index.mjs +22 -20
  41. package/dist/components/clipboard/index.mjs +2 -2
  42. package/dist/components/color-picker/index.mjs +2 -2
  43. package/dist/components/combobox/index.mjs +2 -2
  44. package/dist/components/command/index.mjs +73 -57
  45. package/dist/components/comment/index.mjs +77 -62
  46. package/dist/components/config-provider/index.mjs +10 -8
  47. package/dist/components/container/index.mjs +14 -16
  48. package/dist/components/data-view/index.d.mts +18 -0
  49. package/dist/components/data-view/index.mjs +110 -0
  50. package/dist/components/date-input/index.mjs +2 -2
  51. package/dist/components/date-picker/index.mjs +2 -2
  52. package/dist/components/deferred-content/index.d.mts +16 -0
  53. package/dist/components/deferred-content/index.mjs +52 -0
  54. package/dist/components/descriptions/index.d.mts +9 -1
  55. package/dist/components/descriptions/index.mjs +43 -16
  56. package/dist/components/dock/index.d.mts +22 -0
  57. package/dist/components/dock/index.mjs +64 -0
  58. package/dist/components/dynamic-input/index.mjs +71 -68
  59. package/dist/components/editable/index.mjs +2 -2
  60. package/dist/components/ellipsis/index.mjs +17 -19
  61. package/dist/components/empty/index.mjs +2 -2
  62. package/dist/components/file-upload/index.mjs +2 -2
  63. package/dist/components/float-button/index.mjs +39 -38
  64. package/dist/components/form/index.d.mts +1 -1
  65. package/dist/components/form/index.mjs +52 -37
  66. package/dist/components/grid/index.mjs +19 -21
  67. package/dist/components/icon/index.d.mts +9 -4
  68. package/dist/components/icon/index.mjs +37 -36
  69. package/dist/components/image/index.mjs +44 -43
  70. package/dist/components/image-viewer/index.mjs +46 -37
  71. package/dist/components/input/index.d.mts +3 -0
  72. package/dist/components/input/index.mjs +1 -41
  73. package/dist/components/input-group/index.mjs +14 -18
  74. package/dist/components/kbd/index.mjs +8 -10
  75. package/dist/components/layout/index.mjs +77 -77
  76. package/dist/components/link/index.mjs +12 -13
  77. package/dist/components/list/index.mjs +52 -47
  78. package/dist/components/listbox/index.mjs +2 -2
  79. package/dist/components/masonry/index.mjs +15 -17
  80. package/dist/components/mentions/index.mjs +1 -1
  81. package/dist/components/menu/index.mjs +2 -2
  82. package/dist/components/menubar/index.mjs +58 -57
  83. package/dist/components/meter/index.mjs +41 -41
  84. package/dist/components/number-input/index.mjs +2 -2
  85. package/dist/components/order-list/index.d.mts +21 -0
  86. package/dist/components/order-list/index.mjs +160 -0
  87. package/dist/components/page-header/index.mjs +2 -2
  88. package/dist/components/pagination/index.mjs +2 -2
  89. package/dist/components/password-input/index.mjs +2 -2
  90. package/dist/components/pin-input/index.mjs +2 -2
  91. package/dist/components/popconfirm/index.mjs +19 -12
  92. package/dist/components/progress/index.mjs +2 -2
  93. package/dist/components/progress-group/index.mjs +65 -58
  94. package/dist/components/radio-group/index.mjs +2 -2
  95. package/dist/components/rating-group/index.mjs +2 -2
  96. package/dist/components/result/index.d.mts +22 -0
  97. package/dist/components/result/index.mjs +66 -0
  98. package/dist/components/select/index.d.mts +2 -17
  99. package/dist/components/select/index.mjs +2 -18
  100. package/dist/components/separator/index.mjs +17 -19
  101. package/dist/components/skeleton/index.mjs +8 -10
  102. package/dist/components/slider/index.mjs +2 -2
  103. package/dist/components/spinner/index.mjs +15 -17
  104. package/dist/components/split-button/index.mjs +84 -83
  105. package/dist/components/spotlight/index.d.mts +11 -0
  106. package/dist/components/spotlight/index.mjs +38 -0
  107. package/dist/components/stack/index.mjs +20 -22
  108. package/dist/components/stat/index.mjs +12 -14
  109. package/dist/components/steps/index.mjs +2 -2
  110. package/dist/components/switch/index.mjs +2 -2
  111. package/dist/components/table/index.mjs +308 -211
  112. package/dist/components/tabs/index.d.mts +2 -0
  113. package/dist/components/tabs/index.mjs +10 -5
  114. package/dist/components/tags-input/index.mjs +2 -2
  115. package/dist/components/terminal/index.d.mts +17 -0
  116. package/dist/components/terminal/index.mjs +84 -0
  117. package/dist/components/textarea/index.mjs +8 -8
  118. package/dist/components/timeline/index.d.mts +9 -3
  119. package/dist/components/timeline/index.mjs +18 -3
  120. package/dist/components/toggle-group/index.mjs +2 -2
  121. package/dist/components/toolbar/index.d.mts +17 -0
  122. package/dist/components/toolbar/index.mjs +46 -0
  123. package/dist/components/transfer/index.mjs +116 -107
  124. package/dist/components/tree-select/index.mjs +29 -21
  125. package/dist/components/tree-view/index.mjs +2 -2
  126. package/dist/components/typography/index.mjs +2 -2
  127. package/dist/components/user/index.d.mts +19 -0
  128. package/dist/components/user/index.mjs +68 -0
  129. package/dist/components/virtual-list/index.d.mts +17 -0
  130. package/dist/components/virtual-list/index.mjs +71 -0
  131. package/dist/components/watermark/index.mjs +19 -13
  132. package/dist/{index-B4XS2n2y.d.mts → index-IfofF-SW.d.mts} +718 -3773
  133. package/dist/index-YPUiqD3n.d.mts +42 -0
  134. package/dist/index.d.mts +16 -3
  135. package/dist/index.mjs +20 -7
  136. package/dist/input-DoFQ7RXh.mjs +78 -0
  137. package/dist/{mentions-xbI6vJAP.mjs → mentions-f5Js_2W7.mjs} +76 -70
  138. package/dist/select-CHaXbzLX.mjs +115 -0
  139. package/package.json +28 -7
  140. package/dist/chevron-GWEoEYdO.mjs +0 -9
@@ -1,11 +1,11 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
2
+ import { claimElement, createComponent, insert, memo, mergeProps, spread, template } from "@solidjs/web";
3
3
  import { Show, createContext, splitProps, useContext } from "solid-js";
4
4
  import { Field } from "@ark-ui/solid/field";
5
5
  import { createField, createForm } from "@tanstack/solid-form";
6
6
  //#region src/components/form/index.tsx
7
- var _tmpl$ = /*#__PURE__*/ template(`<form>`);
8
- var _tmpl$2 = /*#__PURE__*/ template(`<div>`);
7
+ var _tmpl$ = /* @__PURE__ */ template(`<form>`);
8
+ var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
9
9
  const FormContext = createContext(null);
10
10
  /** A validator's complaint is a string or a Standard Schema issue; both
11
11
  * reduce to the sentence the field shows. */
@@ -25,15 +25,16 @@ function Form(props) {
25
25
  },
26
26
  get children() {
27
27
  var _el$ = _tmpl$();
28
- spread(_el$, mergeProps(rest, {
28
+ claimElement(_el$);
29
+ spread(_el$, [rest, {
29
30
  "data-scope": "form",
30
31
  "data-part": "root",
31
- "novalidate": true,
32
- "onSubmit": (event) => {
32
+ novalidate: true,
33
+ onSubmit: (event) => {
33
34
  event.preventDefault();
34
35
  own.form.handleSubmit();
35
36
  }
36
- }), false, false);
37
+ }], false);
37
38
  return _el$;
38
39
  }
39
40
  });
@@ -57,38 +58,52 @@ function FormField(props) {
57
58
  const meta = field().state.meta;
58
59
  return (meta.isTouched ? meta.errors ?? [] : [meta.errorMap?.onSubmit].flat().filter(Boolean)).map(errorText).filter(Boolean);
59
60
  };
60
- return (() => {
61
- var _el$2 = _tmpl$2();
62
- spread(_el$2, mergeProps(rest, { get ["data-form-field"]() {
63
- return own.name;
64
- } }), false, true);
65
- insert(_el$2, createComponent(Field.Root, {
66
- get invalid() {
67
- return own.invalid || errors().length > 0;
68
- },
69
- get required() {
70
- return own.required;
71
- },
72
- get disabled() {
73
- return own.disabled;
74
- },
75
- get children() {
76
- return [
77
- memo(() => memo(() => !!own.label)() ? createComponent(Field.Label, { get children() {
61
+ var _el$2 = _tmpl$2();
62
+ spread(_el$2, [rest, { get "data-form-field"() {
63
+ return own.name;
64
+ } }], true);
65
+ insert(_el$2, createComponent(Field.Root, {
66
+ get invalid() {
67
+ return own.invalid || errors().length > 0;
68
+ },
69
+ get required() {
70
+ return own.required;
71
+ },
72
+ get disabled() {
73
+ return own.disabled;
74
+ },
75
+ get children() {
76
+ return [
77
+ memo(() => {
78
+ return memo(() => {
79
+ return !!own.label;
80
+ })() ? createComponent(Field.Label, { get children() {
78
81
  return own.label;
79
- } }) : null),
80
- memo(() => memo(() => typeof own.children === "function")() ? own.children(field) : own.children),
81
- memo(() => memo(() => !!(own.hint && errors().length === 0))() ? createComponent(Field.HelperText, { get children() {
82
+ } }) : null;
83
+ }),
84
+ memo(() => {
85
+ return memo(() => {
86
+ return typeof own.children === "function";
87
+ })() ? own.children(field) : own.children;
88
+ }),
89
+ memo(() => {
90
+ return memo(() => {
91
+ return !!(own.hint && errors().length === 0);
92
+ })() ? createComponent(Field.HelperText, { get children() {
82
93
  return own.hint;
83
- } }) : null),
84
- memo(() => memo(() => errors().length > 0)() ? createComponent(Field.ErrorText, { get children() {
94
+ } }) : null;
95
+ }),
96
+ memo(() => {
97
+ return memo(() => {
98
+ return errors().length > 0;
99
+ })() ? createComponent(Field.ErrorText, { get children() {
85
100
  return errors()[0];
86
- } }) : null)
87
- ];
88
- }
89
- }));
90
- return _el$2;
91
- })();
101
+ } }) : null;
102
+ })
103
+ ];
104
+ }
105
+ }));
106
+ return _el$2;
92
107
  };
93
108
  return createComponent(Show, {
94
109
  get when() {
@@ -107,4 +122,4 @@ function FormField(props) {
107
122
  });
108
123
  }
109
124
  //#endregion
110
- export { Form, FormField, createField, createForm };
125
+ export { Form, FormField, createField, createField as useField, createForm, createForm as useForm };
@@ -1,8 +1,8 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { mergeProps, spread, template } from "solid-js/web";
2
+ import { spread, template } from "@solidjs/web";
3
3
  import { splitProps } from "solid-js";
4
4
  //#region src/components/grid/index.tsx
5
- var _tmpl$ = /*#__PURE__*/ template(`<div>`);
5
+ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
6
6
  /** The same named steps of the space ramp the stack uses — one
7
7
  * vocabulary of distance across the layout primitives. */
8
8
  const gapVars = {
@@ -20,25 +20,23 @@ function Grid(props) {
20
20
  "gap",
21
21
  "minChildWidth"
22
22
  ]);
23
- return (() => {
24
- var _el$ = _tmpl$();
25
- spread(_el$, mergeProps(rest, {
26
- get style() {
27
- return {
28
- ...rest.style,
29
- "--bs-grid-columns": String(own.columns ?? 12),
30
- "--bs-grid-gap": gapVars[own.gap ?? "md"] ?? gapVars.md,
31
- ...own.minChildWidth != null ? { "--bs-grid-min-child-width": own.minChildWidth } : {}
32
- };
33
- },
34
- "data-scope": "grid",
35
- "data-part": "root",
36
- get ["data-autofill"]() {
37
- return own.minChildWidth != null ? "" : void 0;
38
- }
39
- }), false, false);
40
- return _el$;
41
- })();
23
+ var _el$ = _tmpl$();
24
+ spread(_el$, [rest, {
25
+ get style() {
26
+ return {
27
+ ...rest.style,
28
+ "--bs-grid-columns": String(own.columns ?? 12),
29
+ "--bs-grid-gap": gapVars[own.gap ?? "md"] ?? gapVars.md,
30
+ ...own.minChildWidth != null ? { "--bs-grid-min-child-width": own.minChildWidth } : {}
31
+ };
32
+ },
33
+ "data-scope": "grid",
34
+ "data-part": "root",
35
+ get "data-autofill"() {
36
+ return own.minChildWidth != null ? "" : void 0;
37
+ }
38
+ }], false);
39
+ return _el$;
42
40
  }
43
41
  //#endregion
44
42
  export { Grid };
@@ -1,9 +1,11 @@
1
1
  import { JSX } from "solid-js";
2
+ import { IconifyIcon } from "@bysages/core/icons";
2
3
  //#region src/components/icon/index.d.ts
3
4
  /** The inkwell: a standard box that keeps any inline svg at its optical
4
5
  * measure and in the text's own ink — the icon carries no pigment and no
5
- * size of its own. Bring a glyph through `name` from the registry, or
6
- * bring your own; the well renders either. */
6
+ * size of its own. Bring a glyph through `glyph` (a direct registry
7
+ * import), through `name` from the whitelisted registry, or bring your
8
+ * own; the well renders either. */
7
9
  export interface IconProps extends JSX.HTMLAttributes<HTMLSpanElement> {
8
10
  /** Size steps follow the surrounding font size; `inherit` is the
9
11
  * default — one em of the text the icon sits in. */
@@ -11,8 +13,11 @@ export interface IconProps extends JSX.HTMLAttributes<HTMLSpanElement> {
11
13
  /** The accessible name. Without it the icon is presentation-only and
12
14
  * hidden from the accessibility tree. */
13
15
  label?: string;
14
- /** A glyph from the registry. Ignored when children are given — an
15
- * explicit glyph always wins over the registry. */
16
+ /** A glyph from the registry, imported directly. Ignored when children
17
+ * are given — an explicit glyph always wins. */
18
+ glyph?: IconifyIcon;
19
+ /** A registry name — only the whitelisted set the wrappers draw
20
+ * themselves. Ignored when `glyph` or children are given. */
16
21
  name?: string;
17
22
  }
18
23
  export declare function Icon(props: IconProps): JSX.Element;
@@ -1,53 +1,54 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { effect, insert, mergeProps, setAttribute, spread, template } from "solid-js/web";
2
+ import { effect, insert, setAttribute, spread, template } from "@solidjs/web";
3
3
  import { splitProps } from "solid-js";
4
- import { getIcon } from "@bysages/icons";
4
+ import { getIcon } from "@bysages/core/icons";
5
5
  //#region src/components/icon/index.tsx
6
- var _tmpl$ = /*#__PURE__*/ template(`<span>`);
7
- var _tmpl$2 = /*#__PURE__*/ template(`<svg fill=currentColor aria-hidden=true>`);
6
+ var _tmpl$ = /* @__PURE__ */ template(`<span>`);
7
+ var _tmpl$2 = /* @__PURE__ */ template(`<svg fill=currentColor aria-hidden=true>`);
8
8
  function Icon(props) {
9
9
  injectComponentStyle("icon");
10
10
  const [own, rest] = splitProps(props, [
11
11
  "size",
12
12
  "label",
13
+ "glyph",
13
14
  "name",
14
15
  "children"
15
16
  ]);
16
- const glyph = own.name && own.children == null ? getIcon(own.name) : void 0;
17
- if (own.name && own.children == null && !glyph) console.error(`[icons] unknown icon name "${own.name}" — extend packages/icons/icons.config.json and rerun the generator`);
18
- return (() => {
19
- var _el$ = _tmpl$();
20
- spread(_el$, mergeProps(rest, {
21
- get role() {
22
- return own.label != null ? "img" : void 0;
23
- },
24
- get ["aria-label"]() {
25
- return own.label;
26
- },
27
- get ["aria-hidden"]() {
28
- return own.label != null ? void 0 : "true";
29
- },
30
- "data-scope": "icon",
31
- "data-part": "root",
32
- get ["data-size"]() {
33
- return own.size ?? "inherit";
34
- }
35
- }), false, true);
36
- insert(_el$, () => own.children ?? (glyph ? (() => {
17
+ const resolved = own.glyph ?? (own.name && own.children == null ? getIcon(own.name) : void 0);
18
+ if (own.name && own.children == null && own.glyph == null && !resolved) console.error(`[icons] unknown icon name "${own.name}" — not in the wrappers' whitelist; import the glyph from @bysages/icons and pass it as glyph`);
19
+ var _el$ = _tmpl$();
20
+ spread(_el$, [rest, {
21
+ get role() {
22
+ return own.label != null ? "img" : void 0;
23
+ },
24
+ get "aria-label"() {
25
+ return own.label;
26
+ },
27
+ get "aria-hidden"() {
28
+ return own.label != null ? void 0 : "true";
29
+ },
30
+ "data-scope": "icon",
31
+ "data-part": "root",
32
+ get "data-size"() {
33
+ return own.size ?? "inherit";
34
+ }
35
+ }], true);
36
+ insert(_el$, () => {
37
+ return own.children ?? (resolved ? (() => {
37
38
  var _el$2 = _tmpl$2();
38
- effect((_p$) => {
39
- var _v$ = `0 0 ${glyph.width ?? 24} ${glyph.height ?? 24}`, _v$2 = glyph.body;
40
- _v$ !== _p$.e && setAttribute(_el$2, "viewBox", _p$.e = _v$);
41
- _v$2 !== _p$.t && (_el$2.innerHTML = _p$.t = _v$2);
42
- return _p$;
43
- }, {
44
- e: void 0,
45
- t: void 0
39
+ effect(() => {
40
+ return {
41
+ e: `0 0 ${resolved.width ?? 24} ${resolved.height ?? 24}`,
42
+ t: resolved.body
43
+ };
44
+ }, ({ e, t }, _p$) => {
45
+ e !== _p$?.e && setAttribute(_el$2, "viewBox", e);
46
+ t !== _p$?.t && (_el$2.innerHTML = t);
46
47
  });
47
48
  return _el$2;
48
- })() : null));
49
- return _el$;
50
- })();
49
+ })() : null);
50
+ });
51
+ return _el$;
51
52
  }
52
53
  //#endregion
53
54
  export { Icon };
@@ -1,12 +1,12 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { createComponent, effect, insert, mergeProps, setAttribute, spread, template } from "solid-js/web";
2
+ import { createComponent, effect, insert, setAttribute, spread, template } from "@solidjs/web";
3
3
  import { Show, createEffect, createSignal, on, splitProps } from "solid-js";
4
4
  //#region src/components/image/index.tsx
5
- var _tmpl$ = /*#__PURE__*/ template(`<svg><rect x=3 y=4 width=18 height=16 rx=1.5></svg>`, false, true, false);
6
- var _tmpl$2 = /*#__PURE__*/ template(`<svg><circle cx=9 cy=10 r=1.5></svg>`, false, true, false);
7
- var _tmpl$3 = /*#__PURE__*/ template(`<svg><path d="m5.5 17.5 4.5-5 3 3.5 2.5-3 3 4.5"></svg>`, false, true, false);
8
- var _tmpl$4 = /*#__PURE__*/ template(`<div data-scope=image data-part=fallback>`);
9
- var _tmpl$5 = /*#__PURE__*/ template(`<figure><img data-scope=image data-part=img decoding=async>`, true, false, false);
5
+ var _tmpl$ = /* @__PURE__ */ template(`<svg><rect x=3 y=4 width=18 height=16 rx=1.5></svg>`, 2);
6
+ var _tmpl$2 = /* @__PURE__ */ template(`<svg><circle cx=9 cy=10 r=1.5></svg>`, 2);
7
+ var _tmpl$3 = /* @__PURE__ */ template(`<svg><path d="m5.5 17.5 4.5-5 3 3.5 2.5-3 3 4.5"></svg>`, 2);
8
+ var _tmpl$4 = /* @__PURE__ */ template(`<div data-scope=image data-part=fallback>`);
9
+ var _tmpl$5 = /* @__PURE__ */ template(`<figure><img data-scope=image data-part=img decoding=async>`, 1);
10
10
  /** The mark for a source that never arrived: a quiet mountain-and-sun,
11
11
  * drawn in the stylesheet's stroke and hidden from the reader. */
12
12
  function placeholderGlyph() {
@@ -27,43 +27,44 @@ function Image(props) {
27
27
  ]);
28
28
  const [state, setState] = createSignal("loading");
29
29
  createEffect(on(() => own.src, () => setState("loading")));
30
- return (() => {
31
- var _el$4 = _tmpl$5(), _el$5 = _el$4.firstChild;
32
- spread(_el$4, mergeProps(rest, {
33
- "data-scope": "image",
34
- "data-part": "root",
35
- get ["data-state"]() {
36
- return state();
37
- },
38
- get ["data-fit"]() {
39
- return own.fit ?? "cover";
40
- }
41
- }), false, true);
42
- _el$5.addEventListener("error", () => setState("error"));
43
- _el$5.addEventListener("load", () => setState("loaded"));
44
- insert(_el$4, createComponent(Show, {
45
- get when() {
46
- return state() === "error";
47
- },
48
- get children() {
49
- var _el$6 = _tmpl$4();
50
- insert(_el$6, () => own.fallback ?? placeholderGlyph());
51
- return _el$6;
52
- }
53
- }), null);
54
- effect((_p$) => {
55
- var _v$ = own.src, _v$2 = own.alt ?? "", _v$3 = own.loading ?? "lazy";
56
- _v$ !== _p$.e && setAttribute(_el$5, "src", _p$.e = _v$);
57
- _v$2 !== _p$.t && setAttribute(_el$5, "alt", _p$.t = _v$2);
58
- _v$3 !== _p$.a && setAttribute(_el$5, "loading", _p$.a = _v$3);
59
- return _p$;
60
- }, {
61
- e: void 0,
62
- t: void 0,
63
- a: void 0
64
- });
65
- return _el$4;
66
- })();
30
+ var _el$4 = _tmpl$5();
31
+ var _el$5 = _el$4.firstChild;
32
+ spread(_el$4, [rest, {
33
+ "data-scope": "image",
34
+ "data-part": "root",
35
+ get "data-state"() {
36
+ return state();
37
+ },
38
+ get "data-fit"() {
39
+ return own.fit ?? "cover";
40
+ }
41
+ }], true);
42
+ _el$5.addEventListener("error", () => setState("error"));
43
+ _el$5.addEventListener("load", () => setState("loaded"));
44
+ insert(_el$4, createComponent(Show, {
45
+ get when() {
46
+ return state() === "error";
47
+ },
48
+ get children() {
49
+ var _el$6 = _tmpl$4();
50
+ insert(_el$6, () => {
51
+ return own.fallback ?? placeholderGlyph();
52
+ });
53
+ return _el$6;
54
+ }
55
+ }), null);
56
+ effect(() => {
57
+ return {
58
+ e: own.src,
59
+ t: own.alt ?? "",
60
+ a: own.loading ?? "lazy"
61
+ };
62
+ }, ({ e, t, a }, _p$) => {
63
+ e !== _p$?.e && setAttribute(_el$5, "src", e);
64
+ t !== _p$?.t && setAttribute(_el$5, "alt", t);
65
+ a !== _p$?.a && setAttribute(_el$5, "loading", a);
66
+ });
67
+ return _el$4;
67
68
  }
68
69
  //#endregion
69
70
  export { Image };
@@ -1,21 +1,22 @@
1
1
  import { Button } from "../button/index.mjs";
2
2
  import { ButtonGroup } from "../button-group/index.mjs";
3
3
  import { injectComponentStyle } from "@bysages/core";
4
- import { Portal, createComponent, effect, insert, memo, setAttribute, setStyleProperty, template } from "solid-js/web";
4
+ import { createComponent, effect, insert, memo, setAttribute, setStyleProperty, template } from "@solidjs/web";
5
5
  import { Show, createEffect, createSignal, splitProps } from "solid-js";
6
+ import { Portal } from "solid-js/web";
6
7
  import { Dialog } from "@ark-ui/solid/dialog";
7
8
  //#region src/components/image-viewer/index.tsx
8
- var _tmpl$ = /*#__PURE__*/ template(`<svg><circle cx=11 cy=11 r=7></svg>`, false, true, false);
9
- var _tmpl$2 = /*#__PURE__*/ template(`<svg><path d="m16.2 16.2 4.8 4.8"></svg>`, false, true, false);
10
- var _tmpl$3 = /*#__PURE__*/ template(`<svg><path d="M8 11h6"></svg>`, false, true, false);
11
- var _tmpl$4 = /*#__PURE__*/ template(`<svg><path d="M11 8v6"></svg>`, false, true, false);
12
- var _tmpl$5 = /*#__PURE__*/ template(`<svg><path d="M20.49 12A8.5 8.5 0 1 1 18 6.06"></svg>`, false, true, false);
13
- var _tmpl$6 = /*#__PURE__*/ template(`<svg><path d="M20.5 3.5v4h-4"></svg>`, false, true, false);
14
- var _tmpl$7 = /*#__PURE__*/ template(`<svg><path d="m6 6 12 12"></svg>`, false, true, false);
15
- var _tmpl$8 = /*#__PURE__*/ template(`<svg><path d="M18 6 6 18"></svg>`, false, true, false);
16
- var _tmpl$9 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`);
17
- var _tmpl$0 = /*#__PURE__*/ template(`<img data-scope=image-viewer data-part=viewport>`);
18
- var _tmpl$1 = /*#__PURE__*/ template(`<div data-scope=image-viewer data-part=toolbar>`);
9
+ var _tmpl$ = /* @__PURE__ */ template(`<svg><circle cx=11 cy=11 r=7></svg>`, 2);
10
+ var _tmpl$2 = /* @__PURE__ */ template(`<svg><path d="m16.2 16.2 4.8 4.8"></svg>`, 2);
11
+ var _tmpl$3 = /* @__PURE__ */ template(`<svg><path d="M8 11h6"></svg>`, 2);
12
+ var _tmpl$4 = /* @__PURE__ */ template(`<svg><path d="M11 8v6"></svg>`, 2);
13
+ var _tmpl$5 = /* @__PURE__ */ template(`<svg><path d="M20.49 12A8.5 8.5 0 1 1 18 6.06"></svg>`, 2);
14
+ var _tmpl$6 = /* @__PURE__ */ template(`<svg><path d="M20.5 3.5v4h-4"></svg>`, 2);
15
+ var _tmpl$7 = /* @__PURE__ */ template(`<svg><path d="m6 6 12 12"></svg>`, 2);
16
+ var _tmpl$8 = /* @__PURE__ */ template(`<svg><path d="M18 6 6 18"></svg>`, 2);
17
+ var _tmpl$9 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`);
18
+ var _tmpl$10 = /* @__PURE__ */ template(`<img data-scope=image-viewer data-part=viewport>`);
19
+ var _tmpl$11 = /* @__PURE__ */ template(`<div data-scope=image-viewer data-part=toolbar>`);
19
20
  const MIN_SCALE = .5;
20
21
  const MAX_SCALE = 3;
21
22
  const SCALE_STEP = .25;
@@ -72,9 +73,9 @@ function ImageViewer(props) {
72
73
  "aria-label": label,
73
74
  onClick,
74
75
  get children() {
75
- var _el$10 = _tmpl$9();
76
- insert(_el$10, glyph);
77
- return _el$10;
76
+ var _el$12 = _tmpl$9();
77
+ insert(_el$12, glyph);
78
+ return _el$12;
78
79
  }
79
80
  });
80
81
  }
@@ -87,12 +88,12 @@ function ImageViewer(props) {
87
88
  unmountOnExit: true,
88
89
  get children() {
89
90
  return createComponent(Portal, { get children() {
90
- return [createComponent(Dialog.Backdrop, { "class": "bs-image-viewer-backdrop" }), createComponent(Dialog.Positioner, {
91
- "class": "bs-image-viewer-positioner",
91
+ return [createComponent(Dialog.Backdrop, { class: "bs-image-viewer-backdrop" }), createComponent(Dialog.Positioner, {
92
+ class: "bs-image-viewer-positioner",
92
93
  get children() {
93
94
  return createComponent(Dialog.Content, {
94
- "class": "bs-image-viewer-content",
95
- get ["aria-label"]() {
95
+ class: "bs-image-viewer-content",
96
+ get "aria-label"() {
96
97
  return own.alt || "Image preview";
97
98
  },
98
99
  onClick: (event) => {
@@ -100,36 +101,44 @@ function ImageViewer(props) {
100
101
  },
101
102
  get children() {
102
103
  return [(() => {
103
- var _el$11 = _tmpl$0();
104
- effect((_p$) => {
105
- var _v$ = own.src, _v$2 = own.alt ?? "", _v$3 = `scale(${scale()}) rotate(${rotation()}deg)`;
106
- _v$ !== _p$.e && setAttribute(_el$11, "src", _p$.e = _v$);
107
- _v$2 !== _p$.t && setAttribute(_el$11, "alt", _p$.t = _v$2);
108
- _v$3 !== _p$.a && setStyleProperty(_el$11, "transform", _p$.a = _v$3);
109
- return _p$;
110
- }, {
111
- e: void 0,
112
- t: void 0,
113
- a: void 0
104
+ var _el$13 = _tmpl$10();
105
+ effect(() => {
106
+ return {
107
+ e: own.src,
108
+ t: own.alt ?? "",
109
+ a: `scale(${scale()}) rotate(${rotation()}deg)`
110
+ };
111
+ }, ({ e, t, a }, _p$) => {
112
+ e !== _p$?.e && setAttribute(_el$13, "src", e);
113
+ t !== _p$?.t && setAttribute(_el$13, "alt", t);
114
+ a !== _p$?.a && setStyleProperty(_el$13, "transform", a);
114
115
  });
115
- return _el$11;
116
+ return _el$13;
116
117
  })(), (() => {
117
- var _el$12 = _tmpl$1();
118
- insert(_el$12, createComponent(ButtonGroup, { get children() {
118
+ var _el$14 = _tmpl$11();
119
+ insert(_el$14, createComponent(ButtonGroup, { get children() {
119
120
  return [
120
121
  createComponent(Show, {
121
122
  get when() {
122
123
  return own.zoomable ?? true;
123
124
  },
124
125
  get children() {
125
- return [memo(() => toolButton("Zoom in", TOOL_GLYPHS.zoomIn, () => zoom(SCALE_STEP))), memo(() => toolButton("Zoom out", TOOL_GLYPHS.zoomOut, () => zoom(-.25)))];
126
+ return [memo(() => {
127
+ return toolButton("Zoom in", TOOL_GLYPHS.zoomIn, () => zoom(SCALE_STEP));
128
+ }), memo(() => {
129
+ return toolButton("Zoom out", TOOL_GLYPHS.zoomOut, () => zoom(-.25));
130
+ })];
126
131
  }
127
132
  }),
128
- memo(() => toolButton("Rotate 90 degrees", TOOL_GLYPHS.rotate, rotate)),
129
- memo(() => toolButton("Close", TOOL_GLYPHS.close, () => setOpen(false)))
133
+ memo(() => {
134
+ return toolButton("Rotate 90 degrees", TOOL_GLYPHS.rotate, rotate);
135
+ }),
136
+ memo(() => {
137
+ return toolButton("Close", TOOL_GLYPHS.close, () => setOpen(false));
138
+ })
130
139
  ];
131
140
  } }));
132
- return _el$12;
141
+ return _el$14;
133
142
  })()];
134
143
  }
135
144
  });
@@ -5,6 +5,9 @@ export interface InputProps extends JSX.InputHTMLAttributes<HTMLInputElement> {
5
5
  onValueChange?: (value: string) => void;
6
6
  size?: "sm" | "md" | "lg";
7
7
  invalid?: boolean;
8
+ /** Entry mask - `9` digit, `a` letter, `*` either, anything else is
9
+ * literal. e.g. `"999-99-9999"`, `"(999) 999-9999"`. */
10
+ mask?: string;
8
11
  }
9
12
  /** The bare text input: the field recipe — border, surface, focus halo —
10
13
  * on a native control. Standing alone it styles itself from the `invalid`
@@ -1,42 +1,2 @@
1
- import { injectComponentStyle } from "@bysages/core";
2
- import { mergeProps, spread, template } from "solid-js/web";
3
- import { mergeProps as mergeProps$1, splitProps } from "solid-js";
4
- import { useFieldContext } from "@ark-ui/solid/field";
5
- //#region src/components/input/index.tsx
6
- var _tmpl$ = /*#__PURE__*/ template(`<input>`);
7
- /** The bare text input: the field recipe — border, surface, focus halo —
8
- * on a native control. Standing alone it styles itself from the `invalid`
9
- * prop; inside a `Field.Root` it consumes the field context, picking up
10
- * the label id, the described-by wiring and the invalid state for free,
11
- * which is also the seam the Form validation layer will drive. Disabled
12
- * rides the native attribute. */
13
- function Input(props) {
14
- injectComponentStyle("input");
15
- const field = useFieldContext();
16
- const [own, rest] = splitProps(props, [
17
- "value",
18
- "size",
19
- "invalid",
20
- "onValueChange"
21
- ]);
22
- return (() => {
23
- var _el$ = _tmpl$();
24
- spread(_el$, mergeProps(() => mergeProps$1(() => field?.().getInputProps() ?? {}, rest, {
25
- get value() {
26
- return own.value;
27
- },
28
- "data-scope": "input",
29
- "data-part": "root",
30
- get "data-size"() {
31
- return own.size ?? "md";
32
- },
33
- get "data-invalid"() {
34
- return own.invalid || field?.().getInputProps()["data-invalid"] != null ? "" : void 0;
35
- },
36
- onInput: (event) => own.onValueChange?.(event.currentTarget.value)
37
- })), false, false);
38
- return _el$;
39
- })();
40
- }
41
- //#endregion
1
+ import { t as Input } from "../../input-DoFQ7RXh.mjs";
42
2
  export { Input };
@@ -1,7 +1,7 @@
1
1
  import { injectComponentStyle } from "@bysages/core";
2
- import { mergeProps, spread, template } from "solid-js/web";
2
+ import { spread, template } from "@solidjs/web";
3
3
  //#region src/components/input-group/index.tsx
4
- var _tmpl$ = /*#__PURE__*/ template(`<div>`);
4
+ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
5
5
  /**
6
6
  * Merged controls: attachments and the entry fused into one seal. The
7
7
  * Root draws the single hairline and carries the group's focus halo;
@@ -12,24 +12,20 @@ var _tmpl$ = /*#__PURE__*/ template(`<div>`);
12
12
  * adds no visuals of its own.
13
13
  */
14
14
  function InputGroupRoot(props) {
15
- return (() => {
16
- var _el$ = _tmpl$();
17
- spread(_el$, mergeProps(props, {
18
- "data-scope": "input-group",
19
- "data-part": "root"
20
- }), false, false);
21
- return _el$;
22
- })();
15
+ var _el$ = _tmpl$();
16
+ spread(_el$, [props, {
17
+ "data-scope": "input-group",
18
+ "data-part": "root"
19
+ }], false);
20
+ return _el$;
23
21
  }
24
22
  function InputGroupAddon(props) {
25
- return (() => {
26
- var _el$2 = _tmpl$();
27
- spread(_el$2, mergeProps(props, {
28
- "data-scope": "input-group",
29
- "data-part": "addon"
30
- }), false, false);
31
- return _el$2;
32
- })();
23
+ var _el$2 = _tmpl$();
24
+ spread(_el$2, [props, {
25
+ "data-scope": "input-group",
26
+ "data-part": "addon"
27
+ }], false);
28
+ return _el$2;
33
29
  }
34
30
  const InputGroup = Object.assign(InputGroupRoot, {
35
31
  Root: InputGroupRoot,