@apple-pie/slice-native 0.1.4 → 0.1.7
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 +164 -97
- package/SliceNative.podspec +24 -0
- package/dist/cjs/components.js +19 -0
- package/dist/cjs/hooks.js +9 -0
- package/dist/cjs/index.js +27 -812
- package/dist/cjs/providers.js +9 -0
- package/dist/cjs/src/components/SliceBackgroundBlur/SliceBackgroundBlur.js +11 -0
- package/dist/cjs/src/components/SliceButton/SliceButton.js +146 -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/SliceLiquidGlassView/SliceLiquidGlassView.js +12 -0
- package/dist/cjs/src/components/SliceText/SliceText.js +21 -0
- package/dist/cjs/src/components/SliceTextInput/SliceTextInput.js +117 -0
- package/dist/cjs/src/hooks/useCreateThemedStyles/useCreateThemedStyles.js +13 -0
- package/dist/cjs/src/hooks/useDeviceCapabilities/useDeviceCapabilities.js +19 -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/sizes/sizes.js +40 -0
- package/dist/cjs/src/utils/typography/typography.js +17 -0
- package/dist/cjs/theme.js +23 -538
- package/dist/cjs/utils.js +10 -0
- package/dist/esm/components.mjs +7 -0
- package/dist/esm/hooks.mjs +2 -0
- package/dist/esm/index.mjs +12 -813
- package/dist/esm/providers.mjs +1 -0
- package/dist/esm/src/components/SliceBackgroundBlur/SliceBackgroundBlur.mjs +9 -0
- package/dist/esm/src/components/SliceButton/SliceButton.mjs +144 -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/SliceLiquidGlassView/SliceLiquidGlassView.mjs +10 -0
- package/dist/esm/src/components/SliceText/SliceText.mjs +19 -0
- package/dist/esm/src/components/SliceTextInput/SliceTextInput.mjs +115 -0
- package/dist/esm/src/hooks/useCreateThemedStyles/useCreateThemedStyles.mjs +11 -0
- package/dist/esm/src/hooks/useDeviceCapabilities/useDeviceCapabilities.mjs +17 -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/sizes/sizes.mjs +37 -0
- package/dist/esm/src/utils/typography/typography.mjs +15 -0
- package/dist/esm/theme.mjs +7 -522
- package/dist/esm/utils.mjs +2 -0
- package/dist/react-native/native/src/components/SliceBackgroundBlur/SliceBackgroundBlur.js +6 -0
- package/dist/react-native/native/src/components/SliceBackgroundBlur/SliceBackgroundBlur.native.js +6 -0
- package/dist/react-native/native/src/components/SliceBackgroundBlur/_types.js +1 -0
- package/dist/react-native/native/src/components/SliceBackgroundBlur/index.js +1 -0
- package/dist/react-native/native/src/components/SliceButton/SliceButton.js +141 -0
- package/dist/react-native/native/src/components/SliceButton/_types.js +1 -0
- package/dist/react-native/native/src/components/SliceButton/index.js +1 -0
- package/dist/react-native/native/src/components/SliceIcon/SliceIcon.js +15 -0
- package/dist/react-native/native/src/components/SliceIcon/_types.js +1 -0
- package/dist/react-native/native/src/components/SliceIcon/iconRegistry.js +663 -0
- package/dist/react-native/native/src/components/SliceIcon/icons.js +140 -0
- package/dist/react-native/native/src/components/SliceIcon/index.js +2 -0
- package/dist/react-native/native/src/components/SliceLiquidGlassView/SliceLiquidGlassView.ios.js +6 -0
- package/dist/react-native/native/src/components/SliceLiquidGlassView/SliceLiquidGlassView.js +7 -0
- package/dist/react-native/native/src/components/SliceLiquidGlassView/_types.js +1 -0
- package/dist/react-native/native/src/components/SliceLiquidGlassView/index.js +1 -0
- package/dist/react-native/native/src/components/SliceText/SliceText.js +16 -0
- package/dist/react-native/native/src/components/SliceText/_types.js +1 -0
- package/dist/react-native/native/src/components/SliceText/index.js +1 -0
- package/dist/react-native/native/src/components/SliceTextInput/SliceTextInput.js +111 -0
- package/dist/react-native/native/src/components/SliceTextInput/_types.js +1 -0
- package/dist/react-native/native/src/components/SliceTextInput/index.js +1 -0
- package/dist/react-native/native/src/components/index.js +6 -0
- package/dist/react-native/native/src/hooks/index.js +2 -0
- package/dist/react-native/native/src/hooks/useCreateThemedStyles/index.js +1 -0
- package/dist/react-native/native/src/hooks/useCreateThemedStyles/useCreateThemedStyles.js +8 -0
- package/dist/react-native/native/src/hooks/useDeviceCapabilities/_types.js +1 -0
- package/dist/react-native/native/src/hooks/useDeviceCapabilities/index.js +1 -0
- package/dist/react-native/native/src/hooks/useDeviceCapabilities/useDeviceCapabilities.js +14 -0
- package/dist/react-native/native/src/hooks/useDeviceCapabilities/useDeviceCapabilities.native.js +23 -0
- package/dist/react-native/native/src/index.js +6 -0
- package/dist/react-native/native/src/providers/SliceThemeProvider.js +30 -0
- package/dist/react-native/native/src/providers/index.js +1 -0
- package/dist/react-native/native/src/specs/BackgroundBlurNativeComponent.ts +16 -0
- package/dist/react-native/native/src/specs/LiquidGlassNativeComponent.ts +18 -0
- package/dist/react-native/native/src/specs/NativeDeviceCapabilities.ts +13 -0
- package/dist/react-native/native/src/theme/index.js +69 -0
- package/dist/react-native/native/src/theme/motion.js +43 -0
- package/dist/react-native/native/src/types/index.js +1 -0
- package/dist/react-native/native/src/types/sharedTypes.js +1 -0
- package/dist/react-native/native/src/utils/index.js +2 -0
- package/dist/react-native/native/src/utils/sizes/index.js +1 -0
- package/dist/react-native/native/src/utils/sizes/sizes.js +35 -0
- package/dist/react-native/native/src/utils/typography/index.js +1 -0
- package/dist/react-native/native/src/utils/typography/typography.js +13 -0
- package/dist/react-native/src/theme/colors/colors.js +385 -0
- package/dist/react-native/src/theme/colors/types.js +1 -0
- package/dist/react-native/src/theme/corners/corners.js +10 -0
- package/dist/react-native/src/theme/corners/types.js +1 -0
- package/dist/react-native/src/theme/elevations/_types.js +1 -0
- package/dist/react-native/src/theme/elevations/elevations.js +13 -0
- package/dist/react-native/src/theme/motion/_types.js +1 -0
- package/dist/react-native/src/theme/motion/motion.js +11 -0
- package/dist/react-native/src/theme/spacing/_types.js +1 -0
- package/dist/react-native/src/theme/spacing/spacing.js +10 -0
- package/dist/react-native/src/theme/type/type.js +371 -0
- package/dist/react-native/src/theme/type/types.js +1 -0
- package/dist/types/native/src/components/SliceBackgroundBlur/SliceBackgroundBlur.d.ts +3 -0
- package/dist/types/native/src/components/SliceBackgroundBlur/SliceBackgroundBlur.native.d.ts +2 -0
- package/dist/types/native/src/components/SliceBackgroundBlur/_types.d.ts +24 -0
- package/dist/types/native/src/components/SliceBackgroundBlur/index.d.ts +2 -0
- package/dist/types/native/src/components/SliceButton/SliceButton.d.ts +5 -0
- package/dist/types/native/src/components/SliceButton/_types.d.ts +78 -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/SliceLiquidGlassView/SliceLiquidGlassView.d.ts +3 -0
- package/dist/types/native/src/components/SliceLiquidGlassView/SliceLiquidGlassView.ios.d.ts +2 -0
- package/dist/types/native/src/components/SliceLiquidGlassView/_types.d.ts +17 -0
- package/dist/types/native/src/components/SliceLiquidGlassView/index.d.ts +2 -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 +58 -0
- package/dist/types/native/src/components/SliceTextInput/index.d.ts +2 -0
- package/dist/types/native/src/components/index.d.ts +12 -0
- package/dist/types/native/src/hooks/index.d.ts +3 -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/hooks/useDeviceCapabilities/_types.d.ts +17 -0
- package/dist/types/native/src/hooks/useDeviceCapabilities/index.d.ts +2 -0
- package/dist/types/native/src/hooks/useDeviceCapabilities/useDeviceCapabilities.d.ts +3 -0
- package/dist/types/native/src/hooks/useDeviceCapabilities/useDeviceCapabilities.native.d.ts +7 -0
- package/dist/types/native/src/index.d.ts +12 -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/src/specs/BackgroundBlurNativeComponent.d.ts +9 -0
- package/dist/types/native/src/specs/LiquidGlassNativeComponent.d.ts +9 -0
- package/dist/types/native/src/specs/NativeDeviceCapabilities.d.ts +11 -0
- package/dist/types/native/{theme → src/theme}/index.d.ts +5 -5
- package/dist/types/native/src/types/index.d.ts +1 -0
- package/dist/types/native/src/types/sharedTypes.d.ts +14 -0
- package/dist/types/native/src/utils/index.d.ts +2 -0
- package/dist/types/native/src/utils/sizes/index.d.ts +1 -0
- package/dist/types/native/src/utils/sizes/sizes.d.ts +7 -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 +57 -11
- package/platform/android/build.gradle +22 -0
- package/platform/android/src/main/AndroidManifest.xml +1 -0
- package/platform/android/src/main/java/com/slice/SliceBackgroundBlurManager.java +28 -0
- package/platform/android/src/main/java/com/slice/SliceBackgroundBlurView.java +98 -0
- package/platform/android/src/main/java/com/slice/SliceDeviceCapabilitiesModule.java +25 -0
- package/platform/android/src/main/java/com/slice/SlicePackage.java +25 -0
- package/platform/ios/BackgroundBlurSurface.swift +89 -0
- package/platform/ios/LiquidGlassSurface.swift +82 -0
- package/platform/ios/RCTBackgroundBlurView.h +3 -0
- package/platform/ios/RCTBackgroundBlurView.mm +42 -0
- package/platform/ios/RCTLiquidGlassView.h +8 -0
- package/platform/ios/RCTLiquidGlassView.mm +73 -0
- package/platform/ios/SliceDeviceCapabilities.h +4 -0
- package/platform/ios/SliceDeviceCapabilities.mm +35 -0
- package/react-native.config.js +1 -0
- package/src/specs/BackgroundBlurNativeComponent.ts +16 -0
- package/src/specs/LiquidGlassNativeComponent.ts +18 -0
- package/src/specs/NativeDeviceCapabilities.ts +13 -0
- 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/index.d.ts +0 -4
- /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
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
// base family
|
|
2
|
+
const fontFamily = `var(--slice-font-family, "Funnel Sans")`;
|
|
3
|
+
// base weights
|
|
4
|
+
export const fontWeights = {
|
|
5
|
+
regular: 360,
|
|
6
|
+
medium: 420,
|
|
7
|
+
semi: 480,
|
|
8
|
+
bold: 500,
|
|
9
|
+
extra: 560,
|
|
10
|
+
};
|
|
11
|
+
// base sizes
|
|
12
|
+
export const fontSizes = {
|
|
13
|
+
xs: '0.75rem',
|
|
14
|
+
s: '0.875rem',
|
|
15
|
+
m: '0.9375rem',
|
|
16
|
+
l: '1rem',
|
|
17
|
+
xl: '1.0625rem',
|
|
18
|
+
h1: '4.25rem',
|
|
19
|
+
h2: '3.5rem',
|
|
20
|
+
h3: '2.75rem',
|
|
21
|
+
h4: '2rem',
|
|
22
|
+
h5: '1.5rem',
|
|
23
|
+
h6: '1.0625rem',
|
|
24
|
+
};
|
|
25
|
+
// base line heights
|
|
26
|
+
export const lineHeights = {
|
|
27
|
+
xs: '116.67%',
|
|
28
|
+
s: '128.57%',
|
|
29
|
+
m: '133.33%',
|
|
30
|
+
l: '140%',
|
|
31
|
+
xl: '142.86%',
|
|
32
|
+
xxl: '162.5%',
|
|
33
|
+
};
|
|
34
|
+
// base letter spacing
|
|
35
|
+
export const letterSpacings = {
|
|
36
|
+
xs: '0.00625em',
|
|
37
|
+
s: '0.009375em',
|
|
38
|
+
m: '0.0125em',
|
|
39
|
+
l: '0.015625em',
|
|
40
|
+
};
|
|
41
|
+
// ** new styles aligned to lyra */
|
|
42
|
+
export const type = {
|
|
43
|
+
'body-xs-regular': `
|
|
44
|
+
font-family: ${fontFamily};
|
|
45
|
+
font-weight: ${fontWeights.regular};
|
|
46
|
+
font-size: ${fontSizes.xs};
|
|
47
|
+
line-height: ${lineHeights.m};
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
50
|
+
'body-xs-medium': `
|
|
51
|
+
font-family: ${fontFamily};
|
|
52
|
+
font-weight: ${fontWeights.medium};
|
|
53
|
+
font-size: ${fontSizes.xs};
|
|
54
|
+
line-height: ${lineHeights.m};
|
|
55
|
+
text-decoration: none;
|
|
56
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
57
|
+
'body-xs-bold': `
|
|
58
|
+
font-family: ${fontFamily};
|
|
59
|
+
font-weight: ${fontWeights.bold};
|
|
60
|
+
font-size: ${fontSizes.xs};
|
|
61
|
+
line-height: ${lineHeights.m};
|
|
62
|
+
text-decoration: none;
|
|
63
|
+
letter-spacing: ${letterSpacings.l}`,
|
|
64
|
+
'body-s-regular': `
|
|
65
|
+
font-family: ${fontFamily};
|
|
66
|
+
font-weight: ${fontWeights.regular};
|
|
67
|
+
font-size: ${fontSizes.s};
|
|
68
|
+
line-height: ${lineHeights.xl};
|
|
69
|
+
text-decoration: none;
|
|
70
|
+
letter-spacing: ${letterSpacings.s}`,
|
|
71
|
+
'body-s-medium': `
|
|
72
|
+
font-family: ${fontFamily};
|
|
73
|
+
font-weight: ${fontWeights.medium};
|
|
74
|
+
font-size: ${fontSizes.s};
|
|
75
|
+
line-height: ${lineHeights.xl};
|
|
76
|
+
text-decoration: none;
|
|
77
|
+
letter-spacing: ${letterSpacings.s}`,
|
|
78
|
+
'body-s-bold': `
|
|
79
|
+
font-family: ${fontFamily};
|
|
80
|
+
font-weight: ${fontWeights.bold};
|
|
81
|
+
font-size: ${fontSizes.s};
|
|
82
|
+
line-height: ${lineHeights.xl};
|
|
83
|
+
text-decoration: none;
|
|
84
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
85
|
+
'body-m-regular': `
|
|
86
|
+
font-family: ${fontFamily};
|
|
87
|
+
font-weight: ${fontWeights.regular};
|
|
88
|
+
font-size: ${fontSizes.m};
|
|
89
|
+
line-height: ${lineHeights.l};
|
|
90
|
+
text-decoration: none;
|
|
91
|
+
letter-spacing: ${letterSpacings.s}`,
|
|
92
|
+
'body-m-medium': `
|
|
93
|
+
font-family: ${fontFamily};
|
|
94
|
+
font-weight: ${fontWeights.medium};
|
|
95
|
+
font-size: ${fontSizes.m};
|
|
96
|
+
line-height: ${lineHeights.l};
|
|
97
|
+
text-decoration: none;
|
|
98
|
+
letter-spacing: ${letterSpacings.s}`,
|
|
99
|
+
'body-m-bold': `
|
|
100
|
+
font-family: ${fontFamily};
|
|
101
|
+
font-weight: ${fontWeights.bold};
|
|
102
|
+
font-size: ${fontSizes.m};
|
|
103
|
+
line-height: ${lineHeights.l};
|
|
104
|
+
text-decoration: none;
|
|
105
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
106
|
+
'body-l-regular': `
|
|
107
|
+
font-family: ${fontFamily};
|
|
108
|
+
font-weight: ${fontWeights.regular};
|
|
109
|
+
font-size: ${fontSizes.l};
|
|
110
|
+
line-height: ${lineHeights.xxl};
|
|
111
|
+
text-decoration: none;
|
|
112
|
+
letter-spacing: ${letterSpacings.xs}`,
|
|
113
|
+
'body-l-medium': `
|
|
114
|
+
font-family: ${fontFamily};
|
|
115
|
+
font-weight: ${fontWeights.medium};
|
|
116
|
+
font-size: ${fontSizes.l};
|
|
117
|
+
line-height: ${lineHeights.xxl};
|
|
118
|
+
text-decoration: none;
|
|
119
|
+
letter-spacing: ${letterSpacings.xs}`,
|
|
120
|
+
'body-l-bold': `
|
|
121
|
+
font-family: ${fontFamily};
|
|
122
|
+
font-weight: ${fontWeights.bold};
|
|
123
|
+
font-size: ${fontSizes.l};
|
|
124
|
+
line-height: ${lineHeights.xxl};
|
|
125
|
+
text-decoration: none;
|
|
126
|
+
letter-spacing: ${letterSpacings.s}`,
|
|
127
|
+
'body-xl-regular': `
|
|
128
|
+
font-family: ${fontFamily};
|
|
129
|
+
font-weight: ${fontWeights.regular};
|
|
130
|
+
font-size: ${fontSizes.xl};
|
|
131
|
+
line-height: ${lineHeights.xxl};
|
|
132
|
+
text-decoration: none;
|
|
133
|
+
letter-spacing: ${letterSpacings.xs}`,
|
|
134
|
+
'body-xl-medium': `
|
|
135
|
+
font-family: ${fontFamily};
|
|
136
|
+
font-weight: ${fontWeights.medium};
|
|
137
|
+
font-size: ${fontSizes.xl};
|
|
138
|
+
line-height: ${lineHeights.xxl};
|
|
139
|
+
text-decoration: none;
|
|
140
|
+
letter-spacing: ${letterSpacings.xs}`,
|
|
141
|
+
'body-xl-bold': `
|
|
142
|
+
font-family: ${fontFamily};
|
|
143
|
+
font-weight: ${fontWeights.bold};
|
|
144
|
+
font-size: ${fontSizes.xl};
|
|
145
|
+
line-height: ${lineHeights.xxl};
|
|
146
|
+
text-decoration: none;
|
|
147
|
+
letter-spacing: ${letterSpacings.s}`,
|
|
148
|
+
h1: `
|
|
149
|
+
font-family: ${fontFamily};
|
|
150
|
+
font-weight: ${fontWeights.extra};
|
|
151
|
+
font-size: ${fontSizes.h1};
|
|
152
|
+
line-height: ${lineHeights.xs};
|
|
153
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
154
|
+
h2: `
|
|
155
|
+
font-family: ${fontFamily};
|
|
156
|
+
font-weight: ${fontWeights.extra};
|
|
157
|
+
font-size: ${fontSizes.h2};
|
|
158
|
+
line-height: ${lineHeights.xs};
|
|
159
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
160
|
+
h3: `
|
|
161
|
+
font-family: ${fontFamily};
|
|
162
|
+
font-weight: ${fontWeights.extra};
|
|
163
|
+
font-size: ${fontSizes.h3};
|
|
164
|
+
line-height: ${lineHeights.xs};
|
|
165
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
166
|
+
h4: `
|
|
167
|
+
font-family: ${fontFamily};
|
|
168
|
+
font-weight: ${fontWeights.extra};
|
|
169
|
+
font-size: ${fontSizes.h4};
|
|
170
|
+
line-height: ${lineHeights.xs};
|
|
171
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
172
|
+
h5: `
|
|
173
|
+
font-family: ${fontFamily};
|
|
174
|
+
font-weight: ${fontWeights.extra};
|
|
175
|
+
font-size: ${fontSizes.h5};
|
|
176
|
+
line-height: ${lineHeights.xs};
|
|
177
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
178
|
+
h6: `
|
|
179
|
+
font-family: ${fontFamily};
|
|
180
|
+
font-weight: ${fontWeights.extra};
|
|
181
|
+
font-size: ${fontSizes.h6};
|
|
182
|
+
line-height: ${lineHeights.xs};
|
|
183
|
+
letter-spacing: ${letterSpacings.m}`,
|
|
184
|
+
};
|
|
185
|
+
export const typeCssClasses = {
|
|
186
|
+
'body-xs-regular': 'body-xs-regular',
|
|
187
|
+
'body-xs-medium': 'body-xs-medium',
|
|
188
|
+
'body-xs-bold': 'body-xs-bold',
|
|
189
|
+
'body-s-regular': 'body-s-regular',
|
|
190
|
+
'body-s-medium': 'body-s-medium',
|
|
191
|
+
'body-s-bold': 'body-s-bold',
|
|
192
|
+
'body-m-regular': 'body-m-regular',
|
|
193
|
+
'body-m-medium': 'body-m-medium',
|
|
194
|
+
'body-m-bold': 'body-m-bold',
|
|
195
|
+
'body-l-regular': 'body-l-regular',
|
|
196
|
+
'body-l-medium': 'body-l-medium',
|
|
197
|
+
'body-l-bold': 'body-l-bold',
|
|
198
|
+
'body-xl-regular': 'body-xl-regular',
|
|
199
|
+
'body-xl-medium': 'body-xl-medium',
|
|
200
|
+
'body-xl-bold': 'body-xl-bold',
|
|
201
|
+
h1: 'h1',
|
|
202
|
+
h2: 'h2',
|
|
203
|
+
h3: 'h3',
|
|
204
|
+
h4: 'h4',
|
|
205
|
+
h5: 'h5',
|
|
206
|
+
h6: 'h6',
|
|
207
|
+
};
|
|
208
|
+
export const typeStyles = {
|
|
209
|
+
'body-xs-regular': {
|
|
210
|
+
fontFamily: `${fontFamily}`,
|
|
211
|
+
fontWeight: `${fontWeights.regular}`,
|
|
212
|
+
fontSize: `${fontSizes.xs}`,
|
|
213
|
+
lineHeight: `${lineHeights.m}`,
|
|
214
|
+
textDecoration: 'none',
|
|
215
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
216
|
+
},
|
|
217
|
+
'body-xs-medium': {
|
|
218
|
+
fontFamily: `${fontFamily}`,
|
|
219
|
+
fontWeight: `${fontWeights.medium}`,
|
|
220
|
+
fontSize: `${fontSizes.xs}`,
|
|
221
|
+
lineHeight: `${lineHeights.m}`,
|
|
222
|
+
textDecoration: 'none',
|
|
223
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
224
|
+
},
|
|
225
|
+
'body-xs-bold': {
|
|
226
|
+
fontFamily: `${fontFamily}`,
|
|
227
|
+
fontWeight: `${fontWeights.bold}`,
|
|
228
|
+
fontSize: `${fontSizes.xs}`,
|
|
229
|
+
lineHeight: `${lineHeights.m}`,
|
|
230
|
+
textDecoration: 'none',
|
|
231
|
+
letterSpacing: `${letterSpacings.l}`,
|
|
232
|
+
},
|
|
233
|
+
'body-s-regular': {
|
|
234
|
+
fontFamily: `${fontFamily}`,
|
|
235
|
+
fontWeight: `${fontWeights.regular}`,
|
|
236
|
+
fontSize: `${fontSizes.s}`,
|
|
237
|
+
lineHeight: `${lineHeights.xl}`,
|
|
238
|
+
textDecoration: 'none',
|
|
239
|
+
letterSpacing: `${letterSpacings.s}`,
|
|
240
|
+
},
|
|
241
|
+
'body-s-medium': {
|
|
242
|
+
fontFamily: `${fontFamily}`,
|
|
243
|
+
fontWeight: `${fontWeights.medium}`,
|
|
244
|
+
fontSize: `${fontSizes.s}`,
|
|
245
|
+
lineHeight: `${lineHeights.xl}`,
|
|
246
|
+
textDecoration: 'none',
|
|
247
|
+
letterSpacing: `${letterSpacings.s}`,
|
|
248
|
+
},
|
|
249
|
+
'body-s-bold': {
|
|
250
|
+
fontFamily: `${fontFamily}`,
|
|
251
|
+
fontWeight: `${fontWeights.bold}`,
|
|
252
|
+
fontSize: `${fontSizes.s}`,
|
|
253
|
+
lineHeight: `${lineHeights.xl}`,
|
|
254
|
+
textDecoration: 'none',
|
|
255
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
256
|
+
},
|
|
257
|
+
'body-m-regular': {
|
|
258
|
+
fontFamily: `${fontFamily}`,
|
|
259
|
+
fontWeight: `${fontWeights.regular}`,
|
|
260
|
+
fontSize: `${fontSizes.m}`,
|
|
261
|
+
lineHeight: `${lineHeights.l}`,
|
|
262
|
+
textDecoration: 'none',
|
|
263
|
+
letterSpacing: `${letterSpacings.s}`,
|
|
264
|
+
},
|
|
265
|
+
'body-m-medium': {
|
|
266
|
+
fontFamily: `${fontFamily}`,
|
|
267
|
+
fontWeight: `${fontWeights.medium}`,
|
|
268
|
+
fontSize: `${fontSizes.m}`,
|
|
269
|
+
lineHeight: `${lineHeights.l}`,
|
|
270
|
+
textDecoration: 'none',
|
|
271
|
+
letterSpacing: `${letterSpacings.s}`,
|
|
272
|
+
},
|
|
273
|
+
'body-m-bold': {
|
|
274
|
+
fontFamily: `${fontFamily}`,
|
|
275
|
+
fontWeight: `${fontWeights.bold}`,
|
|
276
|
+
fontSize: `${fontSizes.m}`,
|
|
277
|
+
lineHeight: `${lineHeights.l}`,
|
|
278
|
+
textDecoration: 'none',
|
|
279
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
280
|
+
},
|
|
281
|
+
'body-l-regular': {
|
|
282
|
+
fontFamily: `${fontFamily}`,
|
|
283
|
+
fontWeight: `${fontWeights.regular}`,
|
|
284
|
+
fontSize: `${fontSizes.l}`,
|
|
285
|
+
lineHeight: `${lineHeights.xxl}`,
|
|
286
|
+
textDecoration: 'none',
|
|
287
|
+
letterSpacing: `${letterSpacings.xs}`,
|
|
288
|
+
},
|
|
289
|
+
'body-l-medium': {
|
|
290
|
+
fontFamily: `${fontFamily}`,
|
|
291
|
+
fontWeight: `${fontWeights.medium}`,
|
|
292
|
+
fontSize: `${fontSizes.l}`,
|
|
293
|
+
lineHeight: `${lineHeights.xxl}`,
|
|
294
|
+
textDecoration: 'none',
|
|
295
|
+
letterSpacing: `${letterSpacings.xs}`,
|
|
296
|
+
},
|
|
297
|
+
'body-l-bold': {
|
|
298
|
+
fontFamily: `${fontFamily}`,
|
|
299
|
+
fontWeight: `${fontWeights.bold}`,
|
|
300
|
+
fontSize: `${fontSizes.l}`,
|
|
301
|
+
lineHeight: `${lineHeights.xxl}`,
|
|
302
|
+
textDecoration: 'none',
|
|
303
|
+
letterSpacing: `${letterSpacings.s}`,
|
|
304
|
+
},
|
|
305
|
+
'body-xl-regular': {
|
|
306
|
+
fontFamily: `${fontFamily}`,
|
|
307
|
+
fontWeight: `${fontWeights.regular}`,
|
|
308
|
+
fontSize: `${fontSizes.xl}`,
|
|
309
|
+
lineHeight: `${lineHeights.xxl}`,
|
|
310
|
+
textDecoration: 'none',
|
|
311
|
+
letterSpacing: `${letterSpacings.xs}`,
|
|
312
|
+
},
|
|
313
|
+
'body-xl-medium': {
|
|
314
|
+
fontFamily: `${fontFamily}`,
|
|
315
|
+
fontWeight: `${fontWeights.medium}`,
|
|
316
|
+
fontSize: `${fontSizes.xl}`,
|
|
317
|
+
lineHeight: `${lineHeights.xxl}`,
|
|
318
|
+
textDecoration: 'none',
|
|
319
|
+
letterSpacing: `${letterSpacings.xs}`,
|
|
320
|
+
},
|
|
321
|
+
'body-xl-bold': {
|
|
322
|
+
fontFamily: `${fontFamily}`,
|
|
323
|
+
fontWeight: `${fontWeights.bold}`,
|
|
324
|
+
fontSize: `${fontSizes.xl}`,
|
|
325
|
+
lineHeight: `${lineHeights.xxl}`,
|
|
326
|
+
textDecoration: 'none',
|
|
327
|
+
letterSpacing: `${letterSpacings.s}`,
|
|
328
|
+
},
|
|
329
|
+
h1: {
|
|
330
|
+
fontFamily: `${fontFamily}`,
|
|
331
|
+
fontWeight: `${fontWeights.extra}`,
|
|
332
|
+
fontSize: `${fontSizes.h1}`,
|
|
333
|
+
lineHeight: `${lineHeights.xs}`,
|
|
334
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
335
|
+
},
|
|
336
|
+
h2: {
|
|
337
|
+
fontFamily: `${fontFamily}`,
|
|
338
|
+
fontWeight: `${fontWeights.extra}`,
|
|
339
|
+
fontSize: `${fontSizes.h2}`,
|
|
340
|
+
lineHeight: `${lineHeights.xs}`,
|
|
341
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
342
|
+
},
|
|
343
|
+
h3: {
|
|
344
|
+
fontFamily: `${fontFamily}`,
|
|
345
|
+
fontWeight: `${fontWeights.extra}`,
|
|
346
|
+
fontSize: `${fontSizes.h3}`,
|
|
347
|
+
lineHeight: `${lineHeights.xs}`,
|
|
348
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
349
|
+
},
|
|
350
|
+
h4: {
|
|
351
|
+
fontFamily: `${fontFamily}`,
|
|
352
|
+
fontWeight: `${fontWeights.extra}`,
|
|
353
|
+
fontSize: `${fontSizes.h4}`,
|
|
354
|
+
lineHeight: `${lineHeights.xs}`,
|
|
355
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
356
|
+
},
|
|
357
|
+
h5: {
|
|
358
|
+
fontFamily: `${fontFamily}`,
|
|
359
|
+
fontWeight: `${fontWeights.extra}`,
|
|
360
|
+
fontSize: `${fontSizes.h5}`,
|
|
361
|
+
lineHeight: `${lineHeights.xs}`,
|
|
362
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
363
|
+
},
|
|
364
|
+
h6: {
|
|
365
|
+
fontFamily: `${fontFamily}`,
|
|
366
|
+
fontWeight: `${fontWeights.extra}`,
|
|
367
|
+
fontSize: `${fontSizes.h6}`,
|
|
368
|
+
lineHeight: `${lineHeights.xs}`,
|
|
369
|
+
letterSpacing: `${letterSpacings.m}`,
|
|
370
|
+
},
|
|
371
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SliceBackgroundBlurProps } from './_types';
|
|
2
|
+
/** Web/other-platform fallback. Metro selects the native implementation on iOS/Android. */
|
|
3
|
+
export declare function SliceBackgroundBlur({ style, fallbackColor, }: Readonly<SliceBackgroundBlurProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ColorValue, StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
export interface SliceBackgroundBlurProps {
|
|
3
|
+
/**
|
|
4
|
+
* iOS only: direction from transparent to fully blurred. Defaults to 'down'.
|
|
5
|
+
* down: top to bottom; up: bottom to top;
|
|
6
|
+
* left: right to left; right: left to right.
|
|
7
|
+
*/
|
|
8
|
+
direction?: 'down' | 'up' | 'left' | 'right';
|
|
9
|
+
/**
|
|
10
|
+
* iOS only: fraction of the view over which blur fades in (0–1).
|
|
11
|
+
* Defaults to 0, which renders uniform blur without a mask.
|
|
12
|
+
*/
|
|
13
|
+
fadeStop?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The intensity of the background blur effect. Defaults to 12
|
|
16
|
+
*/
|
|
17
|
+
blurIntensity?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Attach styles to the background view as View Style
|
|
20
|
+
*/
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
/** Color used when native blur is unavailable or Reduce Transparency is enabled. */
|
|
23
|
+
fallbackColor?: ColorValue;
|
|
24
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import type { ColorValue, PressableProps } from 'react-native';
|
|
3
|
+
import type Reanimated from 'react-native-reanimated';
|
|
4
|
+
import type { BorderRadius, LiquidGlassBackground, Size } from '../../types/sharedTypes';
|
|
5
|
+
type AnimatedViewProps = ComponentProps<typeof Reanimated.View>;
|
|
6
|
+
export interface SliceButtonProps extends Omit<PressableProps, 'children' | 'style'> {
|
|
7
|
+
/**
|
|
8
|
+
* Element(s) to display on the button, typically just text
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Button disabled state
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Pass through GestureResponderEvent when pressed
|
|
17
|
+
*/
|
|
18
|
+
onPress?: PressableProps['onPress'];
|
|
19
|
+
/**
|
|
20
|
+
* Name of the button icon if any
|
|
21
|
+
*/
|
|
22
|
+
icon?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Icon position can be left / right or undefined
|
|
25
|
+
*/
|
|
26
|
+
iconPosition?: 'left' | 'right';
|
|
27
|
+
/**
|
|
28
|
+
* Icon size
|
|
29
|
+
*/
|
|
30
|
+
iconSize?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Add an emphasis animation to the button
|
|
33
|
+
*/
|
|
34
|
+
animatedStyle?: AnimatedViewProps['style'];
|
|
35
|
+
/**
|
|
36
|
+
* Primary or secondary type button
|
|
37
|
+
*/
|
|
38
|
+
variant?: 'primary' | 'secondary';
|
|
39
|
+
/**
|
|
40
|
+
* Predefined sizes that can be overriden with a numeric value
|
|
41
|
+
*/
|
|
42
|
+
size?: Size;
|
|
43
|
+
/**
|
|
44
|
+
* Button transitions and animations
|
|
45
|
+
*/
|
|
46
|
+
presence?: {
|
|
47
|
+
entering?: AnimatedViewProps['entering'];
|
|
48
|
+
exiting?: AnimatedViewProps['exiting'];
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Enable layout animation definition for button layout changes
|
|
52
|
+
*/
|
|
53
|
+
layout?: AnimatedViewProps['layout'];
|
|
54
|
+
/**
|
|
55
|
+
* Enable liquid glass background. Will only work on ios26+ with a fallback for
|
|
56
|
+
* non-supported devices
|
|
57
|
+
*/
|
|
58
|
+
liquidGlassBackground?: LiquidGlassBackground;
|
|
59
|
+
/**
|
|
60
|
+
* Define a default border radius name or amount
|
|
61
|
+
*/
|
|
62
|
+
borderRadius?: BorderRadius;
|
|
63
|
+
/**
|
|
64
|
+
* Border width in points. Negative/non-finite values become 0.
|
|
65
|
+
* Defaults to 0 for primary buttons and 1 for secondary buttons.
|
|
66
|
+
*/
|
|
67
|
+
borderWidth?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Border color. Defaults to the theme’s core-outline-secondary color.
|
|
70
|
+
*/
|
|
71
|
+
borderColor?: ColorValue;
|
|
72
|
+
/**
|
|
73
|
+
* Solid background override, ignored while supported Liquid Glass is active.
|
|
74
|
+
* Disabled solid buttons use the disabled theme background.
|
|
75
|
+
*/
|
|
76
|
+
backgroundColor?: ColorValue;
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentRef, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react';
|
|
2
|
+
import type { ColorValue, View, ViewProps } from 'react-native';
|
|
3
|
+
export type SliceLiquidGlassViewComponent = ForwardRefExoticComponent<PropsWithoutRef<SliceLiquidGlassViewProps> & RefAttributes<ComponentRef<typeof View>>>;
|
|
4
|
+
export interface SliceLiquidGlassViewProps extends ViewProps {
|
|
5
|
+
/** Custom glass child mounting does not support React Native's subview culling. */
|
|
6
|
+
removeClippedSubviews?: false;
|
|
7
|
+
/** Native iOS 26+ material. Defaults to regular. */
|
|
8
|
+
glassStyle?: 'regular' | 'clear';
|
|
9
|
+
/** Tint for the native glass material; does not change content opacity. */
|
|
10
|
+
glassTintColor?: ColorValue;
|
|
11
|
+
/** Enables native glass interaction feedback; use Pressable for actions. */
|
|
12
|
+
interactive?: boolean;
|
|
13
|
+
/** Uniform radius in points. Defaults to 24. Use this instead of style.borderRadius. */
|
|
14
|
+
cornerRadius?: number;
|
|
15
|
+
/** Background used on Android/web. Older iOS uses system blur. */
|
|
16
|
+
fallbackColor?: ColorValue;
|
|
17
|
+
}
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ColorValue, TextInputProps } from 'react-native';
|
|
2
|
+
import type { BaseAnimationBuilder, LayoutAnimationFunction } from 'react-native-reanimated';
|
|
3
|
+
import type { BorderRadius, Size } from '../../types/sharedTypes';
|
|
4
|
+
export interface SliceTextInputProps extends TextInputProps {
|
|
5
|
+
/**
|
|
6
|
+
* emits directive focus event
|
|
7
|
+
*/
|
|
8
|
+
didFocus?: (focused: boolean) => void;
|
|
9
|
+
/**
|
|
10
|
+
* enables applying animations when the input layout changes using reanimated layout functions
|
|
11
|
+
*/
|
|
12
|
+
layout?: typeof BaseAnimationBuilder | BaseAnimationBuilder | LayoutAnimationFunction;
|
|
13
|
+
/**
|
|
14
|
+
* When true, blur clears the input and calls onChangeText with an empty string. Default: false.
|
|
15
|
+
*/
|
|
16
|
+
blurClears?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Adds a slice icon to the start of the input field
|
|
19
|
+
*/
|
|
20
|
+
icon?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optionally define the icon color
|
|
23
|
+
*/
|
|
24
|
+
iconColor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optionally define the icon size
|
|
27
|
+
*/
|
|
28
|
+
iconSize?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Optionally hide icon when input is focused - default = true
|
|
31
|
+
*/
|
|
32
|
+
hideIconOnFocus?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Expose a way to set focus on input from external events
|
|
35
|
+
*/
|
|
36
|
+
focused?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Element size in terms of height
|
|
39
|
+
*/
|
|
40
|
+
size?: Size;
|
|
41
|
+
/**
|
|
42
|
+
* Define a default border radius name or amount
|
|
43
|
+
*/
|
|
44
|
+
borderRadius?: BorderRadius;
|
|
45
|
+
/**
|
|
46
|
+
* Border width in points. Negative/non-finite values become 0.
|
|
47
|
+
* Defaults to 1.
|
|
48
|
+
*/
|
|
49
|
+
borderWidth?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Border color. Defaults to the theme’s core-outline-secondary color.
|
|
52
|
+
*/
|
|
53
|
+
borderColor?: ColorValue;
|
|
54
|
+
/**
|
|
55
|
+
* Optional background color override
|
|
56
|
+
*/
|
|
57
|
+
backgroundColor?: ColorValue;
|
|
58
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { SliceIcon, SliceIcons } from './SliceIcon';
|
|
2
|
+
export type { IconProps, SliceIconProps } from './SliceIcon';
|
|
3
|
+
export { StyledText } from './SliceText';
|
|
4
|
+
export type { StyledTextProps } from './SliceText';
|
|
5
|
+
export { SliceButton } from './SliceButton';
|
|
6
|
+
export type { SliceButtonProps } from './SliceButton';
|
|
7
|
+
export { SliceTextInput } from './SliceTextInput';
|
|
8
|
+
export type { SliceTextInputProps } from './SliceTextInput';
|
|
9
|
+
export { SliceLiquidGlassView } from './SliceLiquidGlassView';
|
|
10
|
+
export type { SliceLiquidGlassViewProps } from './SliceLiquidGlassView';
|
|
11
|
+
export { SliceBackgroundBlur } from './SliceBackgroundBlur';
|
|
12
|
+
export type { SliceBackgroundBlurProps } from './SliceBackgroundBlur';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useCreateThemedStyles } from './useCreateThemedStyles';
|