@apple-pie/slice-native 0.1.3 → 0.1.6

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.
Files changed (74) hide show
  1. package/README.md +196 -6
  2. package/dist/cjs/components.js +15 -0
  3. package/dist/cjs/hooks.js +7 -0
  4. package/dist/cjs/index.js +18 -805
  5. package/dist/cjs/providers.js +9 -0
  6. package/dist/cjs/src/components/SliceButton/SliceButton.js +119 -0
  7. package/dist/cjs/src/components/SliceIcon/SliceIcon.js +20 -0
  8. package/dist/cjs/src/components/SliceIcon/iconRegistry.js +668 -0
  9. package/dist/cjs/src/components/SliceIcon/icons.js +144 -0
  10. package/dist/cjs/src/components/SliceText/SliceText.js +21 -0
  11. package/dist/cjs/src/components/SliceTextInput/SliceTextInput.js +87 -0
  12. package/dist/cjs/src/hooks/useCreateThemedStyles/useCreateThemedStyles.js +13 -0
  13. package/dist/cjs/src/providers/SliceThemeProvider.js +37 -0
  14. package/dist/cjs/src/theme/colors/colors.js +253 -0
  15. package/dist/cjs/src/theme/corners/corners.js +14 -0
  16. package/dist/cjs/src/theme/elevations/elevations.js +17 -0
  17. package/dist/cjs/src/theme/motion/motion.js +15 -0
  18. package/dist/cjs/src/theme/motion.js +47 -0
  19. package/dist/cjs/src/theme/spacing/spacing.js +14 -0
  20. package/dist/cjs/src/theme/type/type.js +190 -0
  21. package/dist/cjs/src/utils/typography/typography.js +17 -0
  22. package/dist/cjs/theme.js +23 -538
  23. package/dist/cjs/utils.js +7 -0
  24. package/dist/esm/components.mjs +5 -0
  25. package/dist/esm/hooks.mjs +1 -0
  26. package/dist/esm/index.mjs +8 -806
  27. package/dist/esm/providers.mjs +1 -0
  28. package/dist/esm/src/components/SliceButton/SliceButton.mjs +117 -0
  29. package/dist/esm/src/components/SliceIcon/SliceIcon.mjs +18 -0
  30. package/dist/esm/src/components/SliceIcon/iconRegistry.mjs +666 -0
  31. package/dist/esm/src/components/SliceIcon/icons.mjs +142 -0
  32. package/dist/esm/src/components/SliceText/SliceText.mjs +19 -0
  33. package/dist/esm/src/components/SliceTextInput/SliceTextInput.mjs +85 -0
  34. package/dist/esm/src/hooks/useCreateThemedStyles/useCreateThemedStyles.mjs +11 -0
  35. package/dist/esm/src/providers/SliceThemeProvider.mjs +33 -0
  36. package/dist/esm/src/theme/colors/colors.mjs +249 -0
  37. package/dist/esm/src/theme/corners/corners.mjs +12 -0
  38. package/dist/esm/src/theme/elevations/elevations.mjs +15 -0
  39. package/dist/esm/src/theme/motion/motion.mjs +13 -0
  40. package/dist/esm/src/theme/motion.mjs +45 -0
  41. package/dist/esm/src/theme/spacing/spacing.mjs +12 -0
  42. package/dist/esm/src/theme/type/type.mjs +184 -0
  43. package/dist/esm/src/utils/typography/typography.mjs +15 -0
  44. package/dist/esm/theme.mjs +7 -522
  45. package/dist/esm/utils.mjs +1 -0
  46. package/dist/types/native/index.d.ts +8 -4
  47. package/dist/types/native/src/components/SliceButton/SliceButton.d.ts +5 -0
  48. package/dist/types/native/src/components/SliceButton/_types.d.ts +47 -0
  49. package/dist/types/native/src/components/SliceButton/index.d.ts +2 -0
  50. package/dist/types/native/src/components/SliceIcon/SliceIcon.d.ts +2 -0
  51. package/dist/types/native/{components/Icon → src/components/SliceIcon}/icons.d.ts +2 -0
  52. package/dist/types/native/src/components/SliceIcon/index.d.ts +3 -0
  53. package/dist/types/native/src/components/SliceText/SliceText.d.ts +5 -0
  54. package/dist/types/native/src/components/SliceText/_types.d.ts +17 -0
  55. package/dist/types/native/src/components/SliceText/index.d.ts +2 -0
  56. package/dist/types/native/src/components/SliceTextInput/SliceTextInput.d.ts +2 -0
  57. package/dist/types/native/src/components/SliceTextInput/_types.d.ts +36 -0
  58. package/dist/types/native/src/components/SliceTextInput/index.d.ts +2 -0
  59. package/dist/types/native/src/components/index.d.ts +8 -0
  60. package/dist/types/native/src/hooks/index.d.ts +1 -0
  61. package/dist/types/native/src/hooks/useCreateThemedStyles/index.d.ts +1 -0
  62. package/dist/types/native/src/hooks/useCreateThemedStyles/useCreateThemedStyles.d.ts +7 -0
  63. package/dist/types/native/src/providers/SliceThemeProvider.d.ts +16 -0
  64. package/dist/types/native/src/providers/index.d.ts +2 -0
  65. package/dist/types/native/{theme → src/theme}/index.d.ts +5 -5
  66. package/dist/types/native/src/utils/index.d.ts +1 -0
  67. package/dist/types/native/src/utils/typography/index.d.ts +1 -0
  68. package/dist/types/native/src/utils/typography/typography.d.ts +7 -0
  69. package/package.json +32 -3
  70. package/dist/types/native/components/Icon/NativeIcon.d.ts +0 -2
  71. package/dist/types/native/components/Icon/index.d.ts +0 -3
  72. /package/dist/types/native/{components/Icon → src/components/SliceIcon}/_types.d.ts +0 -0
  73. /package/dist/types/native/{components/Icon → src/components/SliceIcon}/iconRegistry.d.ts +0 -0
  74. /package/dist/types/native/{theme → src/theme}/motion.d.ts +0 -0
package/dist/cjs/theme.js CHANGED
@@ -1,533 +1,18 @@
1
1
  'use strict';
2
2
 
3
- const coreColors$1 = {
4
- 'brand-grey-50': '#f4f7fa',
5
- 'brand-grey-100': '#e5ecf3',
6
- 'brand-grey-200': '#d5e0ea',
7
- 'brand-grey-300': '#98acbf',
8
- 'brand-grey-400': '#7f96a9',
9
- 'brand-grey-500': '#657d91',
10
- 'brand-grey-600': '#4c6273',
11
- 'brand-grey-700': '#405261',
12
- 'brand-grey-800': '#37434e',
13
- 'brand-grey-900': '#2d353d',
14
- 'brand-grey-950': '#1f262d',
15
- 'brand-sea-50': '#e8f1ff',
16
- 'brand-sea-100': '#c7defe',
17
- 'brand-sea-200': '#a5c9ff',
18
- 'brand-sea-300': '#7ab3ff',
19
- 'brand-sea-400': '#4084ff',
20
- 'brand-sea-500': '#2f45ff',
21
- 'brand-sea-600': '#2d2fff',
22
- 'brand-sea-700': '#0000ff',
23
- 'brand-sea-800': '#0609cd',
24
- 'brand-sea-900': '#001699',
25
- 'brand-sea-950': '#0a0b5c',
26
- 'brand-sky-50': '#eafffe',
27
- 'brand-sky-100': '#cdfffb',
28
- 'brand-sky-200': '#a3f8ff',
29
- 'brand-sky-300': '#6af5ff',
30
- 'brand-sky-400': '#00edff',
31
- 'brand-sky-500': '#00c8e0',
32
- 'brand-sky-600': '#00a6c0',
33
- 'brand-sky-700': '#03839b',
34
- 'brand-sky-800': '#0d697d',
35
- 'brand-sky-900': '#105669',
36
- 'brand-sky-950': '#033949',
37
- 'brand-land-50': '#f4ffe5',
38
- 'brand-land-100': '#e0ffb7',
39
- 'brand-land-200': '#caff95',
40
- 'brand-land-300': '#b7fe59',
41
- 'brand-land-400': '#9cf820',
42
- 'brand-land-500': '#71e618',
43
- 'brand-land-600': '#56c900',
44
- 'brand-land-700': '#2d8c00',
45
- 'brand-land-800': '#31690b',
46
- 'brand-land-900': '#2a580f',
47
- 'brand-land-950': '#123201',
48
- 'brand-orange-50': '#fff8ec',
49
- 'brand-orange-100': '#ffebd7',
50
- 'brand-orange-200': '#ffe3c6',
51
- 'brand-orange-300': '#ffc182',
52
- 'brand-orange-400': '#ff972e',
53
- 'brand-orange-500': '#ff800a',
54
- 'brand-orange-600': '#ff6700',
55
- 'brand-orange-700': '#ff3700',
56
- 'brand-orange-800': '#a02b0b',
57
- 'brand-orange-900': '#80250b',
58
- 'brand-orange-950': '#461604',
59
- 'brand-yellow-50': '#ffffea',
60
- 'brand-yellow-100': '#fffdca',
61
- 'brand-yellow-200': '#fff2a0',
62
- 'brand-yellow-300': '#ffeb72',
63
- 'brand-yellow-400': '#ffd333',
64
- 'brand-yellow-500': '#ffc200',
65
- 'brand-yellow-600': '#ffad00',
66
- 'brand-yellow-700': '#c68601',
67
- 'brand-yellow-800': '#8f6307',
68
- 'brand-yellow-900': '#5f430a',
69
- 'brand-yellow-950': '#442e00',
70
- 'brand-purple-50': '#faf0ff',
71
- 'brand-purple-100': '#f4ddff',
72
- 'brand-purple-200': '#e5cdff',
73
- 'brand-purple-300': '#ccafff',
74
- 'brand-purple-400': '#b891ff',
75
- 'brand-purple-500': '#7d48ff',
76
- 'brand-purple-600': '#6a14ff',
77
- 'brand-purple-700': '#5600f1',
78
- 'brand-purple-800': '#4d01d6',
79
- 'brand-purple-900': '#4003af',
80
- 'brand-purple-950': '#1e007c',
81
- 'brand-magenta-50': '#fef1fc',
82
- 'brand-magenta-100': '#ffdcef',
83
- 'brand-magenta-200': '#ffcae6',
84
- 'brand-magenta-300': '#ff90cb',
85
- 'brand-magenta-400': '#ff61ca',
86
- 'brand-magenta-500': '#ff3ac2',
87
- 'brand-magenta-600': '#f012aa',
88
- 'brand-magenta-700': '#df059b',
89
- 'brand-magenta-800': '#9b0069',
90
- 'brand-magenta-900': '#790a55',
91
- 'brand-magenta-950': '#58003a',
92
- 'brand-white-0': '#ffffff',
93
- 'product-red-400': '#ff474a',
94
- 'product-red-500': '#df0529',
95
- 'core-drop-shadow-light': '#0339491a',
96
- 'core-drop-shadow-dark': '#0000007a',
97
- 'core-surface-coverup-translucent-light': '#1f262d52',
98
- 'core-surface-coverup-translucent-dark': '#0000007a',
99
- 'core-surface-overlay-translucent-light': '#ffffffcc',
100
- 'core-surface-overlay-translucent-dark': '#1f262dcc',
101
- 'surface-primary-tint-light': '#fcfcfc',
102
- 'surface-primary-tint-dark': '#191e24',
103
- 'scroll-bar-light': '#e3e8ef',
104
- 'scroll-bar-dark': 'rgba(255, 255, 255, 0.1)',
105
- 'scroll-bar-hover-light': '#cdd5df',
106
- 'scroll-bar-hover-dark': 'rgba(255, 255, 255, 0.15)',
107
- 'surface-shadow-soft-light': '0px 4px 24px #0339491a',
108
- 'surface-shadow-soft-dark': '0px 4px 24px #0000007a',
109
- 'surface-shadow-strong-light': '0px 4px 64px #0339491a',
110
- 'surface-shadow-strong-dark': '0px 4px 64px #0000007a',
111
- };
112
- const light = {
113
- 'array-land': coreColors$1['brand-land-100'],
114
- 'array-land-label': coreColors$1['brand-land-600'],
115
- 'array-magenta': coreColors$1['brand-magenta-100'],
116
- 'array-magenta-label': coreColors$1['brand-magenta-600'],
117
- 'array-orange': coreColors$1['brand-orange-100'],
118
- 'array-orange-label': coreColors$1['brand-orange-600'],
119
- 'array-purple': coreColors$1['brand-purple-100'],
120
- 'array-purple-label': coreColors$1['brand-purple-600'],
121
- 'array-sea': coreColors$1['brand-sea-100'],
122
- 'array-sea-label': coreColors$1['brand-sea-600'],
123
- 'array-sky': coreColors$1['brand-sky-100'],
124
- 'array-sky-label': coreColors$1['brand-sky-600'],
125
- 'array-yellow': coreColors$1['brand-yellow-100'],
126
- 'array-yellow-label': coreColors$1['brand-yellow-600'],
127
- 'core-badge-primary': coreColors$1['brand-sea-500'],
128
- 'core-badge-secondary': coreColors$1['brand-grey-100'],
129
- 'core-button-disabled': coreColors$1['brand-grey-50'],
130
- 'core-button-primary': coreColors$1['brand-sea-500'],
131
- 'core-drop-shadow': coreColors$1['core-drop-shadow-light'],
132
- 'core-gp-logo-primary': coreColors$1['brand-sea-700'],
133
- 'core-gp-logo-secondary': coreColors$1['brand-grey-950'],
134
- 'core-icon-dark': coreColors$1['brand-grey-950'],
135
- 'core-icon-disabled': coreColors$1['brand-grey-300'],
136
- 'core-icon-error': coreColors$1['product-red-500'],
137
- 'core-icon-light': coreColors$1['brand-white-0'],
138
- 'core-icon-primary': coreColors$1['brand-grey-950'],
139
- 'core-icon-secondary': coreColors$1['brand-grey-700'],
140
- 'core-icon-tertiary': coreColors$1['brand-sea-500'],
141
- 'core-outline-secondary': coreColors$1['brand-grey-100'],
142
- 'core-outline-primary': coreColors$1['brand-grey-100'],
143
- 'core-outline-special': coreColors$1['brand-sea-100'],
144
- 'core-outline-tertiary': coreColors$1['brand-sea-500'],
145
- 'core-surface-coverup-translucent': coreColors$1['core-surface-coverup-translucent-light'],
146
- 'core-surface-overlay-translucent': coreColors$1['core-surface-overlay-translucent-light'],
147
- 'core-surface-primary': coreColors$1['brand-white-0'],
148
- 'core-surface-primary-tint': coreColors$1['surface-primary-tint-light'],
149
- 'core-surface-secondary': coreColors$1['brand-grey-50'],
150
- 'core-surface-special': coreColors$1['brand-sea-50'],
151
- 'core-text-dark': coreColors$1['brand-grey-950'],
152
- 'core-text-disabled': coreColors$1['brand-grey-300'],
153
- 'core-text-error': coreColors$1['product-red-500'],
154
- 'core-text-light': coreColors$1['brand-white-0'],
155
- 'core-text-primary': coreColors$1['brand-grey-950'],
156
- 'core-text-secondary': coreColors$1['brand-grey-700'],
157
- 'core-text-tertiary': coreColors$1['brand-grey-600'],
158
- 'core-text-special': coreColors$1['brand-sea-500'],
159
- 'core-text-accent': coreColors$1['brand-sky-500'],
160
- 'core-link-primary': coreColors$1['brand-sea-500'],
161
- 'eor-tag-employee': coreColors$1['brand-sky-700'],
162
- 'eor-tag-overdue': coreColors$1['product-red-500'],
163
- 'eor-tag-paid': coreColors$1['brand-land-700'],
164
- 'eor-tag-pending': coreColors$1['brand-orange-500'],
165
- 'eor-tag-professional': coreColors$1['brand-sea-500'],
166
- 'feedback-attention': coreColors$1['brand-yellow-500'],
167
- 'feedback-informative': coreColors$1['brand-sky-700'],
168
- 'feedback-positive': coreColors$1['brand-land-700'],
169
- 'feedback-urgency': coreColors$1['brand-orange-500'],
170
- 'feedback-warning': coreColors$1['product-red-500'],
171
- 'gia-tag-risk-high': coreColors$1['product-red-500'],
172
- 'gia-tag-risk-low': coreColors$1['brand-sky-700'],
173
- 'gia-tag-risk-moderate': coreColors$1['brand-orange-500'],
174
- 'gia-text-excerpt-highlight': coreColors$1['brand-orange-100'],
175
- 'gia-text-selection': coreColors$1['brand-sea-100'],
176
- 'scroll-bar': coreColors$1['scroll-bar-light'],
177
- 'scroll-bar-hover': coreColors$1['scroll-bar-hover-light'],
178
- 'surface-shadow-soft': coreColors$1['surface-shadow-soft-light'],
179
- 'surface-shadow-strong': coreColors$1['surface-shadow-strong-light'],
180
- };
181
- const dark = {
182
- 'array-land': coreColors$1['brand-land-100'],
183
- 'array-land-label': coreColors$1['brand-land-600'],
184
- 'array-magenta': coreColors$1['brand-magenta-100'],
185
- 'array-magenta-label': coreColors$1['brand-magenta-600'],
186
- 'array-orange': coreColors$1['brand-orange-100'],
187
- 'array-orange-label': coreColors$1['brand-orange-600'],
188
- 'array-purple': coreColors$1['brand-purple-100'],
189
- 'array-purple-label': coreColors$1['brand-purple-600'],
190
- 'array-sea': coreColors$1['brand-sea-100'],
191
- 'array-sea-label': coreColors$1['brand-sea-600'],
192
- 'array-sky': coreColors$1['brand-sky-100'],
193
- 'array-sky-label': coreColors$1['brand-sky-600'],
194
- 'array-yellow': coreColors$1['brand-yellow-100'],
195
- 'array-yellow-label': coreColors$1['brand-yellow-600'],
196
- 'core-badge-primary': coreColors$1['brand-sea-500'],
197
- 'core-badge-secondary': coreColors$1['brand-grey-700'],
198
- 'core-button-disabled': coreColors$1['brand-grey-900'],
199
- 'core-button-primary': coreColors$1['brand-sea-500'],
200
- 'core-drop-shadow': coreColors$1['core-drop-shadow-dark'],
201
- 'core-gp-logo-primary': coreColors$1['brand-sea-500'],
202
- 'core-gp-logo-secondary': coreColors$1['brand-white-0'],
203
- 'core-icon-dark': coreColors$1['brand-grey-950'],
204
- 'core-icon-disabled': coreColors$1['brand-grey-500'],
205
- 'core-icon-error': coreColors$1['product-red-400'],
206
- 'core-icon-light': coreColors$1['brand-white-0'],
207
- 'core-icon-primary': coreColors$1['brand-white-0'],
208
- 'core-icon-secondary': coreColors$1['brand-grey-200'],
209
- 'core-icon-tertiary': coreColors$1['brand-sky-300'],
210
- 'core-outline-secondary': coreColors$1['brand-grey-900'],
211
- 'core-outline-primary': coreColors$1['brand-grey-700'],
212
- 'core-outline-special': coreColors$1['brand-sky-900'],
213
- 'core-outline-tertiary': coreColors$1['brand-sky-300'],
214
- 'core-surface-coverup-translucent': coreColors$1['core-surface-coverup-translucent-dark'],
215
- 'core-surface-overlay-translucent': coreColors$1['core-surface-overlay-translucent-dark'],
216
- 'core-surface-primary': coreColors$1['brand-grey-950'],
217
- 'core-surface-primary-tint': coreColors$1['surface-primary-tint-dark'],
218
- 'core-surface-secondary': coreColors$1['brand-grey-900'],
219
- 'core-surface-special': coreColors$1['brand-sky-950'],
220
- 'core-text-dark': coreColors$1['brand-grey-950'],
221
- 'core-text-disabled': coreColors$1['brand-grey-500'],
222
- 'core-text-error': coreColors$1['product-red-400'],
223
- 'core-text-light': coreColors$1['brand-white-0'],
224
- 'core-text-primary': coreColors$1['brand-white-0'],
225
- 'core-text-secondary': coreColors$1['brand-grey-200'],
226
- 'core-text-tertiary': coreColors$1['brand-grey-400'],
227
- 'core-text-special': coreColors$1['brand-sky-300'],
228
- 'core-text-accent': coreColors$1['brand-sky-300'],
229
- 'core-link-primary': coreColors$1['brand-sky-300'],
230
- 'eor-tag-employee': coreColors$1['brand-sky-700'],
231
- 'eor-tag-overdue': coreColors$1['product-red-400'],
232
- 'eor-tag-paid': coreColors$1['brand-land-700'],
233
- 'eor-tag-pending': coreColors$1['brand-orange-500'],
234
- 'eor-tag-professional': coreColors$1['brand-sea-500'],
235
- 'feedback-attention': coreColors$1['brand-yellow-400'],
236
- 'feedback-informative': coreColors$1['brand-sky-600'],
237
- 'feedback-positive': coreColors$1['brand-land-700'],
238
- 'feedback-urgency': coreColors$1['brand-orange-500'],
239
- 'feedback-warning': coreColors$1['product-red-400'],
240
- 'gia-tag-risk-high': coreColors$1['product-red-400'],
241
- 'gia-tag-risk-low': coreColors$1['brand-sky-600'],
242
- 'gia-tag-risk-moderate': coreColors$1['brand-orange-500'],
243
- 'gia-text-excerpt-highlight': coreColors$1['brand-orange-100'],
244
- 'gia-text-selection': coreColors$1['brand-sea-900'],
245
- 'scroll-bar': coreColors$1['scroll-bar-dark'],
246
- 'scroll-bar-hover': coreColors$1['scroll-bar-hover-dark'],
247
- 'surface-shadow-soft': coreColors$1['surface-shadow-soft-dark'],
248
- 'surface-shadow-strong': coreColors$1['surface-shadow-strong-dark'],
249
- };
250
-
251
- const corners = {
252
- 'corner-none': 0,
253
- 'corner-xs': 4,
254
- 'corner-s': 6,
255
- 'corner-m': 8,
256
- 'corner-l': 12,
257
- 'corner-xl': 16,
258
- 'corner-xxl': 32,
259
- 'corner-round': 1000,
260
- };
261
-
262
- /**
263
- * Elevation levels for UI component types
264
- */
265
- const elevations = {
266
- 'elevation-below-surface': -100, // items hidden from view
267
- 'elevation-surface': 0, // default
268
- 'elevation-float': 100, // toolbars, fab buttons, etc.
269
- 'elevation-describe': 200, // tooltips, info, etc.
270
- 'elevation-status': 300, // status bars, toasts, etc.
271
- 'elevation-notify': 400, // alerts, and other critical status, etc.
272
- 'elevation-overlay': 500, // overlay covers, etc.
273
- 'elevation-confirm': 600, // conformation dialogs, etc. requiring action to dismiss
274
- };
275
-
276
- /**
277
- * Motion for Slice UI
278
- */
279
- const motion$1 = {
280
- 'motion-magnet': 'cubic-bezier(0.352, 0.003, 0.993, -0.052)',
281
- 'motion-water': 'cubic-bezier(0.36, 0, 0.64, 1)',
282
- 'motion-spring': 'linear(0, 0.001 0.3%, 0.008 0.7%, 0.034 1.5%, 0.076 2.3%, 0.138 3.2%, 0.275 4.8%, 0.713 9.4%, 0.836 10.9%, 0.933 12.3%, 1.011 13.7%, 1.074 15.2%, 1.096 15.9%, 1.116 16.7%, 1.132 17.5%, 1.142 18.3%, 1.148 19.1%, 1.15 20%, 1.148 21%, 1.142 22%, 1.133 22.9%, 1.12 24%, 1.048 29.1%, 1.015 31.8%, 1.002 33.3%, 0.991 34.9%, 0.983 36.5%, 0.979 38.1%, 0.977 39.9%, 0.979 42%, 0.997 51.7%, 1.003 57.7%, 1 77%, 1)',
283
- 'motion-magnet-duration': '0.5s',
284
- 'motion-water-duration': '0.25s',
285
- 'motion-spring-duration': '1s',
286
- };
287
-
288
- const spacing = {
289
- xxs: 2,
290
- xs: 4,
291
- s: 8,
292
- m: 16,
293
- l: 24,
294
- xl: 32,
295
- xxl: 64,
296
- h: 128,
297
- };
298
-
299
- // base family
300
- const fontFamily = `var(--slice-font-family, "Funnel Sans")`;
301
- // base weights
302
- const fontWeights = {
303
- regular: 360,
304
- medium: 420,
305
- bold: 500,
306
- extra: 560,
307
- };
308
- // base sizes
309
- const fontSizes = {
310
- xs: '0.75rem',
311
- s: '0.875rem',
312
- m: '0.9375rem',
313
- l: '1rem',
314
- xl: '1.0625rem',
315
- h1: '4.25rem',
316
- h2: '3.5rem',
317
- h3: '2.75rem',
318
- h4: '2rem',
319
- h5: '1.5rem',
320
- h6: '1.0625rem',
321
- };
322
- // base line heights
323
- const lineHeights = {
324
- xs: '116.67%',
325
- m: '133.33%',
326
- l: '140%',
327
- xl: '142.86%',
328
- xxl: '162.5%',
329
- };
330
- // base letter spacing
331
- const letterSpacings = {
332
- xs: '0.00625em',
333
- s: '0.009375em',
334
- m: '0.0125em',
335
- l: '0.015625em',
336
- };
337
- // ** new styles aligned to lyra */
338
- const type$1 = {
339
- 'body-xs-regular': `
340
- font-family: ${fontFamily};
341
- font-weight: ${fontWeights.regular};
342
- font-size: ${fontSizes.xs};
343
- line-height: ${lineHeights.m};
344
- text-decoration: none;
345
- letter-spacing: ${letterSpacings.m}`,
346
- 'body-xs-medium': `
347
- font-family: ${fontFamily};
348
- font-weight: ${fontWeights.medium};
349
- font-size: ${fontSizes.xs};
350
- line-height: ${lineHeights.m};
351
- text-decoration: none;
352
- letter-spacing: ${letterSpacings.m}`,
353
- 'body-xs-bold': `
354
- font-family: ${fontFamily};
355
- font-weight: ${fontWeights.bold};
356
- font-size: ${fontSizes.xs};
357
- line-height: ${lineHeights.m};
358
- text-decoration: none;
359
- letter-spacing: ${letterSpacings.l}`,
360
- 'body-s-regular': `
361
- font-family: ${fontFamily};
362
- font-weight: ${fontWeights.regular};
363
- font-size: ${fontSizes.s};
364
- line-height: ${lineHeights.xl};
365
- text-decoration: none;
366
- letter-spacing: ${letterSpacings.s}`,
367
- 'body-s-medium': `
368
- font-family: ${fontFamily};
369
- font-weight: ${fontWeights.medium};
370
- font-size: ${fontSizes.s};
371
- line-height: ${lineHeights.xl};
372
- text-decoration: none;
373
- letter-spacing: ${letterSpacings.s}`,
374
- 'body-s-bold': `
375
- font-family: ${fontFamily};
376
- font-weight: ${fontWeights.bold};
377
- font-size: ${fontSizes.s};
378
- line-height: ${lineHeights.xl};
379
- text-decoration: none;
380
- letter-spacing: ${letterSpacings.m}`,
381
- 'body-m-regular': `
382
- font-family: ${fontFamily};
383
- font-weight: ${fontWeights.regular};
384
- font-size: ${fontSizes.m};
385
- line-height: ${lineHeights.l};
386
- text-decoration: none;
387
- letter-spacing: ${letterSpacings.s}`,
388
- 'body-m-medium': `
389
- font-family: ${fontFamily};
390
- font-weight: ${fontWeights.medium};
391
- font-size: ${fontSizes.m};
392
- line-height: ${lineHeights.l};
393
- text-decoration: none;
394
- letter-spacing: ${letterSpacings.s}`,
395
- 'body-m-bold': `
396
- font-family: ${fontFamily};
397
- font-weight: ${fontWeights.bold};
398
- font-size: ${fontSizes.m};
399
- line-height: ${lineHeights.l};
400
- text-decoration: none;
401
- letter-spacing: ${letterSpacings.m}`,
402
- 'body-l-regular': `
403
- font-family: ${fontFamily};
404
- font-weight: ${fontWeights.regular};
405
- font-size: ${fontSizes.l};
406
- line-height: ${lineHeights.xxl};
407
- text-decoration: none;
408
- letter-spacing: ${letterSpacings.xs}`,
409
- 'body-l-medium': `
410
- font-family: ${fontFamily};
411
- font-weight: ${fontWeights.medium};
412
- font-size: ${fontSizes.l};
413
- line-height: ${lineHeights.xxl};
414
- text-decoration: none;
415
- letter-spacing: ${letterSpacings.xs}`,
416
- 'body-l-bold': `
417
- font-family: ${fontFamily};
418
- font-weight: ${fontWeights.bold};
419
- font-size: ${fontSizes.l};
420
- line-height: ${lineHeights.xxl};
421
- text-decoration: none;
422
- letter-spacing: ${letterSpacings.s}`,
423
- 'body-xl-regular': `
424
- font-family: ${fontFamily};
425
- font-weight: ${fontWeights.regular};
426
- font-size: ${fontSizes.xl};
427
- line-height: ${lineHeights.xxl};
428
- text-decoration: none;
429
- letter-spacing: ${letterSpacings.xs}`,
430
- 'body-xl-medium': `
431
- font-family: ${fontFamily};
432
- font-weight: ${fontWeights.medium};
433
- font-size: ${fontSizes.xl};
434
- line-height: ${lineHeights.xxl};
435
- text-decoration: none;
436
- letter-spacing: ${letterSpacings.xs}`,
437
- 'body-xl-bold': `
438
- font-family: ${fontFamily};
439
- font-weight: ${fontWeights.bold};
440
- font-size: ${fontSizes.xl};
441
- line-height: ${lineHeights.xxl};
442
- text-decoration: none;
443
- letter-spacing: ${letterSpacings.s}`,
444
- h1: `
445
- font-family: ${fontFamily};
446
- font-weight: ${fontWeights.extra};
447
- font-size: ${fontSizes.h1};
448
- line-height: ${lineHeights.xs};
449
- letter-spacing: ${letterSpacings.m}`,
450
- h2: `
451
- font-family: ${fontFamily};
452
- font-weight: ${fontWeights.extra};
453
- font-size: ${fontSizes.h2};
454
- line-height: ${lineHeights.xs};
455
- letter-spacing: ${letterSpacings.m}`,
456
- h3: `
457
- font-family: ${fontFamily};
458
- font-weight: ${fontWeights.extra};
459
- font-size: ${fontSizes.h3};
460
- line-height: ${lineHeights.xs};
461
- letter-spacing: ${letterSpacings.m}`,
462
- h4: `
463
- font-family: ${fontFamily};
464
- font-weight: ${fontWeights.extra};
465
- font-size: ${fontSizes.h4};
466
- line-height: ${lineHeights.xs};
467
- letter-spacing: ${letterSpacings.m}`,
468
- h5: `
469
- font-family: ${fontFamily};
470
- font-weight: ${fontWeights.extra};
471
- font-size: ${fontSizes.h5};
472
- line-height: ${lineHeights.xs};
473
- letter-spacing: ${letterSpacings.m}`,
474
- h6: `
475
- font-family: ${fontFamily};
476
- font-weight: ${fontWeights.extra};
477
- font-size: ${fontSizes.h6};
478
- line-height: ${lineHeights.xs};
479
- letter-spacing: ${letterSpacings.m}`,
480
- };
481
-
482
- /** Convert Slice's explicit CSS curves without importing the React Native runtime. */
483
- function easing(css) {
484
- if (css.startsWith('cubic-bezier(')) {
485
- const [x1, y1, x2, y2] = css.slice(13, -1).split(',').map(Number);
486
- const sample = (t, a, b) => 3 * (1 - t) ** 2 * t * a + 3 * (1 - t) * t ** 2 * b + t ** 3;
487
- return (progress) => {
488
- if (progress <= 0)
489
- return 0;
490
- if (progress >= 1)
491
- return 1;
492
- let low = 0;
493
- let high = 1;
494
- for (let i = 0; i < 30; i++) {
495
- const middle = (low + high) / 2;
496
- if (sample(middle, x1, x2) < progress)
497
- low = middle;
498
- else
499
- high = middle;
500
- }
501
- return sample((low + high) / 2, y1, y2);
502
- };
503
- }
504
- if (!css.startsWith('linear('))
505
- throw new Error(`Unsupported Slice easing: ${css}`);
506
- const points = css
507
- .slice(7, -1)
508
- .split(',')
509
- .map((entry, index, entries) => {
510
- const [value, percent] = entry.trim().split(/\s+/).map(Number.parseFloat);
511
- return { value, position: percent === undefined ? index / (entries.length - 1) : percent / 100 };
512
- });
513
- return (progress) => {
514
- if (progress <= 0)
515
- return points[0].value;
516
- for (let i = 1; i < points.length; i++) {
517
- const left = points[i - 1];
518
- const right = points[i];
519
- if (progress <= right.position)
520
- return (left.value + ((right.value - left.value) * (progress - left.position)) / (right.position - left.position));
521
- }
522
- return points[points.length - 1].value;
523
- };
524
- }
3
+ var colors = require('./src/theme/colors/colors.js');
4
+ var corners = require('./src/theme/corners/corners.js');
5
+ var elevations = require('./src/theme/elevations/elevations.js');
6
+ var motion$2 = require('./src/theme/motion/motion.js');
7
+ var spacing = require('./src/theme/spacing/spacing.js');
8
+ var type$1 = require('./src/theme/type/type.js');
9
+ var motion$1 = require('./src/theme/motion.js');
525
10
 
526
- const { 'surface-shadow-soft-light': _sl, 'surface-shadow-soft-dark': _sd, 'surface-shadow-strong-light': _hl, 'surface-shadow-strong-dark': _hd, ...palette } = coreColors$1;
11
+ const { 'surface-shadow-soft-light': _sl, 'surface-shadow-soft-dark': _sd, 'surface-shadow-strong-light': _hl, 'surface-shadow-strong-dark': _hd, ...palette } = colors.coreColors;
527
12
  const coreColors = palette;
528
13
  /** Uses a 16dp base for the web rem scale. Load this font in the consuming app. */
529
14
  function createTypography(fontFamily = 'Funnel Sans') {
530
- return Object.fromEntries(Object.entries(type$1).map(([key, css]) => {
15
+ return Object.fromEntries(Object.entries(type$1.type).map(([key, css]) => {
531
16
  const read = (property) => {
532
17
  const value = css.match(new RegExp(`(?:^|;)\\s*${property}:\\s*([^;]+)`))?.[1];
533
18
  if (!value)
@@ -550,12 +35,12 @@ function createTypography(fontFamily = 'Funnel Sans') {
550
35
  }
551
36
  const type = createTypography();
552
37
  const motion = {
553
- 'motion-magnet': easing(motion$1['motion-magnet']),
554
- 'motion-water': easing(motion$1['motion-water']),
555
- 'motion-spring': easing(motion$1['motion-spring']),
556
- 'motion-magnet-duration': Number.parseFloat(motion$1['motion-magnet-duration']) * 1000,
557
- 'motion-water-duration': Number.parseFloat(motion$1['motion-water-duration']) * 1000,
558
- 'motion-spring-duration': Number.parseFloat(motion$1['motion-spring-duration']) * 1000,
38
+ 'motion-magnet': motion$1.easing(motion$2.motion['motion-magnet']),
39
+ 'motion-water': motion$1.easing(motion$2.motion['motion-water']),
40
+ 'motion-spring': motion$1.easing(motion$2.motion['motion-spring']),
41
+ 'motion-magnet-duration': Number.parseFloat(motion$2.motion['motion-magnet-duration']) * 1000,
42
+ 'motion-water-duration': Number.parseFloat(motion$2.motion['motion-water-duration']) * 1000,
43
+ 'motion-spring-duration': Number.parseFloat(motion$2.motion['motion-spring-duration']) * 1000,
559
44
  };
560
45
  function shadow(value) {
561
46
  const match = value.match(/^([\d.]+)px ([\d.]+)px ([\d.]+)px (.+)$/);
@@ -573,23 +58,23 @@ function createTheme(name, palette) {
573
58
  name,
574
59
  coreColors,
575
60
  colors,
576
- corners,
577
- spacing,
578
- elevations,
61
+ corners: corners.corners,
62
+ spacing: spacing.spacing,
63
+ elevations: elevations.elevations,
579
64
  type,
580
65
  motion,
581
66
  shadows: { 'surface-shadow-soft': shadow(soft), 'surface-shadow-strong': shadow(strong) },
582
67
  };
583
68
  }
584
- const lightTheme = createTheme('lightMode', light);
585
- const darkTheme = createTheme('darkMode', dark);
69
+ const lightTheme = createTheme('lightMode', colors.light);
70
+ const darkTheme = createTheme('darkMode', colors.dark);
586
71
 
72
+ exports.corners = corners.corners;
73
+ exports.elevations = elevations.elevations;
74
+ exports.spacing = spacing.spacing;
587
75
  exports.coreColors = coreColors;
588
- exports.corners = corners;
589
76
  exports.createTypography = createTypography;
590
77
  exports.darkTheme = darkTheme;
591
- exports.elevations = elevations;
592
78
  exports.lightTheme = lightTheme;
593
79
  exports.motion = motion;
594
- exports.spacing = spacing;
595
80
  exports.type = type;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ var typography = require('./src/utils/typography/typography.js');
4
+
5
+
6
+
7
+ exports.lineHeightTextStyle = typography.lineHeightTextStyle;
@@ -0,0 +1,5 @@
1
+ export { SliceIcon } from './src/components/SliceIcon/SliceIcon.mjs';
2
+ export { SliceIcons } from './src/components/SliceIcon/icons.mjs';
3
+ export { StyledText } from './src/components/SliceText/SliceText.mjs';
4
+ export { SliceButton } from './src/components/SliceButton/SliceButton.mjs';
5
+ export { SliceTextInput } from './src/components/SliceTextInput/SliceTextInput.mjs';
@@ -0,0 +1 @@
1
+ export { useCreateThemedStyles } from './src/hooks/useCreateThemedStyles/useCreateThemedStyles.mjs';