@flipova/foundation 1.13.0 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +181 -0
- package/README.md +53 -178
- package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +162 -0
- package/components/ui/accordion/AccordionAnimatedHeight.tsx +56 -0
- package/components/ui/accordion/AccordionAnimatedIcon.tsx +41 -0
- package/components/ui/accordion/AnimatedHeight.tsx +56 -0
- package/components/ui/accordion/AnimatedIcon.tsx +41 -0
- package/components/ui/accordion/MIGRATION_SUMMARY.md +250 -0
- package/components/ui/accordion/USAGE_EXAMPLE.tsx +179 -0
- package/components/ui/accordion/animation-config.ts +32 -0
- package/components/ui/accordion/index.tsx +253 -0
- package/components/ui/actionsheet/index.tsx +511 -0
- package/components/ui/alert/index.tsx +158 -0
- package/components/ui/alert-dialog/index.tsx +254 -0
- package/components/ui/avatar/index.tsx +139 -0
- package/components/ui/badge/index.tsx +163 -0
- package/components/ui/bottomsheet/index.tsx +477 -0
- package/components/ui/box/index.tsx +19 -0
- package/components/ui/box/index.web.tsx +19 -0
- package/components/ui/box/styles.tsx +10 -0
- package/components/ui/button/index.tsx +264 -0
- package/components/ui/calendar/creator.tsx +366 -0
- package/components/ui/calendar/index.tsx +462 -0
- package/components/ui/calendar/styles.tsx +140 -0
- package/components/ui/card/index.tsx +23 -0
- package/components/ui/card/index.web.tsx +26 -0
- package/components/ui/card/styles.tsx +16 -0
- package/components/ui/center/index.tsx +22 -0
- package/components/ui/center/index.web.tsx +20 -0
- package/components/ui/center/styles.tsx +8 -0
- package/components/ui/checkbox/index.tsx +184 -0
- package/components/ui/date-time-picker/creator.tsx +109 -0
- package/components/ui/date-time-picker/index.tsx +585 -0
- package/components/ui/date-time-picker/index.web.tsx +217 -0
- package/components/ui/date-time-picker/styles.tsx +56 -0
- package/components/ui/divider/index.tsx +40 -0
- package/components/ui/drawer/index.tsx +362 -0
- package/components/ui/fab/index.tsx +215 -0
- package/components/ui/flat-list/index.tsx +21 -0
- package/components/ui/form-control/index.tsx +352 -0
- package/components/ui/gluestack-ui-provider/config.ts +72 -0
- package/components/ui/gluestack-ui-provider/index.tsx +47 -0
- package/components/ui/gluestack-ui-provider/index.web.tsx +96 -0
- package/components/ui/gluestack-ui-provider/script.ts +19 -0
- package/components/ui/gluestack-ui-provider/tokens.d.ts +17 -0
- package/components/ui/gluestack-ui-provider/tokens.js +188 -0
- package/components/ui/gluestack-ui-provider/useGluestackColors.ts +82 -0
- package/components/ui/grid/index.tsx +283 -0
- package/components/ui/grid/index.web.tsx +66 -0
- package/components/ui/grid/styles.tsx +15 -0
- package/components/ui/heading/index.tsx +220 -0
- package/components/ui/heading/index.web.tsx +202 -0
- package/components/ui/heading/styles.tsx +43 -0
- package/components/ui/hstack/index.tsx +27 -0
- package/components/ui/hstack/index.web.tsx +26 -0
- package/components/ui/hstack/styles.tsx +25 -0
- package/components/ui/icon/index.tsx +1588 -0
- package/components/ui/icon/index.web.tsx +1573 -0
- package/components/ui/image/index.tsx +48 -0
- package/components/ui/image-background/index.tsx +25 -0
- package/components/ui/image-viewer/index.tsx +743 -0
- package/components/ui/image-viewer/index.web.tsx +302 -0
- package/components/ui/index.ts +58 -0
- package/components/ui/input/index.tsx +125 -0
- package/components/ui/input-accessory-view/index.tsx +2 -0
- package/components/ui/keyboard-avoiding-view/index.tsx +2 -0
- package/components/ui/link/index.tsx +102 -0
- package/components/ui/liquid-glass/index.tsx +74 -0
- package/components/ui/menu/index.tsx +186 -0
- package/components/ui/modal/index.tsx +237 -0
- package/components/ui/popover/index.tsx +272 -0
- package/components/ui/portal/index.tsx +17 -0
- package/components/ui/pressable/index.tsx +39 -0
- package/components/ui/progress/index.tsx +83 -0
- package/components/ui/radio/index.tsx +217 -0
- package/components/ui/refresh-control/index.tsx +2 -0
- package/components/ui/safe-area-view/index.tsx +2 -0
- package/components/ui/scroll-view/index.tsx +2 -0
- package/components/ui/section-list/index.tsx +2 -0
- package/components/ui/select/index.tsx +277 -0
- package/components/ui/select/select-actionsheet.tsx +562 -0
- package/components/ui/skeleton/index.tsx +105 -0
- package/components/ui/skeleton/index.web.tsx +103 -0
- package/components/ui/skeleton/styles.tsx +35 -0
- package/components/ui/slider/index.tsx +181 -0
- package/components/ui/spinner/index.tsx +40 -0
- package/components/ui/status-bar/index.tsx +2 -0
- package/components/ui/switch/index.tsx +41 -0
- package/components/ui/table/index.tsx +210 -0
- package/components/ui/table/index.web.tsx +157 -0
- package/components/ui/table/styles.tsx +44 -0
- package/components/ui/tabs/TabsAnimatedIndicator.tsx +160 -0
- package/components/ui/tabs/animation-config.ts +3 -0
- package/components/ui/tabs/creator.tsx +206 -0
- package/components/ui/tabs/index.tsx +484 -0
- package/components/ui/text/index.tsx +48 -0
- package/components/ui/text/index.web.tsx +45 -0
- package/components/ui/text/styles.tsx +47 -0
- package/components/ui/textarea/index.tsx +94 -0
- package/components/ui/toast/index.tsx +252 -0
- package/components/ui/tooltip/index.tsx +131 -0
- package/components/ui/view/index.tsx +2 -0
- package/components/ui/virtualized-list/index.tsx +2 -0
- package/components/ui/vstack/index.tsx +28 -0
- package/components/ui/vstack/index.web.tsx +27 -0
- package/components/ui/vstack/styles.tsx +25 -0
- package/design/canonical.index.txt +53 -0
- package/design/documentation.xml +519 -0
- package/design/manifest.xml +90 -0
- package/design/schema.xsd +639 -0
- package/design/themes.xml +204 -0
- package/design/tokens.xml +510 -0
- package/design/tools/design.js +165 -0
- package/design/tools/npm.js +65 -0
- package/design/tools/requirements.txt +35 -0
- package/design/tools/sources/.checker/__init__.py +81 -0
- package/design/tools/sources/.checker/checks.py +198 -0
- package/design/tools/sources/.checker/cli.py +154 -0
- package/design/tools/sources/.checker/io.py +242 -0
- package/design/tools/sources/.checker/model.py +144 -0
- package/design/tools/sources/.checker/registry.py +115 -0
- package/design/tools/sources/.checker/report.py +21 -0
- package/design/tools/sources/.docgen/__init__.py +45 -0
- package/design/tools/sources/.docgen/cli.py +101 -0
- package/design/tools/sources/.docgen/model.py +147 -0
- package/design/tools/sources/.docgen/reference.py +97 -0
- package/design/tools/sources/.docgen/site.py +145 -0
- package/design/tools/sources/.docgen/xsddoc.py +329 -0
- package/design/tools/sources/.generate/__init__.py +35 -0
- package/design/tools/sources/.generate/cli.py +76 -0
- package/design/tools/sources/.generate/common.py +33 -0
- package/design/tools/sources/.generate/config.py +119 -0
- package/design/tools/sources/.generate/model.py +51 -0
- package/design/tools/sources/.generate/tokens.py +141 -0
- package/design/tools/sources/.linter/__init__.py +9 -0
- package/design/tools/sources/.linter/cli.py +44 -0
- package/design/tools/sources/.linter/discovery.py +30 -0
- package/design/tools/sources/.linter/errors.py +45 -0
- package/design/tools/sources/.linter/linter.py +68 -0
- package/design/tools/sources/.xmleditor/__init__.py +74 -0
- package/design/tools/sources/.xmleditor/blocks.py +185 -0
- package/design/tools/sources/.xmleditor/cli.py +141 -0
- package/design/tools/sources/.xmleditor/editor.py +906 -0
- package/design/tools/sources/.xmleditor/model.py +708 -0
- package/design/tools/sources/.xmleditor/widgets.py +1832 -0
- package/design/tools/sources/.xmleditor/xsdmodel.py +753 -0
- package/design/tools/sources/checker.py +55 -0
- package/design/tools/sources/docgen.py +66 -0
- package/design/tools/sources/generate.py +48 -0
- package/design/tools/sources/linter.py +54 -0
- package/design/tools/sources/ruff.toml +12 -0
- package/design/tools/sources/xmleditor.py +62 -0
- package/design/tools/unix/_venv_python.sh +16 -0
- package/design/tools/unix/check.sh +13 -0
- package/design/tools/unix/doc.sh +14 -0
- package/design/tools/unix/gen.sh +14 -0
- package/design/tools/unix/lint.sh +10 -0
- package/design/tools/unix/run.sh +20 -0
- package/design/tools/unix/verify.sh +12 -0
- package/design/tools/unix/xmledit.sh +12 -0
- package/design/tools/windows/check.cmd +12 -0
- package/design/tools/windows/doc.cmd +12 -0
- package/design/tools/windows/gen.cmd +11 -0
- package/design/tools/windows/lint.cmd +9 -0
- package/design/tools/windows/run.cmd +26 -0
- package/design/tools/windows/verify.cmd +10 -0
- package/design/tools/windows/xmledit.cmd +10 -0
- package/dist/chunk-LV4UIEQN.js +9730 -0
- package/dist/chunk-LV4UIEQN.js.map +1 -0
- package/dist/chunk-WNVU3BM2.mjs +9401 -0
- package/dist/chunk-WNVU3BM2.mjs.map +1 -0
- package/dist/index.d.mts +40 -9
- package/dist/index.d.ts +40 -9
- package/dist/index.js +726 -414
- package/dist/index.mjs +1 -5
- package/dist/ui/index.d.mts +6931 -3070
- package/dist/ui/index.d.ts +6931 -3070
- package/dist/ui/index.js +779 -352
- package/dist/ui/index.mjs +1 -2
- package/package.json +66 -142
- package/dist/chunk-2XORADW6.js +0 -24552
- package/dist/chunk-2XORADW6.js.map +0 -1
- package/dist/chunk-52BHHF5M.js +0 -46
- package/dist/chunk-52BHHF5M.js.map +0 -1
- package/dist/chunk-5647JY7Z.mjs +0 -100
- package/dist/chunk-5647JY7Z.mjs.map +0 -1
- package/dist/chunk-5N5HC4ZA.mjs +0 -3
- package/dist/chunk-5N5HC4ZA.mjs.map +0 -1
- package/dist/chunk-7QFZMGL6.js +0 -8583
- package/dist/chunk-7QFZMGL6.js.map +0 -1
- package/dist/chunk-ASZEP37D.js +0 -423
- package/dist/chunk-ASZEP37D.js.map +0 -1
- package/dist/chunk-BH5SU2JQ.mjs +0 -8282
- package/dist/chunk-BH5SU2JQ.mjs.map +0 -1
- package/dist/chunk-BO65GO53.mjs +0 -422
- package/dist/chunk-BO65GO53.mjs.map +0 -1
- package/dist/chunk-BSVXX52E.mjs +0 -413
- package/dist/chunk-BSVXX52E.mjs.map +0 -1
- package/dist/chunk-DNV5UBNF.mjs +0 -3
- package/dist/chunk-DNV5UBNF.mjs.map +0 -1
- package/dist/chunk-EDTAMUO2.js +0 -8310
- package/dist/chunk-EDTAMUO2.js.map +0 -1
- package/dist/chunk-IJTI6EX4.js +0 -4
- package/dist/chunk-IJTI6EX4.js.map +0 -1
- package/dist/chunk-M3YLASM2.js +0 -428
- package/dist/chunk-M3YLASM2.js.map +0 -1
- package/dist/chunk-OXKOGLXE.js +0 -4
- package/dist/chunk-OXKOGLXE.js.map +0 -1
- package/dist/chunk-RQXQK3ZO.mjs +0 -8486
- package/dist/chunk-RQXQK3ZO.mjs.map +0 -1
- package/dist/chunk-SR25V4EA.mjs +0 -40
- package/dist/chunk-SR25V4EA.mjs.map +0 -1
- package/dist/chunk-UB34WFEQ.js +0 -106
- package/dist/chunk-UB34WFEQ.js.map +0 -1
- package/dist/chunk-ZBRWXKDF.mjs +0 -24431
- package/dist/chunk-ZBRWXKDF.mjs.map +0 -1
- package/dist/cli/ds.d.mts +0 -1
- package/dist/cli/ds.d.ts +0 -1
- package/dist/cli/ds.js +0 -602
- package/dist/cli/ds.js.map +0 -1
- package/dist/cli/ds.mjs +0 -579
- package/dist/cli/ds.mjs.map +0 -1
- package/dist/cli/flipova.d.mts +0 -1
- package/dist/cli/flipova.d.ts +0 -1
- package/dist/cli/flipova.js +0 -161
- package/dist/cli/flipova.js.map +0 -1
- package/dist/cli/flipova.mjs +0 -154
- package/dist/cli/flipova.mjs.map +0 -1
- package/dist/config/index.d.mts +0 -123
- package/dist/config/index.d.ts +0 -123
- package/dist/config/index.js +0 -28
- package/dist/config/index.js.map +0 -1
- package/dist/config/index.mjs +0 -3
- package/dist/config/index.mjs.map +0 -1
- package/dist/index-CuaJA3gM.d.mts +0 -78
- package/dist/index-CuaJA3gM.d.ts +0 -78
- package/dist/registry/index.d.mts +0 -10160
- package/dist/registry/index.d.ts +0 -10160
- package/dist/registry/index.js +0 -392
- package/dist/registry/index.js.map +0 -1
- package/dist/registry/index.mjs +0 -3
- package/dist/registry/index.mjs.map +0 -1
- package/dist/theme/index.d.mts +0 -109
- package/dist/theme/index.d.ts +0 -109
- package/dist/theme/index.js +0 -28
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/index.mjs +0 -3
- package/dist/theme/index.mjs.map +0 -1
- package/dist/tokens/index.d.mts +0 -423
- package/dist/tokens/index.d.ts +0 -423
- package/dist/tokens/index.js +0 -44
- package/dist/tokens/index.js.map +0 -1
- package/dist/tokens/index.mjs +0 -3
- package/dist/tokens/index.mjs.map +0 -1
- package/dist/types/index.d.mts +0 -202
- package/dist/types/index.d.ts +0 -202
- package/dist/types/index.js +0 -4
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -3
- package/dist/types/index.mjs.map +0 -1
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createToastHook } from '@gluestack-ui/core/toast/creator';
|
|
3
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
4
|
+
import { tva, useStyleContext, withStyleContext } from '@gluestack-ui/utils/nativewind-utils';
|
|
5
|
+
import { cssInterop } from 'nativewind';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { AccessibilityInfo, Text, View } from 'react-native';
|
|
8
|
+
import Animated, { SlideInUp } from 'react-native-reanimated';
|
|
9
|
+
const useToast = createToastHook(View);
|
|
10
|
+
const SCOPE = 'TOAST';
|
|
11
|
+
const AnimatedView = Animated.createAnimatedComponent(View);
|
|
12
|
+
cssInterop(AnimatedView, { className: 'style' });
|
|
13
|
+
const toastStyle = tva({
|
|
14
|
+
base: 'p-4 m-1 rounded-md gap-1 web:pointer-events-auto border-border',
|
|
15
|
+
variants: {
|
|
16
|
+
action: {
|
|
17
|
+
error: 'bg-popover text-popover-foreground',
|
|
18
|
+
warning: 'bg-popover text-popover-foreground',
|
|
19
|
+
success: 'bg-popover text-popover-foreground',
|
|
20
|
+
info: 'bg-popover text-popover-foreground',
|
|
21
|
+
muted: 'bg-popover text-popover-foreground',
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
variant: {
|
|
25
|
+
solid: 'border border-border bg-popover shadow-soft-4',
|
|
26
|
+
outline: 'border border-border bg-popover',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const toastTitleStyle = tva({
|
|
32
|
+
base: 'font-medium font-body tracking-md text-left',
|
|
33
|
+
variants: {
|
|
34
|
+
isTruncated: {
|
|
35
|
+
true: '',
|
|
36
|
+
},
|
|
37
|
+
bold: {
|
|
38
|
+
true: 'font-bold',
|
|
39
|
+
},
|
|
40
|
+
underline: {
|
|
41
|
+
true: 'underline',
|
|
42
|
+
},
|
|
43
|
+
strikeThrough: {
|
|
44
|
+
true: 'line-through',
|
|
45
|
+
},
|
|
46
|
+
size: {
|
|
47
|
+
'2xs': 'text-2xs',
|
|
48
|
+
'xs': 'text-xs',
|
|
49
|
+
'sm': 'text-sm',
|
|
50
|
+
'md': 'text-base',
|
|
51
|
+
'lg': 'text-lg',
|
|
52
|
+
'xl': 'text-xl',
|
|
53
|
+
'2xl': 'text-2xl',
|
|
54
|
+
'3xl': 'text-3xl',
|
|
55
|
+
'4xl': 'text-4xl',
|
|
56
|
+
'5xl': 'text-5xl',
|
|
57
|
+
'6xl': 'text-6xl',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
parentVariants: {
|
|
61
|
+
variant: {
|
|
62
|
+
solid: '',
|
|
63
|
+
outline: 'text-foreground',
|
|
64
|
+
},
|
|
65
|
+
action: {
|
|
66
|
+
error: '',
|
|
67
|
+
warning: '',
|
|
68
|
+
success: '',
|
|
69
|
+
info: '',
|
|
70
|
+
muted: '',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
parentCompoundVariants: [
|
|
74
|
+
{
|
|
75
|
+
variant: 'solid',
|
|
76
|
+
action: 'error',
|
|
77
|
+
class: 'text-destructive-foreground',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
variant: 'solid',
|
|
81
|
+
action: 'warning',
|
|
82
|
+
class: 'text-accent-foreground',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
variant: 'solid',
|
|
86
|
+
action: 'success',
|
|
87
|
+
class: 'text-secondary-foreground',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
variant: 'solid',
|
|
91
|
+
action: 'info',
|
|
92
|
+
class: 'text-popover-foreground',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
variant: 'solid',
|
|
96
|
+
action: 'muted',
|
|
97
|
+
class: 'text-muted-foreground',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
variant: 'outline',
|
|
101
|
+
action: 'error',
|
|
102
|
+
class: 'text-destructive',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
variant: 'outline',
|
|
106
|
+
action: 'warning',
|
|
107
|
+
class: 'text-accent-foreground',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
variant: 'outline',
|
|
111
|
+
action: 'success',
|
|
112
|
+
class: 'text-secondary-foreground',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
variant: 'outline',
|
|
116
|
+
action: 'info',
|
|
117
|
+
class: 'text-popover-foreground',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
variant: 'outline',
|
|
121
|
+
action: 'muted',
|
|
122
|
+
class: 'text-muted-foreground',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const toastDescriptionStyle = tva({
|
|
128
|
+
base: 'font-normal font-body tracking-md text-left',
|
|
129
|
+
variants: {
|
|
130
|
+
isTruncated: {
|
|
131
|
+
true: '',
|
|
132
|
+
},
|
|
133
|
+
bold: {
|
|
134
|
+
true: 'font-bold',
|
|
135
|
+
},
|
|
136
|
+
underline: {
|
|
137
|
+
true: 'underline',
|
|
138
|
+
},
|
|
139
|
+
strikeThrough: {
|
|
140
|
+
true: 'line-through',
|
|
141
|
+
},
|
|
142
|
+
size: {
|
|
143
|
+
'2xs': 'text-2xs',
|
|
144
|
+
'xs': 'text-xs',
|
|
145
|
+
'sm': 'text-sm',
|
|
146
|
+
'md': 'text-base',
|
|
147
|
+
'lg': 'text-lg',
|
|
148
|
+
'xl': 'text-xl',
|
|
149
|
+
'2xl': 'text-2xl',
|
|
150
|
+
'3xl': 'text-3xl',
|
|
151
|
+
'4xl': 'text-4xl',
|
|
152
|
+
'5xl': 'text-5xl',
|
|
153
|
+
'6xl': 'text-6xl',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
parentVariants: {
|
|
157
|
+
variant: {
|
|
158
|
+
solid: 'text-muted-foreground',
|
|
159
|
+
outline: 'text-muted-foreground',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const Root = withStyleContext(AnimatedView, SCOPE);
|
|
165
|
+
type IToastProps = React.ComponentProps<typeof Root> & {
|
|
166
|
+
className?: string;
|
|
167
|
+
} & VariantProps<typeof toastStyle>;
|
|
168
|
+
|
|
169
|
+
const Toast = React.forwardRef<React.ComponentRef<typeof Root>, IToastProps>(
|
|
170
|
+
function Toast(
|
|
171
|
+
{ className, variant = 'solid', action = 'muted', ...props },
|
|
172
|
+
ref
|
|
173
|
+
) {
|
|
174
|
+
return (
|
|
175
|
+
<Root
|
|
176
|
+
ref={ref}
|
|
177
|
+
entering={SlideInUp}
|
|
178
|
+
className={toastStyle({ variant, action, class: className })}
|
|
179
|
+
context={{ variant, action }}
|
|
180
|
+
{...props}
|
|
181
|
+
/>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
type IToastTitleProps = React.ComponentProps<typeof Text> & {
|
|
187
|
+
className?: string;
|
|
188
|
+
} & VariantProps<typeof toastTitleStyle>;
|
|
189
|
+
|
|
190
|
+
const ToastTitle = React.forwardRef<
|
|
191
|
+
React.ComponentRef<typeof Text>,
|
|
192
|
+
IToastTitleProps
|
|
193
|
+
>(function ToastTitle({ className, size = 'md', children, ...props }, ref) {
|
|
194
|
+
const { variant: parentVariant, action: parentAction } =
|
|
195
|
+
useStyleContext(SCOPE);
|
|
196
|
+
React.useEffect(() => {
|
|
197
|
+
// Issue from react-native side
|
|
198
|
+
// Hack for now, will fix this later
|
|
199
|
+
AccessibilityInfo.announceForAccessibility(children as string);
|
|
200
|
+
}, [children]);
|
|
201
|
+
|
|
202
|
+
return (
|
|
203
|
+
<Text
|
|
204
|
+
{...props}
|
|
205
|
+
ref={ref}
|
|
206
|
+
aria-live="assertive"
|
|
207
|
+
aria-atomic="true"
|
|
208
|
+
role="alert"
|
|
209
|
+
className={toastTitleStyle({
|
|
210
|
+
size,
|
|
211
|
+
class: className,
|
|
212
|
+
parentVariants: {
|
|
213
|
+
variant: parentVariant,
|
|
214
|
+
action: parentAction,
|
|
215
|
+
},
|
|
216
|
+
})}
|
|
217
|
+
>
|
|
218
|
+
{children}
|
|
219
|
+
</Text>
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
type IToastDescriptionProps = React.ComponentProps<typeof Text> & {
|
|
224
|
+
className?: string;
|
|
225
|
+
} & VariantProps<typeof toastDescriptionStyle>;
|
|
226
|
+
|
|
227
|
+
const ToastDescription = React.forwardRef<
|
|
228
|
+
React.ComponentRef<typeof Text>,
|
|
229
|
+
IToastDescriptionProps
|
|
230
|
+
>(function ToastDescription({ className, size = 'md', ...props }, ref) {
|
|
231
|
+
const { variant: parentVariant } = useStyleContext(SCOPE);
|
|
232
|
+
return (
|
|
233
|
+
<Text
|
|
234
|
+
ref={ref}
|
|
235
|
+
{...props}
|
|
236
|
+
className={toastDescriptionStyle({
|
|
237
|
+
size,
|
|
238
|
+
class: className,
|
|
239
|
+
parentVariants: {
|
|
240
|
+
variant: parentVariant,
|
|
241
|
+
},
|
|
242
|
+
})}
|
|
243
|
+
/>
|
|
244
|
+
);
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
Toast.displayName = 'Toast';
|
|
248
|
+
ToastTitle.displayName = 'ToastTitle';
|
|
249
|
+
ToastDescription.displayName = 'ToastDescription';
|
|
250
|
+
|
|
251
|
+
export { Toast, ToastDescription, ToastTitle, useToast };
|
|
252
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createTooltip } from '@gluestack-ui/core/tooltip/creator';
|
|
4
|
+
import { View, Text, ViewStyle } from 'react-native';
|
|
5
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
6
|
+
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
7
|
+
import { withStyleContext } from '@gluestack-ui/utils/nativewind-utils';
|
|
8
|
+
import {
|
|
9
|
+
Motion,
|
|
10
|
+
AnimatePresence,
|
|
11
|
+
MotionComponentProps,
|
|
12
|
+
} from '@legendapp/motion';
|
|
13
|
+
import { cssInterop } from 'nativewind';
|
|
14
|
+
|
|
15
|
+
type IMotionViewProps = React.ComponentProps<typeof View> &
|
|
16
|
+
MotionComponentProps<typeof View, ViewStyle, unknown, unknown, unknown>;
|
|
17
|
+
|
|
18
|
+
const MotionView = Motion.View as React.ComponentType<IMotionViewProps>;
|
|
19
|
+
|
|
20
|
+
export const UITooltip = createTooltip({
|
|
21
|
+
Root: withStyleContext(View),
|
|
22
|
+
Content: MotionView,
|
|
23
|
+
Text: Text,
|
|
24
|
+
AnimatePresence: AnimatePresence,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
cssInterop(MotionView, { className: 'style' });
|
|
28
|
+
|
|
29
|
+
const tooltipStyle = tva({
|
|
30
|
+
base: 'w-full h-full web:pointer-events-none',
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const tooltipContentStyle = tva({
|
|
34
|
+
base: 'py-1 px-3 rounded-sm bg-background/90 web:pointer-events-auto',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const tooltipTextStyle = tva({
|
|
38
|
+
base: 'font-normal tracking-normal web:select-none text-xs text-foreground/90',
|
|
39
|
+
|
|
40
|
+
variants: {
|
|
41
|
+
isTruncated: {
|
|
42
|
+
true: 'line-clamp-1 truncate',
|
|
43
|
+
},
|
|
44
|
+
bold: {
|
|
45
|
+
true: 'font-bold',
|
|
46
|
+
},
|
|
47
|
+
underline: {
|
|
48
|
+
true: 'underline',
|
|
49
|
+
},
|
|
50
|
+
strikeThrough: {
|
|
51
|
+
true: 'line-through',
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
'2xs': 'text-2xs',
|
|
55
|
+
'xs': 'text-xs',
|
|
56
|
+
'sm': 'text-sm',
|
|
57
|
+
'md': 'text-base',
|
|
58
|
+
'lg': 'text-lg',
|
|
59
|
+
'xl': 'text-xl',
|
|
60
|
+
'2xl': 'text-2xl',
|
|
61
|
+
'3xl': 'text-3xl',
|
|
62
|
+
'4xl': 'text-4xl',
|
|
63
|
+
'5xl': 'text-5xl',
|
|
64
|
+
'6xl': 'text-6xl',
|
|
65
|
+
},
|
|
66
|
+
sub: {
|
|
67
|
+
true: 'text-xs',
|
|
68
|
+
},
|
|
69
|
+
italic: {
|
|
70
|
+
true: 'italic',
|
|
71
|
+
},
|
|
72
|
+
highlight: {
|
|
73
|
+
true: 'bg-yellow-500',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
type ITooltipProps = React.ComponentProps<typeof UITooltip> &
|
|
79
|
+
VariantProps<typeof tooltipStyle> & { className?: string };
|
|
80
|
+
type ITooltipContentProps = React.ComponentProps<typeof UITooltip.Content> &
|
|
81
|
+
VariantProps<typeof tooltipContentStyle> & { className?: string };
|
|
82
|
+
type ITooltipTextProps = React.ComponentProps<typeof UITooltip.Text> &
|
|
83
|
+
VariantProps<typeof tooltipTextStyle> & { className?: string };
|
|
84
|
+
|
|
85
|
+
const Tooltip = React.forwardRef<
|
|
86
|
+
React.ComponentRef<typeof UITooltip>,
|
|
87
|
+
ITooltipProps
|
|
88
|
+
>(function Tooltip({ className, ...props }, ref) {
|
|
89
|
+
return (
|
|
90
|
+
<UITooltip
|
|
91
|
+
ref={ref}
|
|
92
|
+
className={tooltipStyle({ class: className })}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const TooltipContent = React.forwardRef<
|
|
99
|
+
React.ComponentRef<typeof UITooltip.Content>,
|
|
100
|
+
ITooltipContentProps & { className?: string }
|
|
101
|
+
>(function TooltipContent({ className, ...props }, ref) {
|
|
102
|
+
return (
|
|
103
|
+
<UITooltip.Content
|
|
104
|
+
ref={ref}
|
|
105
|
+
{...props}
|
|
106
|
+
className={tooltipContentStyle({
|
|
107
|
+
class: className,
|
|
108
|
+
})}
|
|
109
|
+
pointerEvents="auto"
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const TooltipText = React.forwardRef<
|
|
115
|
+
React.ComponentRef<typeof UITooltip.Text>,
|
|
116
|
+
ITooltipTextProps & { className?: string }
|
|
117
|
+
>(function TooltipText({ size, className, ...props }, ref) {
|
|
118
|
+
return (
|
|
119
|
+
<UITooltip.Text
|
|
120
|
+
ref={ref}
|
|
121
|
+
className={tooltipTextStyle({ size, class: className })}
|
|
122
|
+
{...props}
|
|
123
|
+
/>
|
|
124
|
+
);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
Tooltip.displayName = 'Tooltip';
|
|
128
|
+
TooltipContent.displayName = 'TooltipContent';
|
|
129
|
+
TooltipText.displayName = 'TooltipText';
|
|
130
|
+
|
|
131
|
+
export { Tooltip, TooltipContent, TooltipText };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { vstackStyle } from './styles';
|
|
6
|
+
|
|
7
|
+
type IVStackProps = React.ComponentProps<typeof View> &
|
|
8
|
+
VariantProps<typeof vstackStyle>;
|
|
9
|
+
|
|
10
|
+
const VStack = React.forwardRef<React.ComponentRef<typeof View>, IVStackProps>(
|
|
11
|
+
function VStack({ className, space, reversed, ...props }, ref) {
|
|
12
|
+
return (
|
|
13
|
+
<View
|
|
14
|
+
className={vstackStyle({
|
|
15
|
+
space,
|
|
16
|
+
reversed: reversed as boolean,
|
|
17
|
+
class: className,
|
|
18
|
+
})}
|
|
19
|
+
{...props}
|
|
20
|
+
ref={ref}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
VStack.displayName = 'VStack';
|
|
27
|
+
|
|
28
|
+
export { VStack };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
|
|
3
|
+
|
|
4
|
+
import { vstackStyle } from './styles';
|
|
5
|
+
|
|
6
|
+
type IVStackProps = React.ComponentProps<'div'> &
|
|
7
|
+
VariantProps<typeof vstackStyle>;
|
|
8
|
+
|
|
9
|
+
const VStack = React.forwardRef<React.ComponentRef<'div'>, IVStackProps>(
|
|
10
|
+
function VStack({ className, space, reversed, ...props }, ref) {
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
className={vstackStyle({
|
|
14
|
+
space,
|
|
15
|
+
reversed: reversed as boolean,
|
|
16
|
+
class: className,
|
|
17
|
+
})}
|
|
18
|
+
{...props}
|
|
19
|
+
ref={ref}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
VStack.displayName = 'VStack';
|
|
26
|
+
|
|
27
|
+
export { VStack };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isWeb } from '@gluestack-ui/utils/nativewind-utils';
|
|
2
|
+
import { tva } from '@gluestack-ui/utils/nativewind-utils';
|
|
3
|
+
|
|
4
|
+
const baseStyle = isWeb
|
|
5
|
+
? 'flex flex-col relative z-0 box-border border-0 list-none min-w-0 min-h-0 bg-transparent items-stretch m-0 p-0 text-decoration-none'
|
|
6
|
+
: '';
|
|
7
|
+
|
|
8
|
+
export const vstackStyle = tva({
|
|
9
|
+
base: `flex-col ${baseStyle}`,
|
|
10
|
+
variants: {
|
|
11
|
+
space: {
|
|
12
|
+
'xs': 'gap-1',
|
|
13
|
+
'sm': 'gap-2',
|
|
14
|
+
'md': 'gap-3',
|
|
15
|
+
'lg': 'gap-4',
|
|
16
|
+
'xl': 'gap-5',
|
|
17
|
+
'2xl': 'gap-6',
|
|
18
|
+
'3xl': 'gap-7',
|
|
19
|
+
'4xl': 'gap-8',
|
|
20
|
+
},
|
|
21
|
+
reversed: {
|
|
22
|
+
true: 'flex-col-reverse',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Flipova Foundation — canonical registry index (deterministic artifact)
|
|
2
|
+
# generated by design/tools/sources/checker.py --emit-canonical
|
|
3
|
+
# commit this file: --verify-canonical fails the build when the registry drifts.
|
|
4
|
+
|
|
5
|
+
# entries (register/id) — canonical sort by (register, id)
|
|
6
|
+
themes/dark
|
|
7
|
+
themes/light
|
|
8
|
+
tokens/breakpoints
|
|
9
|
+
tokens/color
|
|
10
|
+
tokens/duration
|
|
11
|
+
tokens/easing
|
|
12
|
+
tokens/family
|
|
13
|
+
tokens/fontSizes
|
|
14
|
+
tokens/fontWeights
|
|
15
|
+
tokens/letterSpacings
|
|
16
|
+
tokens/lineHeights
|
|
17
|
+
tokens/opacity
|
|
18
|
+
tokens/radii
|
|
19
|
+
tokens/shadow
|
|
20
|
+
tokens/spacing
|
|
21
|
+
tokens/zIndex
|
|
22
|
+
|
|
23
|
+
## references (resolved, never dangling)
|
|
24
|
+
$ref.tokens.color.black -> #000000
|
|
25
|
+
$ref.tokens.color.error.500 -> #EF4444
|
|
26
|
+
$ref.tokens.color.error.600 -> #DC2626
|
|
27
|
+
$ref.tokens.color.gray.50 -> #FAFAFA
|
|
28
|
+
$ref.tokens.color.gray.100 -> #F4F4F5
|
|
29
|
+
$ref.tokens.color.gray.200 -> #E4E4E7
|
|
30
|
+
$ref.tokens.color.gray.400 -> #A1A1AA
|
|
31
|
+
$ref.tokens.color.gray.600 -> #52525B
|
|
32
|
+
$ref.tokens.color.gray.700 -> #3F3F46
|
|
33
|
+
$ref.tokens.color.gray.800 -> #27272A
|
|
34
|
+
$ref.tokens.color.gray.900 -> #18181B
|
|
35
|
+
$ref.tokens.color.info.500 -> #0EA5E9
|
|
36
|
+
$ref.tokens.color.info.600 -> #0284C7
|
|
37
|
+
$ref.tokens.color.neutral.900 -> #262626
|
|
38
|
+
$ref.tokens.color.primary.50 -> #EFF6FF
|
|
39
|
+
$ref.tokens.color.primary.100 -> #DBEAFE
|
|
40
|
+
$ref.tokens.color.primary.400 -> #60A5FA
|
|
41
|
+
$ref.tokens.color.primary.500 -> #3B82F6
|
|
42
|
+
$ref.tokens.color.primary.600 -> #2563EB
|
|
43
|
+
$ref.tokens.color.primary.900 -> #1E3A8A
|
|
44
|
+
$ref.tokens.color.secondary.500 -> #64748B
|
|
45
|
+
$ref.tokens.color.secondary.600 -> #475569
|
|
46
|
+
$ref.tokens.color.success.500 -> #22C55E
|
|
47
|
+
$ref.tokens.color.success.600 -> #16A34A
|
|
48
|
+
$ref.tokens.color.warning.500 -> #F59E0B
|
|
49
|
+
$ref.tokens.color.warning.600 -> #D97706
|
|
50
|
+
$ref.tokens.color.white -> #FFFFFF
|
|
51
|
+
|
|
52
|
+
## sha256
|
|
53
|
+
a6278c2bf241fbb45ffa7e7ce58f8d9d362e08b536751fdac5e976cbe445842c
|