@cck-ui/core 0.34.0 → 0.35.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/cjs/components/color-swatch/color-swatch.cjs +439 -0
- package/cjs/components/color-swatch/color-swatch.cjs.map +1 -0
- package/cjs/components/color-swatch/color-swatch.module.cjs +13 -0
- package/cjs/components/color-swatch/color-swatch.module.cjs.map +1 -0
- package/cjs/components/color-swatch/color-swatch.utils.cjs +12 -0
- package/cjs/components/color-swatch/color-swatch.utils.cjs.map +1 -0
- package/cjs/components/color-swatch/index.cjs +14 -0
- package/cjs/components/color-swatch/index.cjs.map +1 -0
- package/cjs/index.cjs +72 -69
- package/cjs/index.cjs.map +1 -1
- package/esm/components/color-swatch/color-swatch.mjs +439 -0
- package/esm/components/color-swatch/color-swatch.mjs.map +1 -0
- package/esm/components/color-swatch/color-swatch.module.mjs +13 -0
- package/esm/components/color-swatch/color-swatch.module.mjs.map +1 -0
- package/esm/components/color-swatch/color-swatch.utils.mjs +13 -0
- package/esm/components/color-swatch/color-swatch.utils.mjs.map +1 -0
- package/esm/components/color-swatch/index.mjs +11 -0
- package/esm/components/color-swatch/index.mjs.map +1 -0
- package/esm/index.mjs +3 -1
- package/esm/index.mjs.map +1 -1
- package/lib/components/color-swatch/color-swatch.types.d.ts +29 -0
- package/lib/components/color-swatch/color-swatch.utils.d.ts +7 -0
- package/lib/components/color-swatch/index.d.ts +6 -0
- package/lib/components/index.d.ts +1 -0
- package/package.json +1 -1
- package/styles/color-swatch.css +71 -0
- package/styles/color-swatch.layer.css +72 -0
- package/styles.css +187 -115
- package/styles.layer.css +187 -115
package/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CActionIcon","CActionIconGroup","CActionIconGroupSection","CAffix","CAlert","CAnchor","CAspectRatio","CAvatar","CAvatarGroup","CBackgroundImage","CBadge","CBreadcrumbs","CBurger","CButton","CButtonGroup","CButtonGroupSection","CCard","CCardSection","CCenter","CCloseButton","CCol","CContainer","CCopyButton","CDivider","CEmptyState","CEmptyStateActions","CEmptyStateDescription","CEmptyStateIndicator","CEmptyStateTitle","CFileButton","CFlex","CFocusTrap","CGrid","CGroup","CImage","CLoader","CPaper","CPortal","CSemiCircleProgress","CSimpleGrid","CSkeleton","CSpace","CSplitter","CSplitterPane","CStack","CText","CTransition","CTypography","CVisuallyHidden","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CActionIcon","CActionIconGroup","CActionIconGroupSection","CAffix","CAlert","CAnchor","CAspectRatio","CAvatar","CAvatarGroup","CBackgroundImage","CBadge","CBreadcrumbs","CBurger","CButton","CButtonGroup","CButtonGroupSection","CCard","CCardSection","CCenter","CCloseButton","CCol","CColorSwatch","CContainer","CCopyButton","CDivider","CEmptyState","CEmptyStateActions","CEmptyStateDescription","CEmptyStateIndicator","CEmptyStateTitle","CFileButton","CFlex","CFocusTrap","CGrid","CGroup","CImage","CLoader","CPaper","CPortal","CSemiCircleProgress","CSimpleGrid","CSkeleton","CSpace","CSplitter","CSplitterPane","CStack","CText","CTransition","CTypography","CVisuallyHidden","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CColorSwatch,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CColorSwatch,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjBA,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;AACF;AAEA,MAAM,QAAgB,EACpB,QAAQ,KAAU;CAChB,IAAK,IAAY,gBACf;CAED,IAAa,iBAAiB;CAC/B,WAAW,SAAS,MAAM;EACxB,IAAI,EAAE,MACJ,IAAI,UAAU,EAAE,MAAM,CAAC;CAE3B,CAAC;AACH,EACF"}
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
|
|
3
|
+
import { useComponentProps } from "../../core/config-provider/use-component-props/use-component-props.mjs";
|
|
4
|
+
import { CBox } from "../../core/box/index.mjs";
|
|
5
|
+
import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
|
|
6
|
+
import color_swatch_module_default from "./color-swatch.module.mjs";
|
|
7
|
+
import { varsResolver } from "./color-swatch.utils.mjs";
|
|
8
|
+
import { computed, createBlock, createCommentVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, useAttrs, withCtx } from "vue";
|
|
9
|
+
//#region packages/@cck-ui/core/src/components/color-swatch/color-swatch.vue
|
|
10
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
11
|
+
name: "CColorSwatch",
|
|
12
|
+
__name: "color-swatch",
|
|
13
|
+
props: {
|
|
14
|
+
color: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
type: null,
|
|
20
|
+
required: false
|
|
21
|
+
},
|
|
22
|
+
radius: {
|
|
23
|
+
type: null,
|
|
24
|
+
required: false
|
|
25
|
+
},
|
|
26
|
+
withShadow: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
className: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
style: {
|
|
35
|
+
type: [
|
|
36
|
+
Object,
|
|
37
|
+
Function,
|
|
38
|
+
Array
|
|
39
|
+
],
|
|
40
|
+
required: false,
|
|
41
|
+
skipCheck: true
|
|
42
|
+
},
|
|
43
|
+
__vars: {
|
|
44
|
+
type: null,
|
|
45
|
+
required: false
|
|
46
|
+
},
|
|
47
|
+
__size: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: false
|
|
50
|
+
},
|
|
51
|
+
hiddenFrom: {
|
|
52
|
+
type: null,
|
|
53
|
+
required: false
|
|
54
|
+
},
|
|
55
|
+
visibleFrom: {
|
|
56
|
+
type: null,
|
|
57
|
+
required: false
|
|
58
|
+
},
|
|
59
|
+
lightHidden: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
required: false
|
|
62
|
+
},
|
|
63
|
+
darkHidden: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
required: false
|
|
66
|
+
},
|
|
67
|
+
mod: {
|
|
68
|
+
type: [
|
|
69
|
+
Object,
|
|
70
|
+
String,
|
|
71
|
+
Array
|
|
72
|
+
],
|
|
73
|
+
required: false
|
|
74
|
+
},
|
|
75
|
+
m: {
|
|
76
|
+
type: null,
|
|
77
|
+
required: false
|
|
78
|
+
},
|
|
79
|
+
my: {
|
|
80
|
+
type: null,
|
|
81
|
+
required: false
|
|
82
|
+
},
|
|
83
|
+
mx: {
|
|
84
|
+
type: null,
|
|
85
|
+
required: false
|
|
86
|
+
},
|
|
87
|
+
mt: {
|
|
88
|
+
type: null,
|
|
89
|
+
required: false
|
|
90
|
+
},
|
|
91
|
+
mb: {
|
|
92
|
+
type: null,
|
|
93
|
+
required: false
|
|
94
|
+
},
|
|
95
|
+
ms: {
|
|
96
|
+
type: null,
|
|
97
|
+
required: false
|
|
98
|
+
},
|
|
99
|
+
me: {
|
|
100
|
+
type: null,
|
|
101
|
+
required: false
|
|
102
|
+
},
|
|
103
|
+
mis: {
|
|
104
|
+
type: null,
|
|
105
|
+
required: false
|
|
106
|
+
},
|
|
107
|
+
mie: {
|
|
108
|
+
type: null,
|
|
109
|
+
required: false
|
|
110
|
+
},
|
|
111
|
+
ml: {
|
|
112
|
+
type: null,
|
|
113
|
+
required: false
|
|
114
|
+
},
|
|
115
|
+
mr: {
|
|
116
|
+
type: null,
|
|
117
|
+
required: false
|
|
118
|
+
},
|
|
119
|
+
p: {
|
|
120
|
+
type: null,
|
|
121
|
+
required: false
|
|
122
|
+
},
|
|
123
|
+
py: {
|
|
124
|
+
type: null,
|
|
125
|
+
required: false
|
|
126
|
+
},
|
|
127
|
+
px: {
|
|
128
|
+
type: null,
|
|
129
|
+
required: false
|
|
130
|
+
},
|
|
131
|
+
pt: {
|
|
132
|
+
type: null,
|
|
133
|
+
required: false
|
|
134
|
+
},
|
|
135
|
+
pb: {
|
|
136
|
+
type: null,
|
|
137
|
+
required: false
|
|
138
|
+
},
|
|
139
|
+
ps: {
|
|
140
|
+
type: null,
|
|
141
|
+
required: false
|
|
142
|
+
},
|
|
143
|
+
pe: {
|
|
144
|
+
type: null,
|
|
145
|
+
required: false
|
|
146
|
+
},
|
|
147
|
+
pis: {
|
|
148
|
+
type: null,
|
|
149
|
+
required: false
|
|
150
|
+
},
|
|
151
|
+
pie: {
|
|
152
|
+
type: null,
|
|
153
|
+
required: false
|
|
154
|
+
},
|
|
155
|
+
pl: {
|
|
156
|
+
type: null,
|
|
157
|
+
required: false
|
|
158
|
+
},
|
|
159
|
+
pr: {
|
|
160
|
+
type: null,
|
|
161
|
+
required: false
|
|
162
|
+
},
|
|
163
|
+
bd: {
|
|
164
|
+
type: null,
|
|
165
|
+
required: false
|
|
166
|
+
},
|
|
167
|
+
bdrs: {
|
|
168
|
+
type: null,
|
|
169
|
+
required: false
|
|
170
|
+
},
|
|
171
|
+
bg: {
|
|
172
|
+
type: null,
|
|
173
|
+
required: false
|
|
174
|
+
},
|
|
175
|
+
c: {
|
|
176
|
+
type: null,
|
|
177
|
+
required: false
|
|
178
|
+
},
|
|
179
|
+
opacity: {
|
|
180
|
+
type: [
|
|
181
|
+
String,
|
|
182
|
+
Object,
|
|
183
|
+
Number
|
|
184
|
+
],
|
|
185
|
+
required: false
|
|
186
|
+
},
|
|
187
|
+
ff: {
|
|
188
|
+
type: [String, Object],
|
|
189
|
+
required: false
|
|
190
|
+
},
|
|
191
|
+
fz: {
|
|
192
|
+
type: null,
|
|
193
|
+
required: false
|
|
194
|
+
},
|
|
195
|
+
fw: {
|
|
196
|
+
type: null,
|
|
197
|
+
required: false
|
|
198
|
+
},
|
|
199
|
+
lts: {
|
|
200
|
+
type: null,
|
|
201
|
+
required: false
|
|
202
|
+
},
|
|
203
|
+
ta: {
|
|
204
|
+
type: [String, Object],
|
|
205
|
+
required: false
|
|
206
|
+
},
|
|
207
|
+
lh: {
|
|
208
|
+
type: null,
|
|
209
|
+
required: false
|
|
210
|
+
},
|
|
211
|
+
fs: {
|
|
212
|
+
type: null,
|
|
213
|
+
required: false
|
|
214
|
+
},
|
|
215
|
+
tt: {
|
|
216
|
+
type: [String, Object],
|
|
217
|
+
required: false
|
|
218
|
+
},
|
|
219
|
+
td: {
|
|
220
|
+
type: null,
|
|
221
|
+
required: false
|
|
222
|
+
},
|
|
223
|
+
w: {
|
|
224
|
+
type: null,
|
|
225
|
+
required: false
|
|
226
|
+
},
|
|
227
|
+
miw: {
|
|
228
|
+
type: null,
|
|
229
|
+
required: false
|
|
230
|
+
},
|
|
231
|
+
maw: {
|
|
232
|
+
type: null,
|
|
233
|
+
required: false
|
|
234
|
+
},
|
|
235
|
+
h: {
|
|
236
|
+
type: null,
|
|
237
|
+
required: false
|
|
238
|
+
},
|
|
239
|
+
mih: {
|
|
240
|
+
type: null,
|
|
241
|
+
required: false
|
|
242
|
+
},
|
|
243
|
+
mah: {
|
|
244
|
+
type: null,
|
|
245
|
+
required: false
|
|
246
|
+
},
|
|
247
|
+
bgsz: {
|
|
248
|
+
type: null,
|
|
249
|
+
required: false
|
|
250
|
+
},
|
|
251
|
+
bgp: {
|
|
252
|
+
type: null,
|
|
253
|
+
required: false
|
|
254
|
+
},
|
|
255
|
+
bgr: {
|
|
256
|
+
type: null,
|
|
257
|
+
required: false
|
|
258
|
+
},
|
|
259
|
+
bga: {
|
|
260
|
+
type: null,
|
|
261
|
+
required: false
|
|
262
|
+
},
|
|
263
|
+
pos: {
|
|
264
|
+
type: [String, Object],
|
|
265
|
+
required: false
|
|
266
|
+
},
|
|
267
|
+
top: {
|
|
268
|
+
type: null,
|
|
269
|
+
required: false
|
|
270
|
+
},
|
|
271
|
+
left: {
|
|
272
|
+
type: null,
|
|
273
|
+
required: false
|
|
274
|
+
},
|
|
275
|
+
bottom: {
|
|
276
|
+
type: null,
|
|
277
|
+
required: false
|
|
278
|
+
},
|
|
279
|
+
right: {
|
|
280
|
+
type: null,
|
|
281
|
+
required: false
|
|
282
|
+
},
|
|
283
|
+
inset: {
|
|
284
|
+
type: null,
|
|
285
|
+
required: false
|
|
286
|
+
},
|
|
287
|
+
display: {
|
|
288
|
+
type: null,
|
|
289
|
+
required: false
|
|
290
|
+
},
|
|
291
|
+
flex: {
|
|
292
|
+
type: null,
|
|
293
|
+
required: false
|
|
294
|
+
},
|
|
295
|
+
unstyled: {
|
|
296
|
+
type: Boolean,
|
|
297
|
+
required: false
|
|
298
|
+
},
|
|
299
|
+
variant: {
|
|
300
|
+
type: null,
|
|
301
|
+
required: false
|
|
302
|
+
},
|
|
303
|
+
classNames: {
|
|
304
|
+
type: null,
|
|
305
|
+
required: false
|
|
306
|
+
},
|
|
307
|
+
styles: {
|
|
308
|
+
type: null,
|
|
309
|
+
required: false
|
|
310
|
+
},
|
|
311
|
+
vars: {
|
|
312
|
+
type: Function,
|
|
313
|
+
required: false
|
|
314
|
+
},
|
|
315
|
+
attributes: {
|
|
316
|
+
type: null,
|
|
317
|
+
required: false
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
setup(__props, { expose: __expose }) {
|
|
321
|
+
const _root = ref(null);
|
|
322
|
+
const _alpha = ref(null);
|
|
323
|
+
const _shadow = ref(null);
|
|
324
|
+
const _color = ref(null);
|
|
325
|
+
const _children = ref(null);
|
|
326
|
+
const attrs = useAttrs();
|
|
327
|
+
const rawProps = __props;
|
|
328
|
+
const defaultProps = { withShadow: true };
|
|
329
|
+
const props = useComponentProps({
|
|
330
|
+
component: "CColorSwatch",
|
|
331
|
+
defaultProps,
|
|
332
|
+
props: rawProps
|
|
333
|
+
});
|
|
334
|
+
const knownProps = [
|
|
335
|
+
"classNames",
|
|
336
|
+
"className",
|
|
337
|
+
"style",
|
|
338
|
+
"styles",
|
|
339
|
+
"unstyled",
|
|
340
|
+
"vars",
|
|
341
|
+
"color",
|
|
342
|
+
"radius",
|
|
343
|
+
"withShadow",
|
|
344
|
+
"attributes"
|
|
345
|
+
];
|
|
346
|
+
const styleProps = computed(() => ({
|
|
347
|
+
...props.value,
|
|
348
|
+
...attrs,
|
|
349
|
+
style: attrs.style ?? props.value.style
|
|
350
|
+
}));
|
|
351
|
+
const getStyles = useStyles({
|
|
352
|
+
name: "ColorSwatch",
|
|
353
|
+
props: styleProps,
|
|
354
|
+
classes: color_swatch_module_default,
|
|
355
|
+
className: () => props.value.className,
|
|
356
|
+
style: () => props.value.style,
|
|
357
|
+
classNames: props.value.classNames,
|
|
358
|
+
styles: props.value.styles,
|
|
359
|
+
unstyled: props.value.unstyled,
|
|
360
|
+
attributes: props.value.attributes,
|
|
361
|
+
vars: props.value.vars,
|
|
362
|
+
varsResolver
|
|
363
|
+
});
|
|
364
|
+
const rootAttrs = computed(() => getStyles("root", { focusable: true }));
|
|
365
|
+
const alphaAttrs = computed(() => getStyles("alphaOverlay"));
|
|
366
|
+
const shadowAttrs = computed(() => getStyles("shadowOverlay"));
|
|
367
|
+
const colorAttrs = computed(() => getStyles("colorOverlay", { style: { backgroundColor: props.value.color } }));
|
|
368
|
+
const childrenAttrs = computed(() => getStyles("childrenOverlay"));
|
|
369
|
+
const mergedRootAttrs = computed(() => {
|
|
370
|
+
const others = {};
|
|
371
|
+
const propsValue = props.value;
|
|
372
|
+
for (const key in propsValue) if (!knownProps.includes(key)) others[key] = propsValue[key];
|
|
373
|
+
const userMod = props.value.mod;
|
|
374
|
+
const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod]];
|
|
375
|
+
return {
|
|
376
|
+
...others,
|
|
377
|
+
mod: mergedMod,
|
|
378
|
+
...rootAttrs.value
|
|
379
|
+
};
|
|
380
|
+
});
|
|
381
|
+
__expose({
|
|
382
|
+
root: computed(() => _root.value?.root ?? null),
|
|
383
|
+
alphaOverlay: computed(() => _alpha.value?.root ?? null),
|
|
384
|
+
shadowOverlay: computed(() => _shadow.value?.root ?? null),
|
|
385
|
+
colorOverlay: computed(() => _color.value?.root ?? null),
|
|
386
|
+
childrenOverlay: computed(() => _children.value?.root ?? null)
|
|
387
|
+
});
|
|
388
|
+
const __returned__ = {
|
|
389
|
+
_root,
|
|
390
|
+
_alpha,
|
|
391
|
+
_shadow,
|
|
392
|
+
_color,
|
|
393
|
+
_children,
|
|
394
|
+
attrs,
|
|
395
|
+
rawProps,
|
|
396
|
+
defaultProps,
|
|
397
|
+
props,
|
|
398
|
+
knownProps,
|
|
399
|
+
styleProps,
|
|
400
|
+
getStyles,
|
|
401
|
+
rootAttrs,
|
|
402
|
+
alphaAttrs,
|
|
403
|
+
shadowAttrs,
|
|
404
|
+
colorAttrs,
|
|
405
|
+
childrenAttrs,
|
|
406
|
+
mergedRootAttrs,
|
|
407
|
+
get CBox() {
|
|
408
|
+
return CBox;
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
412
|
+
enumerable: false,
|
|
413
|
+
value: true
|
|
414
|
+
});
|
|
415
|
+
return __returned__;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
419
|
+
return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_root" }, $setup.mergedRootAttrs), {
|
|
420
|
+
default: withCtx(() => [
|
|
421
|
+
createVNode($setup["CBox"], mergeProps({ tag: "span" }, $setup.alphaAttrs), null, 16),
|
|
422
|
+
$setup.props.withShadow ? (openBlock(), createBlock($setup["CBox"], mergeProps({
|
|
423
|
+
key: 0,
|
|
424
|
+
tag: "span"
|
|
425
|
+
}, $setup.shadowAttrs), null, 16)) : createCommentVNode("v-if", true),
|
|
426
|
+
createVNode($setup["CBox"], mergeProps({ tag: "span" }, $setup.colorAttrs), null, 16),
|
|
427
|
+
createVNode($setup["CBox"], mergeProps({ tag: "span" }, $setup.childrenAttrs), {
|
|
428
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
429
|
+
_: 3
|
|
430
|
+
}, 16)
|
|
431
|
+
]),
|
|
432
|
+
_: 3
|
|
433
|
+
}, 16);
|
|
434
|
+
}
|
|
435
|
+
var color_swatch_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/color-swatch/color-swatch.vue"]]);
|
|
436
|
+
//#endregion
|
|
437
|
+
export { color_swatch_default as default };
|
|
438
|
+
|
|
439
|
+
//# sourceMappingURL=color-swatch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-swatch.mjs","names":[],"sources":["../../../src/components/color-swatch/color-swatch.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <c-box tag=\"span\" v-bind=\"alphaAttrs\"></c-box>\n <c-box tag=\"span\" v-bind=\"shadowAttrs\" v-if=\"props.withShadow\"></c-box>\n <c-box tag=\"span\" v-bind=\"colorAttrs\"></c-box>\n <c-box tag=\"span\" v-bind=\"childrenAttrs\">\n <slot />\n </c-box>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport { ColorSwatchFactory, ColorSwatchProps } from './color-swatch.types'\nimport classes from './color-swatch.module.css'\nimport { varsResolver } from './color-swatch.utils'\n\ndefineOptions({\n name: 'CColorSwatch',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\nconst _alpha = ref<InstanceType<typeof CBox> | null>(null)\nconst _shadow = ref<InstanceType<typeof CBox> | null>(null)\nconst _color = ref<InstanceType<typeof CBox> | null>(null)\nconst _children = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ColorSwatchProps>()\n\nconst defaultProps = {\n withShadow: true,\n} satisfies Partial<ColorSwatchProps>\n\nconst props = useComponentProps({\n component: 'CColorSwatch',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'color',\n 'radius',\n 'withShadow',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ColorSwatchFactory>({\n name: 'ColorSwatch',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\nconst alphaAttrs = computed(() => getStyles('alphaOverlay'))\nconst shadowAttrs = computed(() => getStyles('shadowOverlay'))\nconst colorAttrs = computed(() =>\n getStyles('colorOverlay', { style: { backgroundColor: props.value.color } })\n)\nconst childrenAttrs = computed(() => getStyles('childrenOverlay'))\n\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod])]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n alphaOverlay: computed(() => _alpha.value?.root ?? null),\n shadowOverlay: computed(() => _shadow.value?.root ?? null),\n colorOverlay: computed(() => _color.value?.root ?? null),\n childrenOverlay: computed(() => _children.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBA,MAAM,QAAQ,IAAsC,IAAI;EACxD,MAAM,SAAS,IAAsC,IAAI;EACzD,MAAM,UAAU,IAAsC,IAAI;EAC1D,MAAM,SAAS,IAAsC,IAAI;EACzD,MAAM,YAAY,IAAsC,IAAI;EAE5D,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe,EACnB,YAAY,KACd;EAEA,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAA8B;GAC9C,MAAM;GACN,OAAO;GACP,SAAA;GACA,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB;EACF,CAAC;EAED,MAAM,YAAY,eAAe,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC,CAAC;EACvE,MAAM,aAAa,eAAe,UAAU,cAAc,CAAC;EAC3D,MAAM,cAAc,eAAe,UAAU,eAAe,CAAC;EAC7D,MAAM,aAAa,eACjB,UAAU,gBAAgB,EAAE,OAAO,EAAE,iBAAiB,MAAM,MAAM,MAAM,EAAE,CAAC,CAC7E;EACA,MAAM,gBAAgB,eAAe,UAAU,iBAAiB,CAAC;EAEjE,MAAM,kBAAkB,eAAe;GACrC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,KAAK,MAAM,OAAO,YAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAG7B,MAAM,UAAU,MAAM,MAAM;GAC5B,MAAM,YAAY,CAAC,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAE;GACpE,OAAO;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,UAAU;GAAM;EACzD,CAAC;EAED,SAAa;GACX,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI;GAC9C,cAAc,eAAe,OAAO,OAAO,QAAQ,IAAI;GACvD,eAAe,eAAe,QAAQ,OAAO,QAAQ,IAAI;GACzD,cAAc,eAAe,OAAO,OAAO,QAAQ,IAAI;GACvD,iBAAiB,eAAe,UAAU,OAAO,QAAQ,IAAI;EAC/D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBArGC,YAOQ,OAAA,SAPR,WAOQ,EAPD,KAAI,QAAO,GAAS,OAAA,eAAe,GAAA;yBACM;GAA9C,YAA8C,OAAA,SAA9C,WAA8C,EAAvC,KAAI,OAAM,GAAS,OAAA,UAAU,GAAA,MAAA,EAAA;GACS,OAAA,MAAM,cAAA,UAAA,GAAnD,YAAuE,OAAA,SAAvE,WAAuE;;IAAhE,KAAI;MAAe,OAAA,WAAW,GAAA,MAAA,EAAA,KAAA,mBAAA,QAAA,IAAA;GACrC,YAA8C,OAAA,SAA9C,WAA8C,EAAvC,KAAI,OAAM,GAAS,OAAA,UAAU,GAAA,MAAA,EAAA;GACpC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,OAAM,GAAS,OAAA,aAAa,GAAA;2BAC7B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/@cck-ui/core/src/components/color-swatch/color-swatch.module.css
|
|
3
|
+
var color_swatch_module_default = {
|
|
4
|
+
"root": "m_c2451869",
|
|
5
|
+
"colorOverlay": "m_169647f4",
|
|
6
|
+
"shadowOverlay": "m_1528cf69",
|
|
7
|
+
"alphaOverlay": "m_25d7a599",
|
|
8
|
+
"childrenOverlay": "m_5065cf6a"
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { color_swatch_module_default as default };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=color-swatch.module.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-swatch.module.mjs","names":[],"sources":["../../../src/components/color-swatch/color-swatch.module.css"],"sourcesContent":[".root {\n --cs-size: 28px;\n --cs-radius: 1000px;\n\n -webkit-tap-highlight-color: transparent;\n border: none;\n appearance: none;\n display: block;\n line-height: 1;\n position: relative;\n width: var(--cs-size);\n height: var(--cs-size);\n min-width: var(--cs-size);\n min-height: var(--cs-size);\n border-radius: var(--cs-radius);\n color: inherit;\n text-decoration: none;\n\n @mixin light {\n --alpha-overlay-color: var(--c-color-gray-3);\n --alpha-overlay-bg: var(--c-color-white);\n }\n\n @mixin dark {\n --alpha-overlay-color: var(--c-color-dark-4);\n --alpha-overlay-bg: var(--c-color-dark-7);\n }\n}\n\n.colorOverlay {\n position: absolute;\n inset: 0;\n border-radius: var(--cs-radius);\n}\n\n.shadowOverlay {\n position: absolute;\n inset: 0;\n border-radius: var(--cs-radius);\n z-index: 1;\n box-shadow:\n rgba(0, 0, 0, 0.1) 0 0 0 rem(1px) inset,\n rgb(0, 0, 0, 0.15) 0 0 rem(4px) inset;\n}\n\n.alphaOverlay {\n position: absolute;\n inset: 0;\n border-radius: var(--cs-radius);\n background-size: 8px 8px;\n background-position:\n 0 0,\n 0 4px,\n 4px -4px,\n -4px 0;\n background-image:\n linear-gradient(45deg, var(--alpha-overlay-color) 25%, transparent 25%),\n linear-gradient(-45deg, var(--alpha-overlay-color) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--alpha-overlay-color) 75%),\n linear-gradient(-45deg, var(--alpha-overlay-bg) 75%, var(--alpha-overlay-color) 75%);\n}\n\n.childrenOverlay {\n position: absolute;\n inset: 0;\n border-radius: var(--cs-radius);\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n"],"mappings":";;AAAA,IAAA,8BAAe;CAAC,QAAO;CAAa,gBAAe;CAAa,iBAAgB;CAAa,gBAAe;CAAa,mBAAkB;AAAY"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { rem } from "../../core/utils/units-converters/rem.mjs";
|
|
3
|
+
import { getRadius } from "../../core/utils/get-size/get-size.mjs";
|
|
4
|
+
import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
|
|
5
|
+
//#region packages/@cck-ui/core/src/components/color-swatch/color-swatch.utils.ts
|
|
6
|
+
const varsResolver = createVarsResolver((_, { radius, size }) => ({ root: {
|
|
7
|
+
"--cs-radius": radius === void 0 ? void 0 : getRadius(radius),
|
|
8
|
+
"--cs-size": rem(size)
|
|
9
|
+
} }));
|
|
10
|
+
//#endregion
|
|
11
|
+
export { varsResolver };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=color-swatch.utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-swatch.utils.mjs","names":[],"sources":["../../../src/components/color-swatch/color-swatch.utils.ts"],"sourcesContent":["import { createVarsResolver, getRadius, rem } from '../../core'\nimport { ColorSwatchFactory } from './color-swatch.types'\n\nexport const varsResolver = createVarsResolver<ColorSwatchFactory>((_, { radius, size }) => ({\n root: {\n '--cs-radius': radius === undefined ? undefined : getRadius(radius),\n '--cs-size': rem(size),\n },\n}))\n"],"mappings":";;;;;AAGA,MAAa,eAAe,oBAAwC,GAAG,EAAE,QAAQ,YAAY,EAC3F,MAAM;CACJ,eAAe,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CAClE,aAAa,IAAI,IAAI;AACvB,EACF,EAAE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { withInstall } from "../../core/utils/vue/install.mjs";
|
|
3
|
+
import { withClasses, withExtend, withPropsFactory, withVarsResolver } from "../../core/utils/vue/statics.mjs";
|
|
4
|
+
import color_swatch_module_default from "./color-swatch.module.mjs";
|
|
5
|
+
import { varsResolver } from "./color-swatch.utils.mjs";
|
|
6
|
+
import color_swatch_default from "./color-swatch.mjs";
|
|
7
|
+
const CColorSwatch = withInstall(withPropsFactory(withExtend(withVarsResolver(withClasses(color_swatch_default, color_swatch_module_default), varsResolver))));
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CColorSwatch, CColorSwatch as default };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ColorSwatch","classes"],"sources":["../../../src/components/color-swatch/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport classes from './color-swatch.module.css'\nimport { varsResolver } from './color-swatch.utils'\nimport ColorSwatch from './color-swatch.vue'\n\nconst ColorSwatchWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(ColorSwatch, classes), varsResolver))\n)\n\nexport const CColorSwatch: SFCWithInstallAndClasses<typeof ColorSwatch, typeof classes> =\n withInstall(ColorSwatchWithStatic)\n\nexport default CColorSwatch\n\nexport * from './color-swatch.types'\n"],"mappings":";;;;;;AAgBA,MAAa,eACX,YAL4B,iBAC5B,WAAW,iBAAiB,YAAYA,sBAAaC,2BAAO,GAAG,YAAY,CAAC,CAIhE,CAAqB"}
|
package/esm/index.mjs
CHANGED
|
@@ -73,6 +73,7 @@ import { CBurger } from "./components/burger/index.mjs";
|
|
|
73
73
|
import { CButton, CButtonGroup, CButtonGroupSection } from "./components/button/index.mjs";
|
|
74
74
|
import { CCard, CCardSection } from "./components/card/index.mjs";
|
|
75
75
|
import { CCenter } from "./components/center/index.mjs";
|
|
76
|
+
import { CColorSwatch } from "./components/color-swatch/index.mjs";
|
|
76
77
|
import { CContainer } from "./components/container/index.mjs";
|
|
77
78
|
import { CCopyButton } from "./components/copy-button/index.mjs";
|
|
78
79
|
import { CDivider } from "./components/divider/index.mjs";
|
|
@@ -118,6 +119,7 @@ const components = [
|
|
|
118
119
|
CCenter,
|
|
119
120
|
CCloseButton,
|
|
120
121
|
CCol,
|
|
122
|
+
CColorSwatch,
|
|
121
123
|
CContainer,
|
|
122
124
|
CCopyButton,
|
|
123
125
|
CDivider,
|
|
@@ -156,6 +158,6 @@ const CckUI = { install(app) {
|
|
|
156
158
|
});
|
|
157
159
|
} };
|
|
158
160
|
//#endregion
|
|
159
|
-
export { CActionIcon, CActionIconGroup, CActionIconGroupSection, CAffix, CAlert, CAnchor, CAspectRatio, CAvatar, CAvatarGroup, CBackgroundImage, CBadge, CBox, CBreadcrumbs, CBurger, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCard, CCardSection, CCenter, CCloseButton, CCol, CContainer, CCopyButton, CDefaultLoaders, CDivider, CEmptyState, CEmptyStateActions, CEmptyStateDescription, CEmptyStateIndicator, CEmptyStateTitle, CFileButton, CFlex, CFocusTrap, CGrid, CGroup, CImage, CLoader, CONFIG_KEY, CPaper, CPortal, CSemiCircleProgress, CSimpleGrid, CSkeleton, CSpace, CSplitter, CSplitterPane, CStack, CText, CTransition, CTypography, CVisuallyHidden, CckConfigProvider, CckUI, CckUI as default, DEFAULT_THEME, FOCUS_CLASS_NAMES, STYLE_PROPS_DATA, THEME_KEY, UnstyledButton, alpha, camelToKebabCase, colorsTuple, createTheme, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultVariantColorsResolver, em, extractStyleProps, filterFalsyChildren, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getDefaultZIndex, getFontSize, getGradient, getLineHeight, getPrimaryShade, getRadius, getShadow, getSize, getSortedBreakpoints, getSpacing, getThemeColor, getTransitionProps, hashStyleProps, isLightColor, isNumber, isNumberLike, isString, isStringNumber, isUndefined, isVirtualColor, keys, luminance, mergeThemeOverrides, normalizeNumberLikeStringProp, numberLikeStringToNumber, parseStyleProps, parseThemeColor, px, rem, resolveClassNames, resolveStyles, responsiveStyleManager, rgb, rgba, stylesToString, toRgba, useCckClassNamesPrefix, useCckColorScheme, useCckCssVariablesResolver, useCckEnv, useCckIsHeadless, useCckStyleNonce, useCckStylesTransform, useCckSxTransform, useCckTheme, useCckWithStaticClasses, useComponentProps, useConfigContext, useProviderColorScheme, useRandomClassName, useStyles, virtualColor, withClasses, withExtend, withInstall, withPropsDefaultSetter, withPropsFactory, withVarsResolver };
|
|
161
|
+
export { CActionIcon, CActionIconGroup, CActionIconGroupSection, CAffix, CAlert, CAnchor, CAspectRatio, CAvatar, CAvatarGroup, CBackgroundImage, CBadge, CBox, CBreadcrumbs, CBurger, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCard, CCardSection, CCenter, CCloseButton, CCol, CColorSwatch, CContainer, CCopyButton, CDefaultLoaders, CDivider, CEmptyState, CEmptyStateActions, CEmptyStateDescription, CEmptyStateIndicator, CEmptyStateTitle, CFileButton, CFlex, CFocusTrap, CGrid, CGroup, CImage, CLoader, CONFIG_KEY, CPaper, CPortal, CSemiCircleProgress, CSimpleGrid, CSkeleton, CSpace, CSplitter, CSplitterPane, CStack, CText, CTransition, CTypography, CVisuallyHidden, CckConfigProvider, CckUI, CckUI as default, DEFAULT_THEME, FOCUS_CLASS_NAMES, STYLE_PROPS_DATA, THEME_KEY, UnstyledButton, alpha, camelToKebabCase, colorsTuple, createTheme, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultVariantColorsResolver, em, extractStyleProps, filterFalsyChildren, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getDefaultZIndex, getFontSize, getGradient, getLineHeight, getPrimaryShade, getRadius, getShadow, getSize, getSortedBreakpoints, getSpacing, getThemeColor, getTransitionProps, hashStyleProps, isLightColor, isNumber, isNumberLike, isString, isStringNumber, isUndefined, isVirtualColor, keys, luminance, mergeThemeOverrides, normalizeNumberLikeStringProp, numberLikeStringToNumber, parseStyleProps, parseThemeColor, px, rem, resolveClassNames, resolveStyles, responsiveStyleManager, rgb, rgba, stylesToString, toRgba, useCckClassNamesPrefix, useCckColorScheme, useCckCssVariablesResolver, useCckEnv, useCckIsHeadless, useCckStyleNonce, useCckStylesTransform, useCckSxTransform, useCckTheme, useCckWithStaticClasses, useComponentProps, useConfigContext, useProviderColorScheme, useRandomClassName, useStyles, virtualColor, withClasses, withExtend, withInstall, withPropsDefaultSetter, withPropsFactory, withVarsResolver };
|
|
160
162
|
|
|
161
163
|
//# sourceMappingURL=index.mjs.map
|
package/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CColorSwatch,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CColorSwatch,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,QAAgB,EACpB,QAAQ,KAAU;CAChB,IAAK,IAAY,gBACf;CAED,IAAa,iBAAiB;CAC/B,WAAW,SAAS,MAAM;EACxB,IAAI,EAAE,MACJ,IAAI,UAAU,EAAE,MAAM,CAAC;CAE3B,CAAC;AACH,EACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Properties } from 'csstype';
|
|
2
|
+
import { BoxProps, CRadius, PolymorphicFactory, StylesApiProps } from '../../core';
|
|
3
|
+
export type ColorSwatchStylesNames = 'root' | 'alphaOverlay' | 'shadowOverlay' | 'colorOverlay' | 'childrenOverlay';
|
|
4
|
+
export type ColorSwatchCssVariables = {
|
|
5
|
+
root: '--cs-radius' | '--cs-size';
|
|
6
|
+
};
|
|
7
|
+
export interface ColorSwatchProps extends BoxProps, StylesApiProps<ColorSwatchFactory> {
|
|
8
|
+
/** Valid CSS color to display */
|
|
9
|
+
color: string;
|
|
10
|
+
/** Swatch `width` and `height`, any valid CSS value */
|
|
11
|
+
size?: Properties['width'];
|
|
12
|
+
/**
|
|
13
|
+
* Key of `theme.radius` or any valid CSS value to set `border-radius`, numbers are converted to rem.
|
|
14
|
+
* @default 1000
|
|
15
|
+
*/
|
|
16
|
+
radius?: CRadius;
|
|
17
|
+
/**
|
|
18
|
+
* If set, the swatch has inner `box-shadow`
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
withShadow?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type ColorSwatchFactory = PolymorphicFactory<{
|
|
24
|
+
props: ColorSwatchProps;
|
|
25
|
+
defaultRef: HTMLDivElement;
|
|
26
|
+
defaultComponent: 'div';
|
|
27
|
+
stylesNames: ColorSwatchStylesNames;
|
|
28
|
+
vars: ColorSwatchCssVariables;
|
|
29
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const varsResolver: import("../..").VarsResolver<{
|
|
2
|
+
props: import("./color-swatch.types").ColorSwatchProps;
|
|
3
|
+
defaultRef: HTMLDivElement;
|
|
4
|
+
defaultComponent: "div";
|
|
5
|
+
stylesNames: import("./color-swatch.types").ColorSwatchStylesNames;
|
|
6
|
+
vars: import("./color-swatch.types").ColorSwatchCssVariables;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SFCWithInstallAndClasses } from '../../core';
|
|
2
|
+
import classes from './color-swatch.module.css';
|
|
3
|
+
import ColorSwatch from './color-swatch.vue';
|
|
4
|
+
export declare const CColorSwatch: SFCWithInstallAndClasses<typeof ColorSwatch, typeof classes>;
|
|
5
|
+
export default CColorSwatch;
|
|
6
|
+
export * from './color-swatch.types';
|
package/package.json
CHANGED