@shift-css/core 0.5.0 → 0.7.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 -3
- package/dist/components/badge.css +162 -0
- package/dist/components/button.css +41 -41
- package/dist/components/card.css +62 -3
- package/dist/components/input.css +53 -2
- package/dist/components/menu.css +197 -0
- package/dist/components/modal.css +84 -19
- package/dist/components/select.css +169 -0
- package/dist/components/skip-link.css +8 -3
- package/dist/components/surface.css +15 -6
- package/dist/components/tooltip.css +159 -0
- package/dist/reset.css +1 -1
- package/dist/shift.css +1371 -153
- package/dist/shift.css.map +1 -1
- package/dist/shift.min.css +1 -1
- package/dist/utils/functions.css +103 -0
- package/dist/utils/scroll.css +233 -0
- package/package.json +19 -4
- package/types/attributes.d.ts +234 -0
- package/types/index.d.ts +44 -0
- package/types/react.d.ts +23 -0
- package/types/vue.d.ts +29 -0
package/package.json
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shift-css/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Zero-runtime, OKLCH-native CSS framework with cascade layers and native light-dark() theming",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/shift.css",
|
|
7
|
+
"types": "./types/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
|
-
".":
|
|
9
|
+
".": {
|
|
10
|
+
"style": "./dist/shift.css",
|
|
11
|
+
"default": "./dist/shift.css"
|
|
12
|
+
},
|
|
9
13
|
"./min": "./dist/shift.min.css",
|
|
10
14
|
"./reset": "./dist/reset.css",
|
|
11
15
|
"./tokens": "./dist/tokens.css",
|
|
16
|
+
"./components/badge": "./dist/components/badge.css",
|
|
12
17
|
"./components/button": "./dist/components/button.css",
|
|
13
18
|
"./components/card": "./dist/components/card.css",
|
|
14
19
|
"./components/input": "./dist/components/input.css",
|
|
15
20
|
"./components/modal": "./dist/components/modal.css",
|
|
21
|
+
"./components/prose": "./dist/components/prose.css",
|
|
22
|
+
"./components/skip-link": "./dist/components/skip-link.css",
|
|
16
23
|
"./components/surface": "./dist/components/surface.css",
|
|
24
|
+
"./components/tooltip": "./dist/components/tooltip.css",
|
|
17
25
|
"./utils/layout": "./dist/utils/layout.css",
|
|
18
26
|
"./utils/spacing": "./dist/utils/spacing.css",
|
|
19
27
|
"./utils/flex": "./dist/utils/flex.css",
|
|
20
28
|
"./utils/typography": "./dist/utils/typography.css",
|
|
21
29
|
"./utils/visibility": "./dist/utils/visibility.css",
|
|
30
|
+
"./utils/scroll": "./dist/utils/scroll.css",
|
|
31
|
+
"./utils/functions": "./dist/utils/functions.css",
|
|
32
|
+
"./types": "./types/index.d.ts",
|
|
33
|
+
"./types/react": "./types/react.d.ts",
|
|
34
|
+
"./types/vue": "./types/vue.d.ts",
|
|
35
|
+
"./types/attributes": "./types/attributes.d.ts",
|
|
22
36
|
"./package.json": "./package.json"
|
|
23
37
|
},
|
|
24
38
|
"files": [
|
|
25
|
-
"dist"
|
|
39
|
+
"dist",
|
|
40
|
+
"types"
|
|
26
41
|
],
|
|
27
42
|
"scripts": {
|
|
28
43
|
"build": "tsx scripts/build.ts",
|
|
@@ -44,7 +59,7 @@
|
|
|
44
59
|
"@playwright/test": "^1.50.1",
|
|
45
60
|
"@types/bun": "^1.3.6",
|
|
46
61
|
"@types/node": "^22.10.5",
|
|
47
|
-
"lightningcss": "^1.
|
|
62
|
+
"lightningcss": "^1.31.1",
|
|
48
63
|
"tsx": "^4.21.0",
|
|
49
64
|
"typescript": "^5.9.3"
|
|
50
65
|
},
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shift CSS - Attribute Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Shared type definitions for all Shift CSS attributes.
|
|
5
|
+
* Used by React and Vue module augmentations.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// COMPONENT ATTRIBUTES
|
|
10
|
+
// =============================================================================
|
|
11
|
+
|
|
12
|
+
/** Button variants */
|
|
13
|
+
export type ShiftButtonVariant =
|
|
14
|
+
| 'primary'
|
|
15
|
+
| 'secondary'
|
|
16
|
+
| 'ghost'
|
|
17
|
+
| 'link'
|
|
18
|
+
| 'outline'
|
|
19
|
+
| 'danger'
|
|
20
|
+
| 'success'
|
|
21
|
+
| 'warning';
|
|
22
|
+
|
|
23
|
+
/** Badge variants */
|
|
24
|
+
export type ShiftBadgeVariant =
|
|
25
|
+
| 'primary'
|
|
26
|
+
| 'secondary'
|
|
27
|
+
| 'accent'
|
|
28
|
+
| 'success'
|
|
29
|
+
| 'warning'
|
|
30
|
+
| 'danger'
|
|
31
|
+
| 'outline'
|
|
32
|
+
| 'outline-primary'
|
|
33
|
+
| 'outline-secondary'
|
|
34
|
+
| 'outline-success'
|
|
35
|
+
| 'outline-warning'
|
|
36
|
+
| 'outline-danger';
|
|
37
|
+
|
|
38
|
+
/** Surface variants */
|
|
39
|
+
export type ShiftSurfaceVariant = 'raised' | 'sunken' | 'overlay';
|
|
40
|
+
|
|
41
|
+
/** Modal position variants */
|
|
42
|
+
export type ShiftModalPosition = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'fullscreen';
|
|
43
|
+
|
|
44
|
+
/** Tooltip position */
|
|
45
|
+
export type ShiftTooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
46
|
+
|
|
47
|
+
/** Prose variants */
|
|
48
|
+
export type ShiftProseVariant = 'sm' | 'lg';
|
|
49
|
+
|
|
50
|
+
/** Input types (for styling variants) */
|
|
51
|
+
export type ShiftInputVariant = 'error' | 'success';
|
|
52
|
+
|
|
53
|
+
// =============================================================================
|
|
54
|
+
// SIZE ATTRIBUTES
|
|
55
|
+
// =============================================================================
|
|
56
|
+
|
|
57
|
+
/** Common size scale */
|
|
58
|
+
export type ShiftSize = 'sm' | 'lg' | 'xl';
|
|
59
|
+
|
|
60
|
+
/** Extended size scale (includes full) */
|
|
61
|
+
export type ShiftSizeExtended = ShiftSize | 'full';
|
|
62
|
+
|
|
63
|
+
// =============================================================================
|
|
64
|
+
// LAYOUT ATTRIBUTES
|
|
65
|
+
// =============================================================================
|
|
66
|
+
|
|
67
|
+
/** Flex direction and patterns */
|
|
68
|
+
export type ShiftFlexVariant =
|
|
69
|
+
| 'row'
|
|
70
|
+
| 'col'
|
|
71
|
+
| 'row-reverse'
|
|
72
|
+
| 'col-reverse'
|
|
73
|
+
| 'center'
|
|
74
|
+
| 'stack'
|
|
75
|
+
| 'between'
|
|
76
|
+
| 'end'
|
|
77
|
+
| 'wrap'
|
|
78
|
+
| 'nowrap';
|
|
79
|
+
|
|
80
|
+
/** Grid column counts */
|
|
81
|
+
export type ShiftGridColumns = '1' | '2' | '3' | '4' | '5' | '6' | '12' | 'auto-fit' | 'auto-fill';
|
|
82
|
+
|
|
83
|
+
/** Grid row counts */
|
|
84
|
+
export type ShiftGridRows = '1' | '2' | '3' | '4';
|
|
85
|
+
|
|
86
|
+
/** Column span */
|
|
87
|
+
export type ShiftColSpan = '1' | '2' | '3' | '4' | '6' | '12' | 'full';
|
|
88
|
+
|
|
89
|
+
/** Row span */
|
|
90
|
+
export type ShiftRowSpan = '1' | '2' | '3' | 'full';
|
|
91
|
+
|
|
92
|
+
/** Gap sizes */
|
|
93
|
+
export type ShiftGap = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none';
|
|
94
|
+
|
|
95
|
+
/** Container sizes */
|
|
96
|
+
export type ShiftContainer = 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'prose';
|
|
97
|
+
|
|
98
|
+
/** Justify content */
|
|
99
|
+
export type ShiftJustify = 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
100
|
+
|
|
101
|
+
/** Align items */
|
|
102
|
+
export type ShiftItems = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
103
|
+
|
|
104
|
+
/** Align content */
|
|
105
|
+
export type ShiftContent = 'start' | 'end' | 'center' | 'between' | 'around';
|
|
106
|
+
|
|
107
|
+
/** Position */
|
|
108
|
+
export type ShiftPosition = 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
|
109
|
+
|
|
110
|
+
/** Inset */
|
|
111
|
+
export type ShiftInset = '0' | 'auto';
|
|
112
|
+
|
|
113
|
+
/** Display */
|
|
114
|
+
export type ShiftDisplay =
|
|
115
|
+
| 'block'
|
|
116
|
+
| 'inline'
|
|
117
|
+
| 'inline-block'
|
|
118
|
+
| 'contents'
|
|
119
|
+
| 'inline-flex'
|
|
120
|
+
| 'inline-grid';
|
|
121
|
+
|
|
122
|
+
// =============================================================================
|
|
123
|
+
// VISIBILITY ATTRIBUTES
|
|
124
|
+
// =============================================================================
|
|
125
|
+
|
|
126
|
+
/** Responsive breakpoints for hide-on */
|
|
127
|
+
export type ShiftBreakpoint = 'sm' | 'md' | 'lg' | 'xl';
|
|
128
|
+
|
|
129
|
+
// =============================================================================
|
|
130
|
+
// BOOLEAN ATTRIBUTE TYPE
|
|
131
|
+
// =============================================================================
|
|
132
|
+
|
|
133
|
+
/** Boolean attribute type - accepts boolean or empty string for presence-only attributes */
|
|
134
|
+
export type ShiftBooleanAttr = boolean | '';
|
|
135
|
+
|
|
136
|
+
/** Overflow */
|
|
137
|
+
export type ShiftOverflow = 'auto' | 'hidden' | 'scroll' | 'visible';
|
|
138
|
+
|
|
139
|
+
/** Pointer events */
|
|
140
|
+
export type ShiftPointer = 'none' | 'auto';
|
|
141
|
+
|
|
142
|
+
/** User select */
|
|
143
|
+
export type ShiftSelect = 'none' | 'text' | 'all' | 'auto';
|
|
144
|
+
|
|
145
|
+
// =============================================================================
|
|
146
|
+
// COMPLETE ATTRIBUTE MAP
|
|
147
|
+
// =============================================================================
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* All Shift CSS attributes with their value types.
|
|
151
|
+
* Boolean attributes accept `true` or empty string.
|
|
152
|
+
*/
|
|
153
|
+
export interface ShiftAttributes {
|
|
154
|
+
// Component attributes (with variants)
|
|
155
|
+
's-btn'?: ShiftButtonVariant | ShiftBooleanAttr;
|
|
156
|
+
's-badge'?: ShiftBadgeVariant | ShiftBooleanAttr;
|
|
157
|
+
's-surface'?: ShiftSurfaceVariant | ShiftBooleanAttr;
|
|
158
|
+
's-modal'?: ShiftModalPosition | ShiftBooleanAttr;
|
|
159
|
+
's-tooltip'?: string;
|
|
160
|
+
's-tooltip-pos'?: ShiftTooltipPosition;
|
|
161
|
+
's-prose'?: ShiftProseVariant | ShiftBooleanAttr;
|
|
162
|
+
's-input'?: ShiftInputVariant | ShiftBooleanAttr;
|
|
163
|
+
's-card'?: ShiftBooleanAttr;
|
|
164
|
+
's-skip-link'?: ShiftBooleanAttr;
|
|
165
|
+
|
|
166
|
+
// Size modifier (composable)
|
|
167
|
+
's-size'?: ShiftSizeExtended;
|
|
168
|
+
|
|
169
|
+
// Layout attributes
|
|
170
|
+
's-flex'?: ShiftFlexVariant | ShiftBooleanAttr;
|
|
171
|
+
's-grid'?: ShiftGridColumns | ShiftBooleanAttr;
|
|
172
|
+
's-grid-rows'?: ShiftGridRows;
|
|
173
|
+
's-col-span'?: ShiftColSpan;
|
|
174
|
+
's-row-span'?: ShiftRowSpan;
|
|
175
|
+
's-gap'?: ShiftGap | ShiftBooleanAttr;
|
|
176
|
+
's-container'?: ShiftContainer | ShiftBooleanAttr;
|
|
177
|
+
's-justify'?: ShiftJustify;
|
|
178
|
+
's-items'?: ShiftItems;
|
|
179
|
+
's-content'?: ShiftContent;
|
|
180
|
+
's-position'?: ShiftPosition;
|
|
181
|
+
's-inset'?: ShiftInset;
|
|
182
|
+
's-display'?: ShiftDisplay;
|
|
183
|
+
|
|
184
|
+
// Visibility attributes
|
|
185
|
+
's-hide-on'?: ShiftBreakpoint;
|
|
186
|
+
's-overflow'?: ShiftOverflow;
|
|
187
|
+
's-overflow-x'?: ShiftOverflow;
|
|
188
|
+
's-overflow-y'?: ShiftOverflow;
|
|
189
|
+
's-pointer'?: ShiftPointer;
|
|
190
|
+
's-select'?: ShiftSelect;
|
|
191
|
+
|
|
192
|
+
// Boolean attributes (presence-only)
|
|
193
|
+
's-block'?: ShiftBooleanAttr;
|
|
194
|
+
's-bordered'?: ShiftBooleanAttr;
|
|
195
|
+
's-btn-group'?: ShiftBooleanAttr;
|
|
196
|
+
's-card-body'?: ShiftBooleanAttr;
|
|
197
|
+
's-card-footer'?: ShiftBooleanAttr;
|
|
198
|
+
's-card-header'?: ShiftBooleanAttr;
|
|
199
|
+
's-card-media'?: ShiftBooleanAttr;
|
|
200
|
+
's-card-title'?: ShiftBooleanAttr;
|
|
201
|
+
's-card-subtitle'?: ShiftBooleanAttr;
|
|
202
|
+
's-card-icon'?: ShiftBooleanAttr;
|
|
203
|
+
's-card-grid'?: ShiftBooleanAttr;
|
|
204
|
+
's-card-stack'?: ShiftBooleanAttr;
|
|
205
|
+
's-checkbox'?: ShiftBooleanAttr;
|
|
206
|
+
's-collapse'?: ShiftBooleanAttr;
|
|
207
|
+
's-dot'?: ShiftBooleanAttr;
|
|
208
|
+
's-field'?: ShiftBooleanAttr;
|
|
209
|
+
's-field-label'?: ShiftBooleanAttr;
|
|
210
|
+
's-field-hint'?: ShiftBooleanAttr;
|
|
211
|
+
's-field-error'?: ShiftBooleanAttr;
|
|
212
|
+
's-hidden'?: ShiftBooleanAttr;
|
|
213
|
+
's-horizontal'?: ShiftBooleanAttr;
|
|
214
|
+
's-icon'?: ShiftBooleanAttr;
|
|
215
|
+
's-input-group'?: ShiftBooleanAttr;
|
|
216
|
+
's-input-addon'?: ShiftBooleanAttr;
|
|
217
|
+
's-interactive'?: ShiftBooleanAttr;
|
|
218
|
+
's-invisible'?: ShiftBooleanAttr;
|
|
219
|
+
's-isolate'?: ShiftBooleanAttr;
|
|
220
|
+
's-link'?: ShiftBooleanAttr;
|
|
221
|
+
's-loading'?: ShiftBooleanAttr;
|
|
222
|
+
's-modal-body'?: ShiftBooleanAttr;
|
|
223
|
+
's-modal-close'?: ShiftBooleanAttr;
|
|
224
|
+
's-modal-footer'?: ShiftBooleanAttr;
|
|
225
|
+
's-modal-header'?: ShiftBooleanAttr;
|
|
226
|
+
's-not-sr-only'?: ShiftBooleanAttr;
|
|
227
|
+
's-pill'?: ShiftBooleanAttr;
|
|
228
|
+
's-radio'?: ShiftBooleanAttr;
|
|
229
|
+
's-skip-link-group'?: ShiftBooleanAttr;
|
|
230
|
+
's-sr-only'?: ShiftBooleanAttr;
|
|
231
|
+
's-toggle'?: ShiftBooleanAttr;
|
|
232
|
+
's-truncate'?: ShiftBooleanAttr;
|
|
233
|
+
's-visible'?: ShiftBooleanAttr;
|
|
234
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shift CSS - Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Export all type definitions for use in TypeScript projects.
|
|
5
|
+
*
|
|
6
|
+
* For framework-specific types, import directly:
|
|
7
|
+
* - React: "@shift-css/core/types/react"
|
|
8
|
+
* - Vue: "@shift-css/core/types/vue"
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type {
|
|
12
|
+
// Component variants
|
|
13
|
+
ShiftButtonVariant,
|
|
14
|
+
ShiftBadgeVariant,
|
|
15
|
+
ShiftSurfaceVariant,
|
|
16
|
+
ShiftModalPosition,
|
|
17
|
+
ShiftTooltipPosition,
|
|
18
|
+
ShiftProseVariant,
|
|
19
|
+
ShiftInputVariant,
|
|
20
|
+
// Sizes
|
|
21
|
+
ShiftSize,
|
|
22
|
+
ShiftSizeExtended,
|
|
23
|
+
// Layout
|
|
24
|
+
ShiftFlexVariant,
|
|
25
|
+
ShiftGridColumns,
|
|
26
|
+
ShiftGridRows,
|
|
27
|
+
ShiftColSpan,
|
|
28
|
+
ShiftRowSpan,
|
|
29
|
+
ShiftGap,
|
|
30
|
+
ShiftContainer,
|
|
31
|
+
ShiftJustify,
|
|
32
|
+
ShiftItems,
|
|
33
|
+
ShiftContent,
|
|
34
|
+
ShiftPosition,
|
|
35
|
+
ShiftInset,
|
|
36
|
+
ShiftDisplay,
|
|
37
|
+
// Visibility
|
|
38
|
+
ShiftBreakpoint,
|
|
39
|
+
ShiftOverflow,
|
|
40
|
+
ShiftPointer,
|
|
41
|
+
ShiftSelect,
|
|
42
|
+
// Complete map
|
|
43
|
+
ShiftAttributes,
|
|
44
|
+
} from './attributes';
|
package/types/react.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shift CSS - React Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Module augmentation for React JSX to support Shift CSS attributes.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* Add to your tsconfig.json:
|
|
8
|
+
* {
|
|
9
|
+
* "compilerOptions": {
|
|
10
|
+
* "types": ["@shift-css/core/types/react"]
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* Or add a reference in a .d.ts file:
|
|
15
|
+
* /// <reference types="@shift-css/core/types/react" />
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { ShiftAttributes } from './attributes';
|
|
19
|
+
|
|
20
|
+
declare module 'react' {
|
|
21
|
+
// biome-ignore lint/correctness/noUnusedVariables: T must match React's HTMLAttributes<T> signature
|
|
22
|
+
interface HTMLAttributes<T> extends ShiftAttributes {}
|
|
23
|
+
}
|
package/types/vue.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shift CSS - Vue Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Module augmentation for Vue 3 templates to support Shift CSS attributes.
|
|
5
|
+
* Works with Volar (Vue Language Tools) for template type checking.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* Add to your tsconfig.json:
|
|
9
|
+
* {
|
|
10
|
+
* "compilerOptions": {
|
|
11
|
+
* "types": ["@shift-css/core/types/vue"]
|
|
12
|
+
* }
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* Or add a reference in a .d.ts file:
|
|
16
|
+
* /// <reference types="@shift-css/core/types/vue" />
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import type { ShiftAttributes } from './attributes';
|
|
20
|
+
|
|
21
|
+
// Augment Vue's global component props
|
|
22
|
+
declare module 'vue' {
|
|
23
|
+
interface ComponentCustomProps extends ShiftAttributes {}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Augment @vue/runtime-dom for template type checking
|
|
27
|
+
declare module '@vue/runtime-dom' {
|
|
28
|
+
interface HTMLAttributes extends ShiftAttributes {}
|
|
29
|
+
}
|