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