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.
@@ -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: '0.2s cubic-bezier(0.25, 1, 0.5, 1)',
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,
@@ -0,0 +1,8 @@
1
+ @mixin flex-row {
2
+ display: flex;
3
+ flex-direction: row;
4
+ }
5
+
6
+ .bold {
7
+ font-weight: var(--pte-typography-boldFontWeight);
8
+ }
@@ -0,0 +1,3 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export type Enhancer = ReactNode | (({ size }: { size: number }) => ReactNode);
@@ -1,4 +0,0 @@
1
- .flex-row {
2
- display: flex;
3
- flex-direction: row;
4
- }
File without changes