@shift-css/core 0.4.0 → 0.6.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.
@@ -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
+ }
@@ -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';
@@ -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
+ }