@warp-ds/css 1.0.0-alpha.9 → 1.0.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/README.md +4 -6
- package/component-classes/classes.js +5 -5
- package/component-classes/index.d.ts +4 -3
- package/component-classes/index.js +70 -69
- package/component-classes/shortcuts.js +14 -14
- package/package.json +32 -10
package/README.md
CHANGED
|
@@ -9,13 +9,11 @@ The package includes resets, component classes and tokens.
|
|
|
9
9
|
The CSS files should be used directly from Eik. This is because we can alias releases by major versions.
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
We publish
|
|
12
|
+
We publish 3 css files.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
<link href="https://assets.finn.no/pkg/@warp-ds/css/
|
|
16
|
-
|
|
17
|
-
<link href="https://assets.finn.no/pkg/@warp-ds/css/v1/resets.css" rel="stylesheet" />
|
|
18
|
-
```
|
|
14
|
+
- Resets <link href="https://assets.finn.no/pkg/@warp-ds/css/[VERSION]/resets.css" rel="stylesheet" />
|
|
15
|
+
- Components css <link href="https://assets.finn.no/pkg/@warp-ds/css/[VERSION]/components.css" rel="stylesheet" />
|
|
16
|
+
- Brand css with tokens <link href="https://assets.finn.no/pkg/@warp-ds/css/[VERSION]/tokens/[BRANDNAME e.g. tori-fi].css" rel="stylesheet" />
|
|
19
17
|
|
|
20
18
|
## Usage (npm)
|
|
21
19
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as components from './index.js';
|
|
2
2
|
|
|
3
3
|
export const classes = Object.values(components)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
.map((e) => {
|
|
5
|
+
if (typeof e === 'object') return Object.values(e).map((e) => e.split(/\s/));
|
|
6
|
+
return e.split(/\s/);
|
|
7
|
+
})
|
|
8
|
+
.flat(Infinity);
|
|
@@ -19,7 +19,6 @@ export namespace pageIndicator {
|
|
|
19
19
|
const dot: string;
|
|
20
20
|
const inactive: string;
|
|
21
21
|
const active: string;
|
|
22
|
-
const hover: string;
|
|
23
22
|
}
|
|
24
23
|
export namespace ribbon {
|
|
25
24
|
const base_1: string;
|
|
@@ -349,6 +348,7 @@ export namespace breadcrumbs {
|
|
|
349
348
|
export { a11y_4 as a11y };
|
|
350
349
|
}
|
|
351
350
|
export namespace toggle {
|
|
351
|
+
export const field: string;
|
|
352
352
|
const wrapper_10: string;
|
|
353
353
|
export { wrapper_10 as wrapper };
|
|
354
354
|
export const deadToggleWrapper: string;
|
|
@@ -386,10 +386,11 @@ export namespace toggle {
|
|
|
386
386
|
export { a11y_5 as a11y };
|
|
387
387
|
}
|
|
388
388
|
export namespace clickable {
|
|
389
|
-
export const
|
|
390
|
-
export const clickableNotToggle: string;
|
|
389
|
+
export const toggle: string;
|
|
391
390
|
const label_6: string;
|
|
392
391
|
export { label_6 as label };
|
|
392
|
+
export const buttonOrLink: string;
|
|
393
|
+
export const buttonOrLinkStretch: string;
|
|
393
394
|
}
|
|
394
395
|
export namespace combobox {
|
|
395
396
|
const wrapper_11: string;
|
|
@@ -21,9 +21,8 @@ export const attention = {
|
|
|
21
21
|
export const pageIndicator = {
|
|
22
22
|
wrapper: 'flex space-x-8 p-8',
|
|
23
23
|
dot: 'h-8 w-8 rounded-full',
|
|
24
|
-
inactive: 'i-bg-$color-pageindicator-background',
|
|
25
|
-
active: 'i-bg-$color-pageindicator-background-
|
|
26
|
-
hover: 'i-bg-$color-pageindicator-background-hover',
|
|
24
|
+
inactive: 'i-bg-$color-pageindicator-background hover:i-bg-$color-pageindicator-background-hover',
|
|
25
|
+
active: 'i-bg-$color-pageindicator-background-selected',
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
export const ribbon = {
|
|
@@ -65,7 +64,7 @@ export const box = {
|
|
|
65
64
|
bordered: 'border-2 i-border-$color-box-bordered-border i-bg-$color-box-bordered-background i-text-$color-box-bordered-text',
|
|
66
65
|
infoClickable: 'hover:i-bg-$color-box-info-background-hover active:i-bg-$color-box-info-background-hover',
|
|
67
66
|
neutralClickable: 'hover:i-bg-$color-box-neutral-background-hover active:i-bg-$color-box-neutral-background-hover',
|
|
68
|
-
borderedClickable: 'hover:i-bg-$color-box-bordered-background-hover active:i-bg-$color-box-bordered-background-hover hover:i-border-$color-box-bordered-border-hover active:i-border-$color-box-bordered-border-hover'
|
|
67
|
+
borderedClickable: 'hover:i-bg-$color-box-bordered-background-hover active:i-bg-$color-box-bordered-background-hover hover:i-border-$color-box-bordered-border-hover active:i-border-$color-box-bordered-border-hover',
|
|
69
68
|
};
|
|
70
69
|
|
|
71
70
|
export const pill = {
|
|
@@ -111,7 +110,7 @@ export const step = {
|
|
|
111
110
|
export const steps = {
|
|
112
111
|
steps: 'w-full',
|
|
113
112
|
stepsHorizontal: 'flex',
|
|
114
|
-
}
|
|
113
|
+
};
|
|
115
114
|
|
|
116
115
|
export const card = {
|
|
117
116
|
card: 'cursor-pointer overflow-hidden relative transition-all',
|
|
@@ -120,13 +119,13 @@ export const card = {
|
|
|
120
119
|
cardFlatUnselected:
|
|
121
120
|
'i-bg-$color-card-flat-background i-border-$color-card-flat-border hover:i-bg-$color-card-flat-background-hover hover:i-border-$color-card-flat-border-hover active:i-bg-$color-card-flat-background-active active:i-border-$color-card-flat-border-active',
|
|
122
121
|
cardFlatSelected:
|
|
123
|
-
'i-border-$color-card-flat-border-
|
|
122
|
+
'i-border-$color-card-flat-border-selected i-bg-$color-card-flat-background-selected hover:i-bg-$color-card-flat-background-selected-hover hover:i-border-$color-card-flat-border-selected-hover active:i-border-$color-card-flat-border-active active:i-bg-$color-card-flat-background-active',
|
|
124
123
|
cardSelected:
|
|
125
|
-
'i-border-$color-card-border-
|
|
124
|
+
'i-border-$color-card-border-selected i-bg-$color-card-background-selected hover:i-border-$color-card-border-selected-hover hover:i-bg-$color-card-background-selected-hover active:i-border-$color-card-border-selected-active',
|
|
126
125
|
cardOutline:
|
|
127
126
|
'active:i-border-$color-card-flat-border absolute rounded-8 inset-0 transition-all border-2',
|
|
128
127
|
cardOutlineUnselected: 'i-border-$color-card-border',
|
|
129
|
-
cardOutlineSelected: 'i-border-$color-card-border-
|
|
128
|
+
cardOutlineSelected: 'i-border-$color-card-border-selected hover:i-border-$color-card-border-selected-hover',
|
|
130
129
|
a11y: 'sr-only',
|
|
131
130
|
};
|
|
132
131
|
|
|
@@ -135,12 +134,12 @@ export const switchToggle = {
|
|
|
135
134
|
label: 'block relative h-24 w-44 cursor-pointer group',
|
|
136
135
|
labelDisabled: 'pointer-events-none',
|
|
137
136
|
track: 'absolute top-0 left-0 h-full w-full rounded-full transition-colors',
|
|
138
|
-
trackActive: 'i-bg-$color-switch-track-background-
|
|
137
|
+
trackActive: 'i-bg-$color-switch-track-background-selected group-hover:i-bg-$color-switch-track-background-selected-hover',
|
|
139
138
|
trackInactive: 'i-bg-$color-switch-track-background group-hover:i-bg-$color-switch-track-background-hover',
|
|
140
139
|
trackDisabled: 'i-bg-$color-switch-track-background-disabled',
|
|
141
140
|
handle: 'absolute transform-gpu h-16 w-16 top-4 left-4 rounded-full transition-transform',
|
|
142
141
|
handleSelected: 'translate-x-20',
|
|
143
|
-
handleNotDisabled: 'i-bg-$color-switch-handle-background shadow-
|
|
142
|
+
handleNotDisabled: 'i-bg-$color-switch-handle-background i-shadow-$shadow-switch-handle',
|
|
144
143
|
handleDisabled: 'i-bg-$color-switch-handle-background-disabled',
|
|
145
144
|
a11y: 'sr-only',
|
|
146
145
|
};
|
|
@@ -166,25 +165,25 @@ export const toast = {
|
|
|
166
165
|
iconNegative: 'i-text-$color-toast-negative-icon',
|
|
167
166
|
iconLoading: 'animate-bounce',
|
|
168
167
|
content: 'self-center mr-8 py-4 last-child:mb-0',
|
|
169
|
-
close: 'bg-transparent ml-auto p-[8px]',
|
|
168
|
+
close: 'bg-transparent ml-auto p-[8px] i-text-$color-toast-close-icon hover:i-text-$color-toast-close-icon-hover active:i-text-$color-toast-close-icon-active',
|
|
170
169
|
};
|
|
171
170
|
|
|
172
171
|
export const tabs = {
|
|
173
172
|
tabContainer: 'mx-auto max-w-screen-md w-full grid relative',
|
|
174
173
|
wunderbar:
|
|
175
|
-
'absolute i-border-$color-tabs-border-
|
|
174
|
+
'absolute i-border-$color-tabs-border-selected -bottom-0 border-b-4 transition-all',
|
|
176
175
|
wrapperUnderlined:
|
|
177
176
|
'border-b i-border-$color-tabs-border -mx-16 sm:mx-0 px-4 sm:px-0 mb-32 ',
|
|
178
177
|
};
|
|
179
178
|
|
|
180
179
|
export const tab = {
|
|
181
|
-
tab: 'grid items-center font-bold gap-8 focusable antialias p-16 pb-8 border-b-4 i-text-$color-tabs-text i-border-$color-tabs-border hover:i-text-$color-tabs-text-hover hover:i-border-$color-tabs-border-hover',
|
|
182
|
-
tabActive: 'i-text-$color-tabs-text-
|
|
180
|
+
tab: 'grid items-center font-bold gap-8 focusable antialias p-16 pb-8 border-b-4 bg-transparent i-text-$color-tabs-text i-border-$color-tabs-border hover:i-text-$color-tabs-text-hover hover:i-border-$color-tabs-border-hover',
|
|
181
|
+
tabActive: 'i-text-$color-tabs-text-selected',
|
|
183
182
|
icon: 'mx-auto hover:i-text-$color-tabs-text-hover',
|
|
184
|
-
iconUnderlinedActive: 'i-text-$color-tabs-text-
|
|
183
|
+
iconUnderlinedActive: 'i-text-$color-tabs-text-selected',
|
|
185
184
|
content: 'flex items-center justify-center gap-8',
|
|
186
185
|
contentUnderlined: 'content-underlined', // content-underlined is a no-op that prevents a quirk in how Vue handles class bindings
|
|
187
|
-
contentUnderlinedActive: 'i-text-$color-tabs-text-
|
|
186
|
+
contentUnderlinedActive: 'i-text-$color-tabs-text-selected',
|
|
188
187
|
};
|
|
189
188
|
|
|
190
189
|
// Todo: Handle dynamic classnames
|
|
@@ -215,7 +214,7 @@ export const expandable = {
|
|
|
215
214
|
expansion: 'overflow-hidden',
|
|
216
215
|
expansionNotExpanded: 'h-0 invisible',
|
|
217
216
|
button: buttonReset + ' hover:underline focus:underline',
|
|
218
|
-
buttonBox: 'w-full text-left relative inline-flex
|
|
217
|
+
buttonBox: 'w-full text-left relative inline-flex items-center ' + box.box,
|
|
219
218
|
paddingTop: 'pt-0',
|
|
220
219
|
title: 'flex justify-between items-center',
|
|
221
220
|
titleType: 'h4',
|
|
@@ -224,25 +223,25 @@ export const expandable = {
|
|
|
224
223
|
export const button = {
|
|
225
224
|
// Buttontypes
|
|
226
225
|
buttonSecondary:
|
|
227
|
-
'py-10 px-14 border-2 font-bold rounded-8 leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-text-$color-button-secondary-text hover:i-text-$color-button-secondary-text i-border-$color-button-secondary-border i-bg-$color-button-secondary-background hover:i-bg-$color-button-secondary-background-hover hover:i-border-$color-button-secondary-border-hover active:i-bg-$color-button-secondary-background-active', // .button, .button--secondary, .button--default. using tailwind ease-in-out instead of fabric transition-timing-function: cubic-bezier(0.46, 0.03, 0.52, 0.96)
|
|
226
|
+
'py-10 px-14 border-2 font-bold rounded-8 text-m leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-text-$color-button-secondary-text hover:i-text-$color-button-secondary-text i-border-$color-button-secondary-border i-bg-$color-button-secondary-background hover:i-bg-$color-button-secondary-background-hover hover:i-border-$color-button-secondary-border-hover active:i-bg-$color-button-secondary-background-active', // .button, .button--secondary, .button--default. using tailwind ease-in-out instead of fabric transition-timing-function: cubic-bezier(0.46, 0.03, 0.52, 0.96)
|
|
228
227
|
buttonPrimary:
|
|
229
|
-
'py-12 px-16 border-0 font-bold rounded-8 leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-text-$color-button-primary-text hover:i-text-$color-button-primary-text i-bg-$color-button-primary-background hover:i-bg-$color-button-primary-background-hover! active:i-bg-$color-button-primary-background-active', // .button--primary, .button--cta
|
|
228
|
+
'py-12 px-16 border-0 font-bold rounded-8 text-m leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-text-$color-button-primary-text hover:i-text-$color-button-primary-text i-bg-$color-button-primary-background hover:i-bg-$color-button-primary-background-hover! active:i-bg-$color-button-primary-background-active', // .button--primary, .button--cta
|
|
230
229
|
buttonFlat:
|
|
231
|
-
'py-12 px-16 border-0! font-bold rounded-8 leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-bg-$color-button-quiet-background! i-text-$color-button-quiet-text! hover:i-bg-$color-button-quiet-background-hover! active:i-bg-$color-button-quiet-background-active!', // .button--quiet, .button--flat
|
|
230
|
+
'py-12 px-16 border-0! font-bold rounded-8 text-m leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-bg-$color-button-quiet-background! i-text-$color-button-quiet-text! hover:i-bg-$color-button-quiet-background-hover! active:i-bg-$color-button-quiet-background-active!', // .button--quiet, .button--flat
|
|
232
231
|
buttonDestructive:
|
|
233
|
-
'py-12 px-16 border-0 font-bold rounded-8 leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-bg-$color-button-negative-background i-text-$color-button-negative-text hover:i-text-$color-button-negative-text hover:i-bg-$color-button-negative-background-hover! active:i-bg-$color-button-negative-background-active!', // .button--destructive
|
|
232
|
+
'py-12 px-16 border-0 font-bold rounded-8 text-m leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-bg-$color-button-negative-background i-text-$color-button-negative-text hover:i-text-$color-button-negative-text hover:i-bg-$color-button-negative-background-hover! active:i-bg-$color-button-negative-background-active!', // .button--destructive
|
|
234
233
|
buttonDestructiveFlat:
|
|
235
|
-
'py-12 px-16 border-0 font-bold rounded-8 leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-bg-$color-button-negative-quiet-background! i-text-$color-button-negative-quiet-text! hover:i-bg-$color-button-negative-quiet-background-hover! active:i-bg-$color-button-negative-quiet-background-active!', // .button--destructive-flat
|
|
234
|
+
'py-12 px-16 border-0 font-bold rounded-8 text-m leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-bg-$color-button-negative-quiet-background! i-text-$color-button-negative-quiet-text! hover:i-bg-$color-button-negative-quiet-background-hover! active:i-bg-$color-button-negative-quiet-background-active!', // .button--destructive-flat
|
|
236
235
|
buttonUtility:
|
|
237
|
-
'px-[15px] py-[11px] font-bold leading-[24] max-w-max focusable justify-center transition-colors ease-in-out border rounded-4 i-text-$color-button-utility-text hover:i-text-$color-button-utility-text i-bg-$color-button-utility-background i-border-$color-button-utility-border hover:i-bg-$color-button-utility-background hover:i-border-$color-button-utility-border-hover! active:i-border-$color-button-utility-border-active!', // .button--utility
|
|
236
|
+
'px-[15px] py-[11px] font-bold text-m leading-[24] max-w-max focusable justify-center transition-colors ease-in-out border rounded-4 i-text-$color-button-utility-text hover:i-text-$color-button-utility-text i-bg-$color-button-utility-background i-border-$color-button-utility-border hover:i-bg-$color-button-utility-background hover:i-border-$color-button-utility-border-hover! active:i-border-$color-button-utility-border-active!', // .button--utility
|
|
238
237
|
buttonUtilityFlat:
|
|
239
|
-
'py-12 px-16 bg-transparent border-0 font-bold leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-text-$color-button-utility-quiet-text i-bg-$color-button-utility-quiet-background hover:i-bg-$color-button-utility-quiet-background-hover rounded-4', // .button--utility-flat
|
|
238
|
+
'py-12 px-16 bg-transparent border-0 font-bold text-m leading-[24] max-w-max focusable justify-center transition-colors ease-in-out i-text-$color-button-utility-quiet-text i-bg-$color-button-utility-quiet-background hover:i-bg-$color-button-utility-quiet-background-hover rounded-4', // .button--utility-flat
|
|
240
239
|
buttonPill:
|
|
241
|
-
'font-bold leading-[24] max-w-max focusable justify-center transition-colors ease-in-out rounded-full! min-h-[44px] min-w-[44px] border-0! p-4 i-text-$color-button-pill-icon hover:i-text-$color-button-pill-icon-hover active:i-text-$color-button-pill-icon-active i-bg-$color-button-pill-background hover:i-bg-$color-button-pill-background-hover
|
|
240
|
+
'font-bold text-m leading-[24] max-w-max focusable justify-center transition-colors ease-in-out rounded-full! min-h-[44px] min-w-[44px] border-0! p-4 i-text-$color-button-pill-icon hover:i-text-$color-button-pill-icon-hover active:i-text-$color-button-pill-icon-active i-bg-$color-button-pill-background hover:i-bg-$color-button-pill-background-hover active:i-bg-$color-button-pill-background-active inline-flex items-center justify-center hover:bg-clip-padding', // .button--pill
|
|
242
241
|
buttonLink:
|
|
243
|
-
'leading-[24] max-w-max focusable ease-in-out inline
|
|
244
|
-
//
|
|
245
|
-
buttonSmall: 'px-16 py-6 text-xs
|
|
242
|
+
'leading-[24] max-w-max bg-transparent focusable ease-in-out inline i-text-$color-button-link-text active:underline hover:underline', //.button--link /* Buttons pretending to be links, (Should rather inherit the actual link setup in the future?) */
|
|
243
|
+
// Size stuff
|
|
244
|
+
buttonSmall: 'px-16 py-6 text-xs!', // .button--small
|
|
246
245
|
buttonSmallOverride: 'py-8', // .button--small.button--primary, .button--small.button--destructive, .button--small.button--destructive-flat, .button--small.button--order, .button--small.button--quiet
|
|
247
246
|
buttonSmallSecondary: 'py-6', // .button--small.button--secondary
|
|
248
247
|
buttonSmallUtility: 'py-7 px-15', // .button--small.button--secondary
|
|
@@ -264,18 +263,18 @@ export const buttonGroup = {
|
|
|
264
263
|
vertical: 'flex-col',
|
|
265
264
|
nonOutlinedVertical: 'divide-y',
|
|
266
265
|
nonOutlinedHorizontal: 'divide-x',
|
|
267
|
-
}
|
|
266
|
+
};
|
|
268
267
|
|
|
269
268
|
export const buttonGroupItem = {
|
|
270
|
-
wrapper: 'relative i-text-$color-buttongroup-utility-text i-bg-$color-buttongroup-utility-background hover:i-bg-$color-buttongroup-utility-background-hover active:i-text-$color-buttongroup-utility-text-
|
|
271
|
-
outlined: 'border hover:z-30 i-border-$color-buttongroup-utility-border active:i-border-$color-buttongroup-utility-border-
|
|
269
|
+
wrapper: 'relative i-text-$color-buttongroup-utility-text i-bg-$color-buttongroup-utility-background hover:i-bg-$color-buttongroup-utility-background-hover active:i-text-$color-buttongroup-utility-text-selected active:i-bg-$color-buttongroup-utility-background-selected',
|
|
270
|
+
outlined: 'border hover:z-30 i-border-$color-buttongroup-utility-border active:i-border-$color-buttongroup-utility-border-selected',
|
|
272
271
|
outlinedVertical: '-mb-1 last:mb-0 first:rounded-lt-4 first:rounded-rt-4 last:rounded-lb-4 last:rounded-rb-4',
|
|
273
272
|
outlinedHorizontal: '-mr-1 last:mr-0 first:rounded-lt-4 first:rounded-lb-4 last:rounded-rt-4 last:rounded-rb-4',
|
|
274
273
|
outlinedVerticalResets: 'px-1 pt-1 last:pb-1 -mb-1 last:mb-0',
|
|
275
274
|
outlinedHorizontalResets: 'py-1 pl-1 last:pr-1 -mr-1 last:mr-0',
|
|
276
|
-
outlinedSelected: 'i-border-$color-buttongroup-utility-border-
|
|
277
|
-
selected: 'z-30 i-text-$color-buttongroup-utility-text-
|
|
278
|
-
}
|
|
275
|
+
outlinedSelected: 'i-border-$color-buttongroup-utility-border-selected',
|
|
276
|
+
selected: 'z-30 i-text-$color-buttongroup-utility-text-selected! i-bg-$color-buttongroup-utility-background-selected!',
|
|
277
|
+
};
|
|
279
278
|
|
|
280
279
|
export const modal = {
|
|
281
280
|
//TODO: this class can be removed when we have the solution for opacity and we can add rgba values to the background of the backdrop
|
|
@@ -313,20 +312,20 @@ export const alert = {
|
|
|
313
312
|
warning: "i-border-$color-alert-warning-subtle-border i-bg-$color-alert-warning-background i-text-$color-alert-warning-text i-border-l-$color-alert-warning-border",
|
|
314
313
|
warningIcon: "i-text-$color-alert-warning-icon",
|
|
315
314
|
info: "i-border-$color-alert-info-subtle-border i-bg-$color-alert-info-background i-text-$color-alert-info-text i-border-l-$color-alert-info-border",
|
|
316
|
-
infoIcon: "i-text-$color-alert-info-icon"
|
|
317
|
-
}
|
|
315
|
+
infoIcon: "i-text-$color-alert-info-icon",
|
|
316
|
+
};
|
|
318
317
|
|
|
319
318
|
export const input = {
|
|
320
319
|
default: 'block text-m mb-0 leading-m i-text-$color-input-text-filled i-bg-$color-input-background i-border-$color-input-border hover:i-border-$color-input-border-hover active:i-border-$color-input-border-active rounded-4 py-12 px-8 block border-1 w-full focusable focus:[--w-outline-offset:-2px] caret-current',
|
|
321
320
|
textArea: 'min-h-[42] sm:min-h-[45]',
|
|
322
321
|
disabled: 'i-bg-$color-input-background-disabled i-border-$color-input-border-disabled hover:i-border-$color-input-border-disabled! i-text-$color-input-text-disabled pointer-events-none',
|
|
323
|
-
invalid: 'i-border-$color-input-border-
|
|
322
|
+
invalid: 'i-border-$color-input-border-negative i-text-$color-input-text-negative!',
|
|
324
323
|
readOnly: 'pl-0 bg-transparent border-0 pointer-events-none i-text-$color-input-text-read-only',
|
|
325
|
-
placeholder: 'placeholder:
|
|
324
|
+
placeholder: 'placeholder:i-text-$color-input-text-placeholder',
|
|
326
325
|
wrapper: 'relative',
|
|
327
326
|
suffix: 'pr-40',
|
|
328
|
-
prefix: 'pl-40'
|
|
329
|
-
}
|
|
327
|
+
prefix: 'pl-40',
|
|
328
|
+
};
|
|
330
329
|
|
|
331
330
|
export const select = {
|
|
332
331
|
default: 'block text-m mb-0 leading-m i-text-$color-select-text i-bg-$color-select-background i-border-$color-select-border hover:i-border-$color-select-border-hover active:i-border-$color-select-border-active rounded-4 py-12 px-8 block border-1 w-full focusable focus:[--w-outline-offset:-2px] appearance-none pr-32 cursor-pointer caret-current',
|
|
@@ -335,24 +334,24 @@ export const select = {
|
|
|
335
334
|
readOnly: 'pl-0 bg-transparent border-0 pointer-events-none before:hidden',
|
|
336
335
|
wrapper: 'relative',
|
|
337
336
|
selectWrapper: `relative before:block before:absolute before:right-0 before:bottom-0 before:w-32 before:h-full before:pointer-events-none `,
|
|
338
|
-
chevron: 'absolute top-[30%] block right-0 bottom-0 w-32 h-full i-text-$color-select-icon',
|
|
337
|
+
chevron: 'absolute top-[30%] block right-0 bottom-0 w-32 h-full i-text-$color-select-icon pointer-events-none cursor-pointer',
|
|
339
338
|
chevronDisabled: 'opacity-25',
|
|
340
|
-
}
|
|
339
|
+
};
|
|
341
340
|
|
|
342
341
|
export const label = {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
342
|
+
label: 'antialiased block relative text-s font-bold pb-4 cursor-pointer i-text-$color-label-text',
|
|
343
|
+
labelInvalid: 'i-text-$color-label-text-negative',
|
|
344
|
+
optional: 'pl-8 font-normal text-s i-text-$color-label-optional-text',
|
|
345
|
+
};
|
|
347
346
|
|
|
348
347
|
export const helpText = {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
348
|
+
helpText: 'text-xs mt-4 block i-text-$color-helptext-text',
|
|
349
|
+
helpTextValid: 'i-text-$color-helptext-text-positive',
|
|
350
|
+
helpTextInvalid: 'i-text-$color-helptext-text-negative',
|
|
351
|
+
};
|
|
353
352
|
|
|
354
353
|
const prefixSuffixWrapperBase =
|
|
355
|
-
'absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] ';
|
|
354
|
+
'absolute top-0 bottom-0 flex justify-center items-center focusable focus:[--w-outline-offset:-2px] bg-transparent ';
|
|
356
355
|
|
|
357
356
|
export const suffix = {
|
|
358
357
|
wrapper: prefixSuffixWrapperBase + 'right-0',
|
|
@@ -374,9 +373,10 @@ export const breadcrumbs = {
|
|
|
374
373
|
link: 'i-text-$color-breadcrumbs-link-text',
|
|
375
374
|
separator: 'select-none i-text-$color-breadcrumbs-icon',
|
|
376
375
|
a11y: 'sr-only',
|
|
377
|
-
}
|
|
376
|
+
};
|
|
378
377
|
|
|
379
378
|
export const toggle = {
|
|
379
|
+
field: 'relative text-m',
|
|
380
380
|
wrapper: 'relative py-1',
|
|
381
381
|
deadToggleWrapper: 'h-20 w-20 pointer-events-none',
|
|
382
382
|
input: 'peer',
|
|
@@ -387,21 +387,21 @@ export const toggle = {
|
|
|
387
387
|
label: 'cursor-pointer text-m i-text-$color-label-text py-2 pl-28 select-none relative block before:block before:border before:absolute before:transition-all before:left-0 before:w-20 before:h-20 before:top-2',
|
|
388
388
|
deadToggleLabel: '-mt-2',
|
|
389
389
|
noContent: `before:content-[""]`,
|
|
390
|
-
indeterminate: `
|
|
390
|
+
indeterminate: `before:flex! before:items-center before:justify-center before:i-text-$color-checkbox-icon before:text-center before:font-bold before:content-["-"] peer-indeterminate:before:i-border-$color-checkbox-border-selected peer-indeterminate:before:i-bg-$color-checkbox-background-selected peer-indeterminate:hover:before:i-border-$color-checkbox-border-hover peer-indeterminate:hover:before:i-bg-$color-checkbox-background-selected-hover`,
|
|
391
391
|
labelDisabled: 'pointer-events-none',
|
|
392
392
|
checkbox: 'before:rounded-2 hover:before:i-border-$color-checkbox-border-hover hover:before:i-bg-$color-checkbox-background-hover',
|
|
393
|
-
checkboxChecked: 'peer-checked:before:i-border-$color-checkbox-border-
|
|
394
|
-
checkboxInvalid: 'before:i-bg-$color-checkbox-negative-background hover:before:i-bg-$color-checkbox-negative-background-hover peer-checked:before:i-border-$color-checkbox-negative-border-
|
|
395
|
-
checkboxDisabled: 'before:i-bg-$color-checkbox-background-disabled before:i-border-$color-checkbox-border-disabled peer-checked:before:i-border-$color-checkbox-border-
|
|
393
|
+
checkboxChecked: 'peer-checked:before:i-border-$color-checkbox-border-selected peer-checked:before:i-bg-$color-checkbox-background-selected peer-checked:peer-hover:before:i-border-$color-checkbox-border-selected-hover peer-checked:peer-hover:before:i-bg-$color-checkbox-background-selected-hover',
|
|
394
|
+
checkboxInvalid: 'before:i-bg-$color-checkbox-negative-background hover:before:i-bg-$color-checkbox-negative-background-hover peer-checked:before:i-border-$color-checkbox-negative-border-selected hover:before:i-border-$color-checkbox-negative-border-hover peer-checked:before:i-bg-$color-checkbox-negative-background-selected peer-checked:peer-hover:before:i-bg-$color-checkbox-negative-background-selected-hover peer-checked:peer-hover:before:i-border-$color-checkbox-negative-border-selected-hover',
|
|
395
|
+
checkboxDisabled: 'before:i-bg-$color-checkbox-background-disabled before:i-border-$color-checkbox-border-disabled peer-checked:before:i-border-$color-checkbox-border-selected-disabled peer-checked:before:i-bg-$color-checkbox-background-selected-disabled',
|
|
396
396
|
labelCheckboxBorder: 'i-border-$color-checkbox-border',
|
|
397
|
-
radio: 'before:rounded-full peer-checked:before:border-[6] peer-checked:peer-hover:before:i-border-$color-radio-border-
|
|
398
|
-
radioChecked: 'peer-checked:before:i-border-$color-radio-border-
|
|
399
|
-
radioInvalid: 'before:i-bg-$color-radio-negative-background peer-hover:before:i-bg-$color-radio-negative-background-hover before:i-border-$color-radio-negative-border peer-hover:before:i-border-$color-radio-negative-border-hover peer-checked:before:i-border-$color-radio-negative-border-
|
|
400
|
-
radioDisabled: 'before:i-bg-$color-radio-background-disabled before:i-border-$color-radio-border-disabled peer-checked:before:i-border-$color-radio-border-
|
|
397
|
+
radio: 'before:rounded-full peer-checked:before:border-[6] peer-checked:peer-hover:before:i-border-$color-radio-border-selected-hover peer-hover:before:i-border-$color-radio-border-hover peer-hover:before:i-bg-$color-radio-background-hover',
|
|
398
|
+
radioChecked: 'peer-checked:before:i-border-$color-radio-border-selected',
|
|
399
|
+
radioInvalid: 'before:i-bg-$color-radio-negative-background peer-hover:before:i-bg-$color-radio-negative-background-hover before:i-border-$color-radio-negative-border peer-hover:before:i-border-$color-radio-negative-border-hover peer-checked:before:i-border-$color-radio-negative-border-selected peer-checked:peer-hover:before:i-border-$color-radio-negative-border-selected-hover ',
|
|
400
|
+
radioDisabled: 'before:i-bg-$color-radio-background-disabled before:i-border-$color-radio-border-disabled peer-checked:before:i-border-$color-radio-border-selected-disabled',
|
|
401
401
|
labelRadioBorder: 'i-border-$color-radio-border',
|
|
402
402
|
radioButtons: 'inline-flex relative font-bold rounded-8',
|
|
403
403
|
radioButtonsGroup: 'group',
|
|
404
|
-
radioButtonsLabel: 'peer-hover:peer-not-checked:i-bg-$color-buttongroup-primary-background-hover peer-checked:i-text-$color-buttongroup-primary-text-
|
|
404
|
+
radioButtonsLabel: 'peer-hover:peer-not-checked:i-bg-$color-buttongroup-primary-background-hover peer-checked:i-text-$color-buttongroup-primary-text-selected peer-checked:i-bg-$color-buttongroup-primary-background-selected peer-checked:i-border-$color-buttongroup-primary-border-selected block relative text-s font-bold cursor-pointer i-text-$color-buttongroup-primary-text text-center i-bg-$color-buttongroup-primary-background border-2 i-border-$color-buttongroup-primary-border py-8 pl-12 pr-14 group-first-of-type:rounded-tl-8 group-first-of-type:rounded-bl-8 group-last-of-type:rounded-tr-8 group-last-of-type:rounded-br-8 group-not-last-of-type:border-r-0 peer-checked:z-10 group-not-first:-ml-2',
|
|
405
405
|
radioButtonsJustified: 'flex!',
|
|
406
406
|
radioButtonsGroupJustified: 'grow-1 shrink-0 basis-auto',
|
|
407
407
|
radioButtonsLabelSmall: 'text-xs py-[5px]! px-[8px]!',
|
|
@@ -410,17 +410,18 @@ export const toggle = {
|
|
|
410
410
|
};
|
|
411
411
|
|
|
412
412
|
export const clickable = {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
413
|
+
toggle: 'absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset',
|
|
414
|
+
label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
|
|
415
|
+
buttonOrLink: 'bg-transparent focusable',
|
|
416
|
+
buttonOrLinkStretch: 'inset-0 absolute',
|
|
417
|
+
};
|
|
417
418
|
|
|
418
419
|
export const combobox = {
|
|
419
420
|
wrapper: 'relative',
|
|
420
|
-
combobox: 'absolute left-0 right-0 pb-8 rounded-8
|
|
421
|
+
combobox: 'absolute left-0 right-0 pb-8 rounded-8 i-bg-$color-combobox-background i-shadow-$shadow-combobox',
|
|
421
422
|
textMatch: 'font-bold',
|
|
422
423
|
listbox: 'm-0 p-0 select-none list-none',
|
|
423
|
-
option: 'block cursor-pointer p-8 hover:
|
|
424
|
-
optionSelected: '
|
|
424
|
+
option: 'block cursor-pointer p-8 hover:i-bg-$color-combobox-option-background-hover',
|
|
425
|
+
optionSelected: 'i-bg-$color-combobox-option-background-selected hover:i-bg-$color-combobox-option-background-selected-hover',
|
|
425
426
|
a11y: 'sr-only',
|
|
426
|
-
}
|
|
427
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { button } from './index.js';
|
|
2
2
|
|
|
3
3
|
export const buttons = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
4
|
+
'button': button.buttonSecondary,
|
|
5
|
+
'button--secondary': button.buttonSecondary,
|
|
6
|
+
'button--default': button.buttonSecondary,
|
|
7
|
+
'button--small': button.buttonSmall,
|
|
8
|
+
'button--link': button.buttonLink,
|
|
9
|
+
'button--primary': button.buttonPrimary,
|
|
10
|
+
'button--cta': button.buttonPrimary,
|
|
11
|
+
'button--pill': button.buttonPill,
|
|
12
|
+
'button--utility': button.buttonUtility,
|
|
13
|
+
'button--utility-flat': button.buttonUtilityFlat,
|
|
14
|
+
'button--destructive': button.buttonDestructive,
|
|
15
|
+
'button--destructive-flat': button.buttonDestructiveFlat,
|
|
16
|
+
'button--flat': button.buttonFlat,
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-ds/css",
|
|
3
|
-
"
|
|
3
|
+
"repository": "git@github.com:warp-ds/css.git",
|
|
4
|
+
"version": "1.0.0",
|
|
4
5
|
"scripts": {
|
|
5
6
|
"build": "pnpm build:tokens && pnpm build:resets && pnpm build:cc",
|
|
6
7
|
"commit": "cz",
|
|
7
8
|
"semantic-release": "semantic-release",
|
|
8
|
-
"build:cc": "cd component-classes && tsc && vite build",
|
|
9
|
+
"build:cc": "cd component-classes && rm -rf *.d.ts && tsc && vite build",
|
|
9
10
|
"build:tokens": "cd tokens && node index.js",
|
|
10
|
-
"build:resets": "cd resets && node index.js"
|
|
11
|
+
"build:resets": "cd resets && node index.js",
|
|
12
|
+
"lint:fix": "eslint . --fix",
|
|
13
|
+
"lint:check": "eslint ."
|
|
11
14
|
},
|
|
12
15
|
"type": "module",
|
|
13
16
|
"exports": {
|
|
@@ -16,7 +19,19 @@
|
|
|
16
19
|
"./component-classes/classes": "./component-classes/classes.js",
|
|
17
20
|
"./component-classes/shortcuts": "./component-classes/shortcuts.js"
|
|
18
21
|
},
|
|
19
|
-
"
|
|
22
|
+
"typesVersions": {
|
|
23
|
+
"*": {
|
|
24
|
+
"./component-classes": [
|
|
25
|
+
"./component-classes/index.d.ts"
|
|
26
|
+
],
|
|
27
|
+
"./component-classes/classes": [
|
|
28
|
+
"./component-classes/classes.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"./component-classes/shortcuts": [
|
|
31
|
+
"./component-classes/shortcuts.d.ts"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
20
35
|
"files": [
|
|
21
36
|
"./component-classes/index.js",
|
|
22
37
|
"./component-classes/classes.js",
|
|
@@ -24,11 +39,9 @@
|
|
|
24
39
|
"./component-classes/index.d.ts"
|
|
25
40
|
],
|
|
26
41
|
"dependencies": {
|
|
27
|
-
"
|
|
28
|
-
"lightningcss": "^1.19.0",
|
|
29
|
-
"@sindresorhus/slugify": "^2.2.0",
|
|
42
|
+
"@warp-ds/fonts": "1.1.0",
|
|
30
43
|
"@warp-ds/tokenizer": "^0.0.2",
|
|
31
|
-
"@warp-ds/uno": "^1.0.0
|
|
44
|
+
"@warp-ds/uno": "^1.0.0"
|
|
32
45
|
},
|
|
33
46
|
"devDependencies": {
|
|
34
47
|
"@eik/cli": "^2.0.22",
|
|
@@ -36,11 +49,19 @@
|
|
|
36
49
|
"@semantic-release/exec": "^6.0.3",
|
|
37
50
|
"@semantic-release/git": "^10.0.1",
|
|
38
51
|
"cz-conventional-changelog": "^3.3.0",
|
|
52
|
+
"@warp-ds/eslint-config": "^0.0.1",
|
|
53
|
+
"eslint": "^8.43.0",
|
|
39
54
|
"semantic-release": "^20.1.3",
|
|
40
55
|
"typescript": "^4.9.5",
|
|
41
56
|
"unocss": "^0.53.1",
|
|
42
57
|
"vite": "^4.3.9",
|
|
43
|
-
"vite-plugin-dts": "^2.3.0"
|
|
58
|
+
"vite-plugin-dts": "^2.3.0",
|
|
59
|
+
"@sindresorhus/slugify": "^2.2.0",
|
|
60
|
+
"drnm": "^0.9.0",
|
|
61
|
+
"lightningcss": "^1.19.0"
|
|
62
|
+
},
|
|
63
|
+
"eslintConfig": {
|
|
64
|
+
"extends": "@warp-ds"
|
|
44
65
|
},
|
|
45
66
|
"config": {
|
|
46
67
|
"commitizen": {
|
|
@@ -54,5 +75,6 @@
|
|
|
54
75
|
"publishConfig": {
|
|
55
76
|
"registry": "https://registry.npmjs.org/",
|
|
56
77
|
"access": "public"
|
|
57
|
-
}
|
|
78
|
+
},
|
|
79
|
+
"license": "Apache-2.0"
|
|
58
80
|
}
|