paris 0.2.2 → 0.3.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/CHANGELOG.md +17 -0
- package/README.md +61 -5
- package/package.json +23 -13
- package/src/helpers/renderEnhancer.tsx +21 -0
- package/src/stories/Tokens.mdx +0 -8
- package/src/stories/button/Button.module.scss +12 -6
- package/src/stories/button/Button.stories.ts +17 -0
- package/src/stories/button/Button.tsx +48 -11
- package/src/stories/dropdown/Dropdown.module.scss +23 -0
- package/src/stories/input/Input.module.scss +134 -0
- package/src/stories/input/Input.stories.ts +87 -0
- package/src/stories/input/Input.tsx +172 -0
- package/src/stories/input/index.ts +1 -0
- package/src/stories/select/Select.module.scss +70 -0
- package/src/stories/select/Select.stories.ts +71 -0
- package/src/stories/select/Select.tsx +103 -0
- package/src/stories/select/index.ts +1 -0
- package/src/stories/text/Text.module.scss +1 -1
- package/src/stories/text/Text.tsx +36 -14
- package/src/stories/textarea/TextArea.stories.ts +19 -0
- package/src/stories/textarea/TextArea.tsx +120 -0
- package/src/stories/textarea/index.ts +1 -0
- package/src/stories/theme/global.scss +2 -0
- package/src/stories/theme/index.ts +1 -0
- package/src/stories/theme/themes.ts +52 -6
- package/src/stories/theme/util.scss +8 -0
- package/src/types/Enhancer.ts +3 -0
- package/src/styles/util.scss +0 -4
- /package/src/{styles → stories/theme}/tw-preflight.css +0 -0
|
@@ -2,6 +2,7 @@ import { createTheme } from 'pte';
|
|
|
2
2
|
import type { CSSColor, CSSLength } from '@ssh/csstypes';
|
|
3
3
|
import type { Property } from 'csstype';
|
|
4
4
|
import type { PartialDeep } from 'type-fest';
|
|
5
|
+
import merge from 'ts-deepmerge';
|
|
5
6
|
import { Tokens as T } from './tokens';
|
|
6
7
|
import type { TokensT } from './tokens';
|
|
7
8
|
|
|
@@ -16,6 +17,20 @@ export type FontDefinition = {
|
|
|
16
17
|
|
|
17
18
|
export type FontClassDefinition = Omit<FontDefinition, 'fontSize' | 'lineHeight'>;
|
|
18
19
|
|
|
20
|
+
export type ShadowDefinition = `${CSSLength} ${CSSLength} ${CSSLength} ${CSSColor}` | 'none';
|
|
21
|
+
|
|
22
|
+
const Shadows = {
|
|
23
|
+
shallowBelow: '0px 4px 20px rgba(0, 0, 0, 0.2)',
|
|
24
|
+
deepBelow: '0px 8px 20px rgba(0, 0, 0, 0.2)',
|
|
25
|
+
shallowAbove: '0px -4px 20px rgba(0, 0, 0, 0.2)',
|
|
26
|
+
deepAbove: '0px -8px 20px rgba(0, 0, 0, 0.2)',
|
|
27
|
+
shallowPopup: '0px 0px 30px rgba(0, 0, 0, 0.2)',
|
|
28
|
+
deepPopup: '0px 0px 40px rgba(0, 0, 0, 0.2)',
|
|
29
|
+
subtlePopup: '0px 0px 10px rgba(0, 0, 0, 0.1)',
|
|
30
|
+
shallowLeft: '-20px 0px 40px rgba(0, 0, 0, 0.1)',
|
|
31
|
+
shallowRight: '20px 0px 40px rgba(0, 0, 0, 0.1)',
|
|
32
|
+
} as const;
|
|
33
|
+
|
|
19
34
|
export type Theme = {
|
|
20
35
|
tokens: TokensT,
|
|
21
36
|
colors: {
|
|
@@ -91,6 +106,7 @@ export type Theme = {
|
|
|
91
106
|
fontFamily: string,
|
|
92
107
|
boldFontWeight: number,
|
|
93
108
|
italicLetterSpacing: CSSLength,
|
|
109
|
+
verticalMetricsAdjust: CSSLength;
|
|
94
110
|
|
|
95
111
|
styles: {
|
|
96
112
|
// Display
|
|
@@ -124,6 +140,17 @@ export type Theme = {
|
|
|
124
140
|
paragraphXXSmall: FontDefinition,
|
|
125
141
|
}
|
|
126
142
|
},
|
|
143
|
+
lighting: {
|
|
144
|
+
shallowBelow: ShadowDefinition,
|
|
145
|
+
deepBelow: ShadowDefinition,
|
|
146
|
+
shallowAbove: ShadowDefinition,
|
|
147
|
+
deepAbove: ShadowDefinition,
|
|
148
|
+
shallowPopup: ShadowDefinition,
|
|
149
|
+
deepPopup: ShadowDefinition,
|
|
150
|
+
subtlePopup: ShadowDefinition,
|
|
151
|
+
shallowLeft: ShadowDefinition,
|
|
152
|
+
shallowRight: ShadowDefinition,
|
|
153
|
+
},
|
|
127
154
|
borders: {
|
|
128
155
|
// Border Radius
|
|
129
156
|
radius: {
|
|
@@ -134,6 +161,13 @@ export type Theme = {
|
|
|
134
161
|
roundedSmall: CSSLength,
|
|
135
162
|
roundedLarge: CSSLength,
|
|
136
163
|
},
|
|
164
|
+
|
|
165
|
+
// Dropdowns (Select, Menu, Popovers, etc.)
|
|
166
|
+
|
|
167
|
+
dropdown: {
|
|
168
|
+
color: CSSColor,
|
|
169
|
+
shadow: ShadowDefinition,
|
|
170
|
+
}
|
|
137
171
|
},
|
|
138
172
|
animations: {
|
|
139
173
|
interaction: string,
|
|
@@ -245,6 +279,7 @@ export const LightTheme: Theme = {
|
|
|
245
279
|
fontFamily: '"Graphik Web", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif',
|
|
246
280
|
boldFontWeight: 500,
|
|
247
281
|
italicLetterSpacing: '-0.01em',
|
|
282
|
+
verticalMetricsAdjust: '1px',
|
|
248
283
|
|
|
249
284
|
styles: {
|
|
250
285
|
// Display
|
|
@@ -350,6 +385,9 @@ export const LightTheme: Theme = {
|
|
|
350
385
|
},
|
|
351
386
|
},
|
|
352
387
|
},
|
|
388
|
+
lighting: {
|
|
389
|
+
...Shadows,
|
|
390
|
+
},
|
|
353
391
|
borders: {
|
|
354
392
|
radius: {
|
|
355
393
|
pill: '1000px',
|
|
@@ -359,17 +397,19 @@ export const LightTheme: Theme = {
|
|
|
359
397
|
roundedSmall: '4px',
|
|
360
398
|
roundedLarge: '12px',
|
|
361
399
|
},
|
|
400
|
+
|
|
401
|
+
dropdown: {
|
|
402
|
+
shadow: Shadows.deepBelow,
|
|
403
|
+
color: 'transparent',
|
|
404
|
+
},
|
|
362
405
|
},
|
|
363
406
|
animations: {
|
|
364
|
-
interaction: '
|
|
407
|
+
interaction: '200ms cubic-bezier(0.5, 1, 0.89, 1)',
|
|
365
408
|
},
|
|
366
409
|
};
|
|
367
410
|
|
|
368
|
-
export const DarkTheme: Theme = {
|
|
369
|
-
...LightTheme,
|
|
411
|
+
export const DarkTheme: Theme = merge(LightTheme, {
|
|
370
412
|
colors: {
|
|
371
|
-
...LightTheme.colors,
|
|
372
|
-
|
|
373
413
|
// Reverse all inverse colors
|
|
374
414
|
|
|
375
415
|
contentPrimary: LightTheme.colors.contentInversePrimary,
|
|
@@ -397,7 +437,13 @@ export const DarkTheme: Theme = {
|
|
|
397
437
|
borderInverseOpaque: LightTheme.colors.borderOpaque,
|
|
398
438
|
borderInverseSelected: LightTheme.colors.borderSelected,
|
|
399
439
|
},
|
|
400
|
-
|
|
440
|
+
borders: {
|
|
441
|
+
dropdown: {
|
|
442
|
+
shadow: 'none',
|
|
443
|
+
color: T.colors.grey600,
|
|
444
|
+
},
|
|
445
|
+
},
|
|
446
|
+
} as PartialDeep<Theme>) as Theme;
|
|
401
447
|
|
|
402
448
|
export const {
|
|
403
449
|
theme,
|
package/src/styles/util.scss
DELETED
|
File without changes
|