@soave/ui 0.1.0 → 0.2.1
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/adapters/css-variables.d.ts +2 -0
- package/dist/adapters/css-variables.mjs +228 -0
- package/dist/adapters/headless.d.ts +7 -0
- package/dist/adapters/headless.mjs +7 -0
- package/dist/adapters/index.d.ts +5 -0
- package/dist/adapters/index.mjs +11 -0
- package/dist/adapters/tailwind.d.ts +2 -0
- package/dist/adapters/tailwind.mjs +443 -0
- package/dist/adapters/types.d.ts +38 -0
- package/dist/adapters/types.mjs +10 -0
- package/dist/build.config.mjs +1 -1
- package/dist/components/ui/Alert.vue +18 -16
- package/dist/components/ui/AlertDescription.vue +13 -3
- package/dist/components/ui/AlertTitle.vue +13 -3
- package/dist/components/ui/Button.vue +30 -4
- package/dist/components/ui/Card.vue +27 -3
- package/dist/components/ui/CardContent.vue +13 -3
- package/dist/components/ui/CardDescription.vue +13 -3
- package/dist/components/ui/CardFooter.vue +13 -3
- package/dist/components/ui/CardHeader.vue +13 -3
- package/dist/components/ui/CardTitle.vue +13 -3
- package/dist/components/ui/Checkbox.vue +23 -2
- package/dist/components/ui/Dialog.vue +34 -17
- package/dist/components/ui/DialogDescription.vue +13 -3
- package/dist/components/ui/DialogFooter.vue +13 -3
- package/dist/components/ui/DialogHeader.vue +13 -3
- package/dist/components/ui/DialogTitle.vue +13 -3
- package/dist/components/ui/DropdownMenu.vue +4 -5
- package/dist/components/ui/DropdownMenuContent.vue +17 -14
- package/dist/components/ui/DropdownMenuItem.vue +12 -18
- package/dist/components/ui/DropdownMenuTrigger.vue +1 -1
- package/dist/components/ui/Input.vue +26 -3
- package/dist/components/ui/Popover.vue +4 -5
- package/dist/components/ui/PopoverContent.vue +17 -13
- package/dist/components/ui/PopoverTrigger.vue +1 -1
- package/dist/components/ui/RadioGroup.vue +12 -7
- package/dist/components/ui/RadioItem.vue +31 -10
- package/dist/components/ui/Select.vue +8 -1
- package/dist/components/ui/SelectContent.vue +31 -5
- package/dist/components/ui/SelectItem.vue +20 -16
- package/dist/components/ui/SelectTrigger.vue +39 -7
- package/dist/components/ui/SelectValue.vue +13 -2
- package/dist/components/ui/Sheet.vue +34 -26
- package/dist/components/ui/SheetDescription.vue +13 -6
- package/dist/components/ui/SheetFooter.vue +13 -6
- package/dist/components/ui/SheetHeader.vue +13 -6
- package/dist/components/ui/SheetTitle.vue +13 -6
- package/dist/components/ui/Switch.vue +23 -3
- package/dist/components/ui/Textarea.vue +26 -3
- package/dist/components/ui/Toast.vue +38 -29
- package/dist/components/ui/Toaster.vue +12 -16
- package/dist/components/ui/TooltipContent.vue +18 -15
- package/dist/components/ui/UIProvider.vue +6 -2
- package/dist/composables/index.d.ts +1 -1
- package/dist/composables/index.mjs +1 -1
- package/dist/composables/useUIConfig.d.ts +16 -5
- package/dist/composables/useUIConfig.mjs +26 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/styles/css-variables.css +1 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.mjs +1 -0
- package/dist/types/alert.d.ts +2 -0
- package/dist/types/card.d.ts +5 -0
- package/dist/types/composables.d.ts +122 -0
- package/dist/types/composables.mjs +0 -0
- package/dist/types/config.d.ts +8 -0
- package/dist/types/dialog.d.ts +12 -1
- package/dist/types/dialog.mjs +1 -0
- package/dist/types/dropdown.d.ts +11 -0
- package/dist/types/dropdown.mjs +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/popover.d.ts +9 -0
- package/dist/types/popover.mjs +1 -0
- package/dist/types/radio.d.ts +4 -0
- package/dist/types/select.d.ts +21 -0
- package/dist/types/sheet.d.ts +21 -0
- package/dist/types/sheet.mjs +1 -0
- package/dist/types/toast.d.ts +2 -0
- package/dist/types/tooltip.d.ts +6 -0
- package/package.json +9 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
export const cssVariablesAdapter = {
|
|
2
|
+
name: "css-variables",
|
|
3
|
+
description: "CSS Variables \u30D9\u30FC\u30B9\u306E\u30B9\u30BF\u30A4\u30EA\u30F3\u30B0\uFF08BEM\u547D\u540D\uFF09",
|
|
4
|
+
getClasses(component, state) {
|
|
5
|
+
switch (component) {
|
|
6
|
+
case "button":
|
|
7
|
+
return getCssVariablesButtonClasses(state);
|
|
8
|
+
case "input":
|
|
9
|
+
return getCssVariablesInputClasses(state);
|
|
10
|
+
case "card":
|
|
11
|
+
return getCssVariablesCardClasses(state);
|
|
12
|
+
case "dialog":
|
|
13
|
+
return getCssVariablesDialogClasses(state);
|
|
14
|
+
case "dialog-overlay":
|
|
15
|
+
return "dialog__overlay";
|
|
16
|
+
case "checkbox":
|
|
17
|
+
return getCssVariablesCheckboxClasses(state);
|
|
18
|
+
case "radio":
|
|
19
|
+
return getCssVariablesRadioClasses(state);
|
|
20
|
+
case "radio-group":
|
|
21
|
+
return getCssVariablesRadioGroupClasses(state);
|
|
22
|
+
case "radio-indicator":
|
|
23
|
+
return "radio__indicator";
|
|
24
|
+
case "switch":
|
|
25
|
+
return getCssVariablesSwitchClasses(state);
|
|
26
|
+
case "textarea":
|
|
27
|
+
return getCssVariablesTextareaClasses(state);
|
|
28
|
+
case "select":
|
|
29
|
+
return getCssVariablesSelectClasses(state);
|
|
30
|
+
case "select-content":
|
|
31
|
+
return "select__content";
|
|
32
|
+
case "select-item":
|
|
33
|
+
return "select__item";
|
|
34
|
+
case "select-value":
|
|
35
|
+
return getCssVariablesSelectValueClasses(state);
|
|
36
|
+
case "select-trigger-icon":
|
|
37
|
+
return "select__trigger-icon";
|
|
38
|
+
case "toast":
|
|
39
|
+
return getCssVariablesToastClasses(state);
|
|
40
|
+
case "toast-title":
|
|
41
|
+
return "toast__title";
|
|
42
|
+
case "toast-description":
|
|
43
|
+
return "toast__description";
|
|
44
|
+
case "toast-action":
|
|
45
|
+
return "toast__action";
|
|
46
|
+
case "toast-dismiss":
|
|
47
|
+
return "toast__dismiss";
|
|
48
|
+
case "toaster":
|
|
49
|
+
return getCssVariablesToasterClasses(state);
|
|
50
|
+
case "tooltip":
|
|
51
|
+
return getCssVariablesTooltipClasses(state);
|
|
52
|
+
case "popover":
|
|
53
|
+
return getCssVariablesPopoverClasses(state);
|
|
54
|
+
case "dropdown":
|
|
55
|
+
return getCssVariablesDropdownClasses(state);
|
|
56
|
+
case "dropdown-item":
|
|
57
|
+
return "dropdown__item";
|
|
58
|
+
case "sheet":
|
|
59
|
+
return getCssVariablesSheetClasses(state);
|
|
60
|
+
case "sheet-overlay":
|
|
61
|
+
return "sheet__overlay";
|
|
62
|
+
case "sheet-header":
|
|
63
|
+
return "sheet__header";
|
|
64
|
+
case "sheet-title":
|
|
65
|
+
return "sheet__title";
|
|
66
|
+
case "sheet-description":
|
|
67
|
+
return "sheet__description";
|
|
68
|
+
case "sheet-footer":
|
|
69
|
+
return "sheet__footer";
|
|
70
|
+
case "sheet-close":
|
|
71
|
+
return "sheet__close";
|
|
72
|
+
case "alert":
|
|
73
|
+
return getCssVariablesAlertClasses(state);
|
|
74
|
+
case "alert-title":
|
|
75
|
+
return "alert__title";
|
|
76
|
+
case "alert-description":
|
|
77
|
+
return "alert__description";
|
|
78
|
+
case "label":
|
|
79
|
+
return "label";
|
|
80
|
+
// Dialog sub-components
|
|
81
|
+
case "dialog-header":
|
|
82
|
+
return "dialog__header";
|
|
83
|
+
case "dialog-title":
|
|
84
|
+
return "dialog__title";
|
|
85
|
+
case "dialog-description":
|
|
86
|
+
return "dialog__description";
|
|
87
|
+
case "dialog-footer":
|
|
88
|
+
return "dialog__footer";
|
|
89
|
+
case "dialog-close":
|
|
90
|
+
return "dialog__close";
|
|
91
|
+
// Card sub-components
|
|
92
|
+
case "card-header":
|
|
93
|
+
return "card__header";
|
|
94
|
+
case "card-title":
|
|
95
|
+
return "card__title";
|
|
96
|
+
case "card-description":
|
|
97
|
+
return "card__description";
|
|
98
|
+
case "card-content":
|
|
99
|
+
return "card__content";
|
|
100
|
+
case "card-footer":
|
|
101
|
+
return "card__footer";
|
|
102
|
+
default:
|
|
103
|
+
return "";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
function getCssVariablesButtonClasses(state) {
|
|
108
|
+
return [
|
|
109
|
+
"button",
|
|
110
|
+
`button--${state.variant}`,
|
|
111
|
+
`button--${state.size}`,
|
|
112
|
+
state.disabled && "button--disabled",
|
|
113
|
+
state.loading && "button--loading"
|
|
114
|
+
].filter(Boolean).join(" ");
|
|
115
|
+
}
|
|
116
|
+
function getCssVariablesInputClasses(state) {
|
|
117
|
+
return [
|
|
118
|
+
"input",
|
|
119
|
+
`input--${state.size}`,
|
|
120
|
+
state.error && "input--error",
|
|
121
|
+
state.disabled && "input--disabled",
|
|
122
|
+
state.readonly && "input--readonly"
|
|
123
|
+
].filter(Boolean).join(" ");
|
|
124
|
+
}
|
|
125
|
+
function getCssVariablesCardClasses(state) {
|
|
126
|
+
return [
|
|
127
|
+
"card",
|
|
128
|
+
state.padding !== "none" && `card--padding-${state.padding}`
|
|
129
|
+
].filter(Boolean).join(" ");
|
|
130
|
+
}
|
|
131
|
+
function getCssVariablesDialogClasses(state) {
|
|
132
|
+
return [
|
|
133
|
+
"dialog",
|
|
134
|
+
state.is_open && "dialog--open"
|
|
135
|
+
].filter(Boolean).join(" ");
|
|
136
|
+
}
|
|
137
|
+
function getCssVariablesCheckboxClasses(state) {
|
|
138
|
+
return [
|
|
139
|
+
"checkbox",
|
|
140
|
+
state.checked && "checkbox--checked",
|
|
141
|
+
state.indeterminate && "checkbox--indeterminate",
|
|
142
|
+
state.disabled && "checkbox--disabled"
|
|
143
|
+
].filter(Boolean).join(" ");
|
|
144
|
+
}
|
|
145
|
+
function getCssVariablesRadioClasses(state) {
|
|
146
|
+
return [
|
|
147
|
+
"radio",
|
|
148
|
+
state.checked && "radio--checked",
|
|
149
|
+
state.disabled && "radio--disabled"
|
|
150
|
+
].filter(Boolean).join(" ");
|
|
151
|
+
}
|
|
152
|
+
function getCssVariablesSwitchClasses(state) {
|
|
153
|
+
return [
|
|
154
|
+
"switch",
|
|
155
|
+
state.checked && "switch--checked",
|
|
156
|
+
state.disabled && "switch--disabled"
|
|
157
|
+
].filter(Boolean).join(" ");
|
|
158
|
+
}
|
|
159
|
+
function getCssVariablesTextareaClasses(state) {
|
|
160
|
+
return [
|
|
161
|
+
"textarea",
|
|
162
|
+
`textarea--${state.size}`,
|
|
163
|
+
state.error && "textarea--error",
|
|
164
|
+
state.disabled && "textarea--disabled",
|
|
165
|
+
state.readonly && "textarea--readonly"
|
|
166
|
+
].filter(Boolean).join(" ");
|
|
167
|
+
}
|
|
168
|
+
function getCssVariablesSelectClasses(state) {
|
|
169
|
+
return [
|
|
170
|
+
"select",
|
|
171
|
+
`select--${state.size}`,
|
|
172
|
+
state.is_open && "select--open",
|
|
173
|
+
state.disabled && "select--disabled"
|
|
174
|
+
].filter(Boolean).join(" ");
|
|
175
|
+
}
|
|
176
|
+
function getCssVariablesToastClasses(state) {
|
|
177
|
+
return [
|
|
178
|
+
"toast",
|
|
179
|
+
`toast--${state.variant}`
|
|
180
|
+
].filter(Boolean).join(" ");
|
|
181
|
+
}
|
|
182
|
+
function getCssVariablesTooltipClasses(state) {
|
|
183
|
+
return [
|
|
184
|
+
"tooltip",
|
|
185
|
+
state.is_open && "tooltip--open",
|
|
186
|
+
`tooltip--${state.side}`
|
|
187
|
+
].filter(Boolean).join(" ");
|
|
188
|
+
}
|
|
189
|
+
function getCssVariablesPopoverClasses(state) {
|
|
190
|
+
return [
|
|
191
|
+
"popover",
|
|
192
|
+
state.is_open && "popover--open"
|
|
193
|
+
].filter(Boolean).join(" ");
|
|
194
|
+
}
|
|
195
|
+
function getCssVariablesDropdownClasses(state) {
|
|
196
|
+
return [
|
|
197
|
+
"dropdown",
|
|
198
|
+
state.is_open && "dropdown--open"
|
|
199
|
+
].filter(Boolean).join(" ");
|
|
200
|
+
}
|
|
201
|
+
function getCssVariablesSheetClasses(state) {
|
|
202
|
+
return [
|
|
203
|
+
"sheet",
|
|
204
|
+
state.is_open && "sheet--open",
|
|
205
|
+
`sheet--${state.side}`
|
|
206
|
+
].filter(Boolean).join(" ");
|
|
207
|
+
}
|
|
208
|
+
function getCssVariablesAlertClasses(state) {
|
|
209
|
+
return ["alert", `alert--${state.variant}`].join(" ");
|
|
210
|
+
}
|
|
211
|
+
function getCssVariablesSelectValueClasses(state) {
|
|
212
|
+
return [
|
|
213
|
+
"select__value",
|
|
214
|
+
!state.hasValue && "select__value--placeholder"
|
|
215
|
+
].filter(Boolean).join(" ");
|
|
216
|
+
}
|
|
217
|
+
function getCssVariablesToasterClasses(state) {
|
|
218
|
+
return [
|
|
219
|
+
"toaster",
|
|
220
|
+
`toaster--${state.position}`
|
|
221
|
+
].join(" ");
|
|
222
|
+
}
|
|
223
|
+
function getCssVariablesRadioGroupClasses(state) {
|
|
224
|
+
return [
|
|
225
|
+
"radio-group",
|
|
226
|
+
`radio-group--${state.orientation}`
|
|
227
|
+
].join(" ");
|
|
228
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { StyleAdapter } from "./types";
|
|
2
|
+
export { registerAdapter, getAdapter, getRegisteredAdapters, ADAPTER_REGISTRY } from "./types";
|
|
3
|
+
export { tailwindAdapter } from "./tailwind";
|
|
4
|
+
export { cssVariablesAdapter } from "./css-variables";
|
|
5
|
+
export { headlessAdapter } from "./headless";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { registerAdapter, getAdapter, getRegisteredAdapters, ADAPTER_REGISTRY } from "./types.mjs";
|
|
2
|
+
export { tailwindAdapter } from "./tailwind.mjs";
|
|
3
|
+
export { cssVariablesAdapter } from "./css-variables.mjs";
|
|
4
|
+
export { headlessAdapter } from "./headless.mjs";
|
|
5
|
+
import { registerAdapter as registerAdapter2 } from "./types.mjs";
|
|
6
|
+
import { tailwindAdapter as tailwindAdapter2 } from "./tailwind.mjs";
|
|
7
|
+
import { cssVariablesAdapter as cssVariablesAdapter2 } from "./css-variables.mjs";
|
|
8
|
+
import { headlessAdapter as headlessAdapter2 } from "./headless.mjs";
|
|
9
|
+
registerAdapter2(tailwindAdapter2);
|
|
10
|
+
registerAdapter2(cssVariablesAdapter2);
|
|
11
|
+
registerAdapter2(headlessAdapter2);
|