@pathscale/ui 0.0.11 → 0.0.12

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 (171) hide show
  1. package/README.md +53 -0
  2. package/dist/{Autocomplete-BLKN_nG8.d.ts → Autocomplete-gLkjMHrc.d.ts} +1 -1
  3. package/dist/Avatar-Dkd_kPlV.d.ts +40 -0
  4. package/dist/CollapseTitle-BNxog3is.d.ts +12 -0
  5. package/dist/{Field-DfUn85_1.d.ts → Field-DI2PA30N.d.ts} +1 -1
  6. package/dist/Mask-CPb596Mg.d.ts +16 -0
  7. package/dist/Menu-DgO4SHmA.d.ts +45 -0
  8. package/dist/{Progress-gN0xqhAF.d.ts → Progress-ChF4ior8.d.ts} +2 -2
  9. package/dist/Steps-Dk-UPL6r.d.ts +38 -0
  10. package/dist/{Tabs-BNR3p92D.d.ts → Tabs-WiUU0xsM.d.ts} +1 -1
  11. package/dist/chunk/2OJYONJ3.js +40 -0
  12. package/dist/chunk/2VQ2762Z.js +80 -0
  13. package/dist/chunk/2XPPNBYK.js +164 -0
  14. package/dist/chunk/3I23P4TJ.js +33 -0
  15. package/dist/chunk/5HG7XWVC.jsx +2956 -0
  16. package/dist/chunk/5IJ7WEIF.js +43 -0
  17. package/dist/chunk/5O6WC3OB.jsx +67 -0
  18. package/dist/chunk/6P5JIKPF.jsx +51 -0
  19. package/dist/chunk/BHLLVOVR.js +46 -0
  20. package/dist/chunk/DJI5XKAV.js +31 -0
  21. package/dist/chunk/DN3P54J2.jsx +43 -0
  22. package/dist/chunk/DVFQAAZR.js +43 -0
  23. package/dist/chunk/EDDBK4J6.js +42 -0
  24. package/dist/chunk/FZRQDGPD.jsx +54 -0
  25. package/dist/chunk/G5UEZ2VC.js +49 -0
  26. package/dist/chunk/GL7JG772.js +114 -0
  27. package/dist/chunk/HEOKGP5U.js +55 -0
  28. package/dist/chunk/HUHXQCKK.js +16 -0
  29. package/dist/chunk/I36LHZUY.jsx +31 -0
  30. package/dist/chunk/IG323YKF.jsx +50 -0
  31. package/dist/chunk/JQ4HSRDP.js +142 -0
  32. package/dist/chunk/JSQBKK7L.jsx +50 -0
  33. package/dist/chunk/K3WO7SRD.js +1 -0
  34. package/dist/chunk/KQ3RAWCE.jsx +57 -0
  35. package/dist/chunk/KXJZKDJX.jsx +0 -0
  36. package/dist/chunk/L4A67X7S.js +7 -0
  37. package/dist/chunk/LGDDR242.jsx +159 -0
  38. package/dist/chunk/MM2DZQL3.js +46 -0
  39. package/dist/chunk/MZWBWFDD.js +151 -0
  40. package/dist/chunk/O7LDJCQS.jsx +18 -0
  41. package/dist/chunk/Q4442PU4.js +42 -0
  42. package/dist/chunk/R5G3PODL.jsx +11 -0
  43. package/dist/chunk/R6ZBT7CY.jsx +55 -0
  44. package/dist/chunk/RHEFVSMJ.jsx +52 -0
  45. package/dist/chunk/STFCLC5R.js +2954 -0
  46. package/dist/chunk/SVJIYMYJ.jsx +156 -0
  47. package/dist/chunk/SYWB4UN3.jsx +64 -0
  48. package/dist/chunk/UNKDNDT3.js +62 -0
  49. package/dist/chunk/XM3KF5LV.jsx +179 -0
  50. package/dist/chunk/XQCSYRVP.jsx +168 -0
  51. package/dist/chunk/YWIT2MRI.jsx +43 -0
  52. package/dist/chunk/ZYEP35R3.jsx +60 -0
  53. package/dist/components/Progress/index.d.ts +1 -1
  54. package/dist/components/accordion/index.d.ts +17 -5
  55. package/dist/components/accordion/index.js +1 -1
  56. package/dist/components/accordion/index.jsx +6 -4
  57. package/dist/components/autocomplete/index.d.ts +2 -2
  58. package/dist/components/avatar/index.d.ts +4 -4
  59. package/dist/components/avatar/index.js +1 -1
  60. package/dist/components/avatar/index.jsx +3 -2
  61. package/dist/components/badge/index.d.ts +17 -0
  62. package/dist/components/badge/index.js +1 -0
  63. package/dist/components/badge/index.jsx +8 -0
  64. package/dist/components/breadcrumbs/index.d.ts +9 -0
  65. package/dist/components/breadcrumbs/index.js +1 -0
  66. package/dist/components/breadcrumbs/index.jsx +7 -0
  67. package/dist/components/button/index.d.ts +28 -6
  68. package/dist/components/button/index.js +1 -1
  69. package/dist/components/button/index.jsx +5 -5
  70. package/dist/components/checkbox/index.d.ts +13 -5
  71. package/dist/components/checkbox/index.js +1 -1
  72. package/dist/components/checkbox/index.jsx +5 -4
  73. package/dist/components/collapse/index.d.ts +15 -0
  74. package/dist/components/collapse/index.js +1 -0
  75. package/dist/components/collapse/index.jsx +14 -0
  76. package/dist/components/field/index.d.ts +1 -1
  77. package/dist/components/fileinput/index.d.ts +16 -0
  78. package/dist/components/fileinput/index.js +1 -0
  79. package/dist/components/fileinput/index.jsx +8 -0
  80. package/dist/components/input/index.d.ts +13 -8
  81. package/dist/components/input/index.js +1 -1
  82. package/dist/components/input/index.jsx +5 -6
  83. package/dist/components/join/index.d.ts +11 -0
  84. package/dist/components/join/index.js +1 -0
  85. package/dist/components/join/index.jsx +9 -0
  86. package/dist/components/mask/index.d.ts +7 -0
  87. package/dist/components/mask/index.js +1 -0
  88. package/dist/components/mask/index.jsx +8 -0
  89. package/dist/components/menu/index.d.ts +6 -64
  90. package/dist/components/menu/index.js +1 -1
  91. package/dist/components/menu/index.jsx +4 -7
  92. package/dist/components/pagination/index.d.ts +6 -6
  93. package/dist/components/pagination/index.js +1 -1
  94. package/dist/components/pagination/index.jsx +6 -4
  95. package/dist/components/polymorphic/index.d.ts +1 -1
  96. package/dist/components/select/index.d.ts +12 -5
  97. package/dist/components/select/index.js +1 -1
  98. package/dist/components/select/index.jsx +5 -4
  99. package/dist/components/steps/index.d.ts +3 -4
  100. package/dist/components/steps/index.js +1 -1
  101. package/dist/components/steps/index.jsx +3 -2
  102. package/dist/components/tabs/index.d.ts +2 -2
  103. package/dist/components/textarea/index.d.ts +12 -5
  104. package/dist/components/textarea/index.js +1 -1
  105. package/dist/components/textarea/index.jsx +5 -4
  106. package/dist/components/toggle/index.d.ts +15 -0
  107. package/dist/components/toggle/index.js +1 -0
  108. package/dist/components/toggle/index.jsx +8 -0
  109. package/dist/components/tooltip/index.d.ts +14 -5
  110. package/dist/components/tooltip/index.js +1 -1
  111. package/dist/components/tooltip/index.jsx +5 -4
  112. package/dist/index.d.ts +24 -19
  113. package/dist/index.js +23 -20
  114. package/dist/index.jsx +81 -66
  115. package/dist/types-CUG9pToa.d.ts +15 -0
  116. package/package.json +4 -2
  117. package/dist/Accordion-nwuRbRRw.d.ts +0 -27
  118. package/dist/Avatar-CzIirpVq.d.ts +0 -33
  119. package/dist/Button-B50OLXuV.d.ts +0 -63
  120. package/dist/Checkbox-CzeDsQLA.d.ts +0 -32
  121. package/dist/Input-X4gwIB-F.d.ts +0 -42
  122. package/dist/Pagination-CJtlFMHy.d.ts +0 -43
  123. package/dist/Select-CP-TUHJv.d.ts +0 -44
  124. package/dist/Steps-1miUeyCD.d.ts +0 -34
  125. package/dist/Switch-CW6QtO1Y.d.ts +0 -76
  126. package/dist/Tag-BPrhn-Ne.d.ts +0 -42
  127. package/dist/Textarea-Cpdk7m6S.d.ts +0 -37
  128. package/dist/Tooltip-BfPongoz.d.ts +0 -53
  129. package/dist/Upload-CRljD5jf.d.ts +0 -39
  130. package/dist/chunk/3VOILEMN.js +0 -187
  131. package/dist/chunk/C4745OZS.jsx +0 -101
  132. package/dist/chunk/CJZGTNJZ.js +0 -115
  133. package/dist/chunk/DBQ7IOPU.js +0 -189
  134. package/dist/chunk/EB7KXR65.js +0 -102
  135. package/dist/chunk/EE4HXMKA.js +0 -165
  136. package/dist/chunk/ELRAUORW.jsx +0 -179
  137. package/dist/chunk/F33TSIEQ.jsx +0 -181
  138. package/dist/chunk/GWFGP2JQ.jsx +0 -179
  139. package/dist/chunk/LAQPAV5I.jsx +0 -187
  140. package/dist/chunk/LI3HCFL7.jsx +0 -132
  141. package/dist/chunk/LMPV5G35.jsx +0 -228
  142. package/dist/chunk/MI773TMC.js +0 -107
  143. package/dist/chunk/MMTAND25.jsx +0 -126
  144. package/dist/chunk/NZKPDBTE.js +0 -118
  145. package/dist/chunk/O2IMHWMY.js +0 -159
  146. package/dist/chunk/OMRJVDZV.js +0 -173
  147. package/dist/chunk/OYAKKETQ.js +0 -111
  148. package/dist/chunk/PF47YREI.js +0 -214
  149. package/dist/chunk/PNPC2OI3.jsx +0 -156
  150. package/dist/chunk/QHJOIUYT.jsx +0 -117
  151. package/dist/chunk/QONDPQ2I.jsx +0 -105
  152. package/dist/chunk/R6COBCN7.jsx +0 -100
  153. package/dist/chunk/T7IZ26YC.jsx +0 -194
  154. package/dist/chunk/TT2JYGLU.js +0 -218
  155. package/dist/chunk/V6Y5E7BL.js +0 -133
  156. package/dist/chunk/WB6NEEQV.jsx +0 -107
  157. package/dist/chunk/WYHYWDOM.js +0 -164
  158. package/dist/chunk/XD34JKSU.jsx +0 -201
  159. package/dist/chunk/YDEDUOFM.js +0 -102
  160. package/dist/components/breadcrumb/index.d.ts +0 -47
  161. package/dist/components/breadcrumb/index.js +0 -1
  162. package/dist/components/breadcrumb/index.jsx +0 -9
  163. package/dist/components/switch/index.d.ts +0 -8
  164. package/dist/components/switch/index.js +0 -1
  165. package/dist/components/switch/index.jsx +0 -7
  166. package/dist/components/tag/index.d.ts +0 -8
  167. package/dist/components/tag/index.js +0 -1
  168. package/dist/components/tag/index.jsx +0 -7
  169. package/dist/components/upload/index.d.ts +0 -8
  170. package/dist/components/upload/index.js +0 -1
  171. package/dist/components/upload/index.jsx +0 -7
@@ -1,187 +0,0 @@
1
- import {
2
- classes,
3
- cva
4
- } from "./P7WPLZNA.jsx";
5
-
6
- // src/components/steps/Steps.tsx
7
- import {
8
- createSignal,
9
- splitProps,
10
- For,
11
- Show,
12
- createMemo
13
- } from "solid-js";
14
-
15
- // src/components/steps/Steps.styles.ts
16
- var stepsContainer = cva("flex flex-col", {
17
- variants: {
18
- animated: {
19
- true: "transition-all duration-300 ease-in-out",
20
- false: ""
21
- }
22
- },
23
- defaultVariants: { animated: false }
24
- });
25
- var navBar = cva("flex items-center justify-between mb-6");
26
- var navItem = cva(
27
- "relative flex-1 flex flex-col items-center",
28
- {
29
- variants: {
30
- clickable: {
31
- true: "cursor-pointer",
32
- false: "pointer-events-none"
33
- },
34
- disabled: {
35
- true: "opacity-50 pointer-events-none",
36
- false: ""
37
- }
38
- },
39
- defaultVariants: { clickable: false, disabled: false }
40
- }
41
- );
42
- var marker = cva(
43
- "w-8 h-8 flex items-center justify-center rounded-full border-2",
44
- {
45
- variants: {
46
- active: {
47
- true: "bg-blue-500 border-blue-500 text-white",
48
- false: "bg-white border-gray-300 text-gray-600"
49
- }
50
- },
51
- defaultVariants: { active: false }
52
- }
53
- );
54
- var line = cva("absolute top-1/2 left-full w-full h-0.5", {
55
- variants: {
56
- active: {
57
- true: "bg-blue-500",
58
- false: "bg-gray-300"
59
- }
60
- },
61
- defaultVariants: { active: false }
62
- });
63
- var title = cva("mt-2 text-sm", {
64
- variants: {
65
- active: {
66
- true: "text-blue-600 font-medium",
67
- false: "text-gray-600"
68
- }
69
- },
70
- defaultVariants: { active: false }
71
- });
72
- var subtitle = cva("text-xs mt-1", {
73
- variants: {
74
- color: {
75
- default: "text-blue-500",
76
- muted: "text-gray-500",
77
- accent: "text-green-500"
78
- }
79
- },
80
- defaultVariants: { color: "default" }
81
- });
82
- var buttonSteps = cva("px-4 py-2 bg-blue-600 text-white rounded");
83
-
84
- // src/components/steps/Steps.tsx
85
- var Steps = (props) => {
86
- const [local, variantProps, otherProps] = splitProps(
87
- props,
88
- ["steps", "animated", "initial", "value", "onStepChange", "className"],
89
- ["animated"]
90
- );
91
- const isControlled = () => local.value !== void 0;
92
- const [internalIndex, setInternalIndex] = createSignal(local.initial ?? 0);
93
- const activeIndex = createMemo(
94
- () => isControlled() ? local.value : internalIndex()
95
- );
96
- const clamp = (i) => Math.max(0, Math.min(i, local.steps.length - 1));
97
- const changeIndex = (i) => {
98
- const idx = clamp(i);
99
- if (isControlled()) local.onStepChange?.(idx);
100
- else setInternalIndex(idx);
101
- };
102
- const next = () => changeIndex(activeIndex() + 1);
103
- const back = () => changeIndex(activeIndex() - 1);
104
- const isActive = (i) => i === activeIndex();
105
- const isPast = (i) => i < activeIndex();
106
- return <div
107
- class={classes(
108
- stepsContainer({ animated: local.animated }),
109
- local.className
110
- )}
111
- {...otherProps}
112
- >
113
- <nav class={navBar()}>
114
- <For each={local.steps}>
115
- {(step, idx) => {
116
- const i = idx();
117
- return <div
118
- class={navItem({ clickable: !!step.clickable })}
119
- onClick={() => step.clickable && changeIndex(i)}
120
- >
121
- <div class={marker({ active: isActive(i) || isPast(i) })}>
122
- {step.marker ?? String(i + 1)}
123
- </div>
124
- <Show when={i < local.steps.length - 1}>
125
- <div class={line({ active: isPast(i) })} />
126
- </Show>
127
- <div class={title({ active: isActive(i) || isPast(i) })}>
128
- {step.title}
129
- </div>
130
- <Show when={step.subtitle}>
131
- <div class={subtitle()}>{step.subtitle}</div>
132
- </Show>
133
- </div>;
134
- }}
135
- </For>
136
- </nav>
137
- <div>
138
- <For each={local.steps}>
139
- {(step, idx) => {
140
- const i = idx();
141
- return <Show when={isActive(i)}>
142
- <div>
143
- {step.content}
144
- <div class="flex justify-end gap-2 mt-6">
145
- <Show when={i > 0}>
146
- <button
147
- type="button"
148
- class="px-4 py-2 border rounded"
149
- onClick={back}
150
- >
151
- Back
152
- </button>
153
- </Show>
154
- <Show when={i < local.steps.length - 1}>
155
- <button
156
- type="button"
157
- class={buttonSteps()}
158
- onClick={next}
159
- >
160
- Next
161
- </button>
162
- </Show>
163
- <Show when={i === local.steps.length - 1}>
164
- <button
165
- type="button"
166
- class="px-4 py-2 bg-green-600 text-white rounded"
167
- onClick={() => changeIndex(0)}
168
- >
169
- Restart
170
- </button>
171
- </Show>
172
- </div>
173
- </div>
174
- </Show>;
175
- }}
176
- </For>
177
- </div>
178
- </div>;
179
- };
180
- var Steps_default = Steps;
181
-
182
- // src/components/steps/index.ts
183
- var steps_default = Steps_default;
184
-
185
- export {
186
- steps_default
187
- };
@@ -1,132 +0,0 @@
1
- import {
2
- classes,
3
- cva
4
- } from "./P7WPLZNA.jsx";
5
-
6
- // src/components/tag/Tag.tsx
7
- import {
8
- splitProps,
9
- createMemo,
10
- Show,
11
- untrack
12
- } from "solid-js";
13
-
14
- // src/components/tag/Tag.styles.ts
15
- var tagVariants = cva(
16
- [
17
- "inline-flex items-center gap-2 px-3 py-1 text-sm rounded",
18
- "transition select-none"
19
- ],
20
- {
21
- variants: {
22
- size: {
23
- normal: "text-xs px-2 py-0.5",
24
- medium: "text-sm px-3 py-1",
25
- large: "text-base px-4 py-2"
26
- },
27
- type: {
28
- primary: "bg-blue-500 text-white",
29
- info: "bg-sky-500 text-white",
30
- success: "bg-green-500 text-white",
31
- warning: "bg-yellow-500 text-black",
32
- danger: "bg-red-500 text-white",
33
- dark: "bg-zinc-800 text-white",
34
- light: "bg-gray-100 text-black"
35
- },
36
- rounded: {
37
- true: "rounded-full",
38
- false: ""
39
- },
40
- closable: {
41
- true: "pr-1",
42
- false: ""
43
- }
44
- },
45
- defaultVariants: {
46
- size: "normal"
47
- }
48
- }
49
- );
50
-
51
- // src/components/tag/Tag.tsx
52
- var Tag = (props) => {
53
- const [localProps, variantProps, otherProps] = splitProps(
54
- props,
55
- [
56
- "closable",
57
- "attached",
58
- "onClose",
59
- "ariaCloseLabel",
60
- "closeIcon",
61
- "children",
62
- "type"
63
- ],
64
- ["class", ...tagVariants.variantKeys]
65
- );
66
- const isAttachedClosable = createMemo(
67
- () => untrack(() => localProps.attached && localProps.closable)
68
- );
69
- const isClosable = createMemo(
70
- () => untrack(() => localProps.closable && !localProps.attached)
71
- );
72
- const tagClasses = createMemo(
73
- () => classes(
74
- tagVariants({
75
- ...variantProps,
76
- closable: localProps.closable
77
- }),
78
- variantProps.class
79
- )
80
- );
81
- const attachedButtonClasses = createMemo(
82
- () => tagVariants({
83
- ...variantProps,
84
- class: "ml-1 text-xs hover:opacity-80"
85
- })
86
- );
87
- const handleClose = (e) => {
88
- untrack(() => {
89
- if (typeof localProps.onClose === "function") {
90
- localProps.onClose(e);
91
- }
92
- });
93
- };
94
- return <div
95
- class={isAttachedClosable() ? "tags has-addons" : void 0}
96
- role="group"
97
- >
98
- <span class={tagClasses()} role="status" {...otherProps}>
99
- <span class="truncate">{localProps.children}</span>
100
-
101
- <Show when={isClosable()}>
102
- <button
103
- type="button"
104
- aria-label={localProps.ariaCloseLabel ?? "Remove tag"}
105
- onClick={handleClose}
106
- class="ml-2 text-xs text-white hover:opacity-80"
107
- >
108
- {localProps.closeIcon ?? "\xD7"}
109
- </button>
110
- </Show>
111
- </span>
112
-
113
- <Show when={isAttachedClosable()}>
114
- <button
115
- type="button"
116
- aria-label={localProps.ariaCloseLabel ?? "Remove tag"}
117
- onClick={handleClose}
118
- class={attachedButtonClasses()}
119
- >
120
- {localProps.closeIcon ?? "\xD7"}
121
- </button>
122
- </Show>
123
- </div>;
124
- };
125
- var Tag_default = Tag;
126
-
127
- // src/components/tag/index.ts
128
- var tag_default = Tag_default;
129
-
130
- export {
131
- tag_default
132
- };
@@ -1,228 +0,0 @@
1
- import {
2
- PolymorphicButton_default
3
- } from "./T2LDLYWV.jsx";
4
- import {
5
- cva
6
- } from "./P7WPLZNA.jsx";
7
-
8
- // src/components/button/Button.tsx
9
- import {
10
- mergeProps,
11
- splitProps,
12
- createMemo
13
- } from "solid-js";
14
-
15
- // src/components/button/Button.styles.ts
16
- var buttonVariants = cva(
17
- [
18
- "inline-flex items-center font-medium outline-none select-none",
19
- "not-disabled:cursor-pointer",
20
- "disabled:cursor-not-allowed disabled:opacity-25",
21
- "aria-busy:cursor-wait",
22
- "transition active:transition-none"
23
- ],
24
- {
25
- variants: {
26
- size: {
27
- sm: "text-sm leading-tight",
28
- md: "text-base leading-tight",
29
- lg: "text-lg leading-tight"
30
- },
31
- color: {
32
- inverse: "",
33
- primary: "",
34
- secondary: "",
35
- tertiary: "",
36
- accent: "",
37
- positive: "",
38
- destructive: ""
39
- },
40
- align: {
41
- start: "justify-start",
42
- center: "justify-center",
43
- end: "justify-end"
44
- },
45
- shape: {
46
- circle: "rounded-full",
47
- rounded: "rounded-lg"
48
- },
49
- spacing: {
50
- 0: "gap-0 p-0",
51
- xs: "gap-1.5 px-1.5 py-1.5",
52
- sm: "gap-1.5 px-2 py-2",
53
- md: "gap-1.5 px-3 py-2",
54
- lg: "gap-1.5 px-3.5 py-2.5"
55
- },
56
- loading: {
57
- true: "",
58
- false: ""
59
- },
60
- stretched: {
61
- true: "w-full",
62
- false: "w-fit"
63
- },
64
- variant: {
65
- fill: [
66
- "not-disabled:hover:opacity-75 not-disabled:active:opacity-50",
67
- "aria-[current]:opacity-75 data-expanded:opacity-75 data-open:opacity-75",
68
- "focus-visible:opacity-75"
69
- ],
70
- gray: [
71
- "bg-bg-primary not-disabled:hover:bg-bg-secondary not-disabled:active:bg-bg-secondary not-disabled:active:opacity-75",
72
- "aria-[current]:bg-bg-secondary data-expanded:bg-bg-secondary data-open:bg-bg-secondary",
73
- "focus-visible:bg-bg-secondary"
74
- ],
75
- ghost: [
76
- "not-disabled:hover:bg-bg-primary not-disabled:active:bg-bg-primary not-disabled:active:opacity-75",
77
- "aria-[current]:bg-bg-primary data-expanded:bg-bg-primary data-open:bg-bg-primary",
78
- "focus-visible:bg-bg-primary"
79
- ]
80
- }
81
- },
82
- compoundVariants: [
83
- {
84
- variant: "fill",
85
- color: "inverse",
86
- class: "bg-bg-inverse text-fg-inverse"
87
- },
88
- {
89
- variant: "fill",
90
- color: "primary",
91
- class: "bg-bg-primary text-fg-body"
92
- },
93
- {
94
- variant: "fill",
95
- color: "secondary",
96
- class: "bg-bg-secondary text-fg-body"
97
- },
98
- {
99
- variant: "fill",
100
- color: "tertiary",
101
- class: "bg-bg-tertiary text-fg-body"
102
- },
103
- {
104
- variant: "fill",
105
- color: "accent",
106
- class: "bg-bg-accent text-light"
107
- },
108
- {
109
- variant: "fill",
110
- color: "positive",
111
- class: "bg-bg-positive text-light"
112
- },
113
- {
114
- variant: "fill",
115
- color: "destructive",
116
- class: "bg-bg-destructive text-light"
117
- },
118
- {
119
- variant: "gray",
120
- color: "inverse",
121
- class: "text-fg-inverse"
122
- },
123
- {
124
- variant: "gray",
125
- color: "primary",
126
- class: "text-fg-primary"
127
- },
128
- {
129
- variant: "gray",
130
- color: "secondary",
131
- class: "text-fg-secondary"
132
- },
133
- {
134
- variant: "gray",
135
- color: "tertiary",
136
- class: "text-fg-tertiary"
137
- },
138
- {
139
- variant: "gray",
140
- color: "accent",
141
- class: "text-fg-accent"
142
- },
143
- {
144
- variant: "gray",
145
- color: "positive",
146
- class: "text-fg-positive"
147
- },
148
- {
149
- variant: "gray",
150
- color: "destructive",
151
- class: "text-fg-destructive"
152
- },
153
- {
154
- variant: "ghost",
155
- color: "inverse",
156
- class: "text-fg-inverse"
157
- },
158
- {
159
- variant: "ghost",
160
- color: "primary",
161
- class: "text-fg-primary"
162
- },
163
- {
164
- variant: "ghost",
165
- color: "secondary",
166
- class: "text-fg-secondary"
167
- },
168
- {
169
- variant: "ghost",
170
- color: "tertiary",
171
- class: "text-fg-tertiary"
172
- },
173
- {
174
- variant: "ghost",
175
- color: "accent",
176
- class: "text-fg-accent"
177
- },
178
- {
179
- variant: "ghost",
180
- color: "positive",
181
- class: "text-fg-positive"
182
- },
183
- {
184
- variant: "ghost",
185
- color: "destructive",
186
- class: "text-fg-destructive"
187
- }
188
- ],
189
- defaultVariants: {
190
- size: "md",
191
- color: "primary",
192
- align: "center",
193
- shape: "rounded",
194
- spacing: "md",
195
- variant: "fill",
196
- loading: false,
197
- stretched: false
198
- }
199
- }
200
- );
201
-
202
- // src/components/button/Button.tsx
203
- var Button = (props) => {
204
- const defaultedProps = mergeProps(
205
- {
206
- color: "primary"
207
- },
208
- props
209
- );
210
- const [variantProps, otherProps] = splitProps(defaultedProps, [
211
- "class",
212
- ...buttonVariants.variantKeys
213
- ]);
214
- const classes = createMemo(() => buttonVariants(variantProps));
215
- return <PolymorphicButton_default
216
- class={classes()}
217
- aria-busy={variantProps.loading ? "true" : void 0}
218
- {...otherProps}
219
- />;
220
- };
221
- var Button_default = Button;
222
-
223
- // src/components/button/index.ts
224
- var button_default = Button_default;
225
-
226
- export {
227
- button_default
228
- };
@@ -1,107 +0,0 @@
1
- import { cva } from './HKS7ET6T.js';
2
- import { template, insert, createComponent, spread, mergeProps as mergeProps$1, effect, className } from 'solid-js/web';
3
- import { mergeProps, splitProps, createSignal, createEffect, untrack, createMemo, Show } from 'solid-js';
4
-
5
- // src/components/avatar/Avatar.styles.ts
6
- var avatarVariants = cva(
7
- [
8
- "flex items-center justify-center mx-1",
9
- "font-medium outline-none select-none transition active:transition-none",
10
- "not-disabled:cursor-pointer",
11
- "disabled:cursor-not-allowed disabled:opacity-25",
12
- "aria-busy:cursor-wait"
13
- ],
14
- {
15
- variants: {
16
- size: {
17
- sm: "size-8 text-sm",
18
- md: "size-16 text-base",
19
- lg: "size-24 text-lg"
20
- },
21
- shape: {
22
- circle: "rounded-full overflow-hidden",
23
- rounded: "rounded-lg overflow-hidden"
24
- },
25
- variant: {
26
- filled: "bg-gray-200 text-gray-800",
27
- outlined: "border-2 border-gray-300 text-gray-800",
28
- ghost: "text-gray-800"
29
- }
30
- },
31
- defaultVariants: {
32
- size: "md",
33
- shape: "circle",
34
- variant: "filled"
35
- }
36
- }
37
- );
38
-
39
- // src/components/avatar/utils.ts
40
- function parseCaption(alt) {
41
- if (!alt) return "";
42
- const parts = alt.split(" ");
43
- if (parts.length >= 2 && parts[0] && parts[1]) {
44
- return `${parts[0][0] ?? ""}${parts[1][0] ?? ""}`;
45
- }
46
- return "";
47
- }
48
-
49
- // src/components/avatar/Avatar.tsx
50
- var _tmpl$ = /* @__PURE__ */ template(`<img class="size-full object-cover">`);
51
- var _tmpl$2 = /* @__PURE__ */ template(`<figure>`);
52
- var _tmpl$3 = /* @__PURE__ */ template(`<figcaption>`);
53
- var Avatar = (rawProps) => {
54
- const props = mergeProps({
55
- alt: "User Avatar"
56
- }, rawProps);
57
- const [variantProps, otherProps] = splitProps(props, ["class", ...avatarVariants.variantKeys]);
58
- const [source, setSource] = createSignal(props.src || props.dataSrc);
59
- createEffect(() => {
60
- untrack(() => {
61
- if (import.meta.env.PROD && props.dataSrc) {
62
- setSource(props.dataSrc);
63
- }
64
- });
65
- });
66
- const styles = createMemo(() => ({
67
- background: untrack(() => source() ? "" : props.class ?? "bg-blue-500"),
68
- text: untrack(() => source() ? "" : props.text ?? "text-white")
69
- }));
70
- const caption = createMemo(() => parseCaption(props.alt));
71
- return (() => {
72
- var _el$ = _tmpl$2();
73
- insert(_el$, createComponent(Show, {
74
- get when() {
75
- return source();
76
- },
77
- get fallback() {
78
- return (() => {
79
- var _el$3 = _tmpl$3();
80
- insert(_el$3, caption);
81
- effect(() => className(_el$3, styles().text));
82
- return _el$3;
83
- })();
84
- },
85
- get children() {
86
- var _el$2 = _tmpl$();
87
- spread(_el$2, mergeProps$1({
88
- get src() {
89
- return source();
90
- },
91
- get ["data-src"]() {
92
- return props.dataSrc;
93
- }
94
- }, otherProps), false, false);
95
- return _el$2;
96
- }
97
- }));
98
- effect(() => className(_el$, avatarVariants(variantProps)));
99
- return _el$;
100
- })();
101
- };
102
- var Avatar_default = Avatar;
103
-
104
- // src/components/avatar/index.ts
105
- var avatar_default = Avatar_default;
106
-
107
- export { avatar_default };