@flipova/foundation 2.3.0 → 2.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +157 -156
  2. package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +16 -7
  3. package/components/ui/accordion/AccordionAnimatedHeight.tsx +3 -15
  4. package/components/ui/accordion/AccordionAnimatedIcon.tsx +2 -9
  5. package/components/ui/accordion/AnimatedHeight.tsx +3 -15
  6. package/components/ui/accordion/AnimatedIcon.tsx +2 -9
  7. package/components/ui/accordion/MIGRATION_SUMMARY.md +22 -11
  8. package/components/ui/accordion/USAGE_EXAMPLE.tsx +10 -25
  9. package/components/ui/accordion/index.tsx +71 -139
  10. package/components/ui/actionsheet/index.tsx +63 -105
  11. package/components/ui/alert/index.tsx +20 -50
  12. package/components/ui/alert-dialog/index.tsx +23 -48
  13. package/components/ui/avatar/index.tsx +32 -68
  14. package/components/ui/badge/index.tsx +18 -49
  15. package/components/ui/bottomsheet/index.tsx +20 -52
  16. package/components/ui/box/index.tsx +4 -9
  17. package/components/ui/box/index.web.tsx +3 -9
  18. package/components/ui/button/index.tsx +73 -109
  19. package/components/ui/calendar/creator.tsx +69 -30
  20. package/components/ui/calendar/index.tsx +81 -159
  21. package/components/ui/calendar/styles.tsx +10 -10
  22. package/components/ui/card/index.tsx +8 -9
  23. package/components/ui/card/index.web.tsx +4 -10
  24. package/components/ui/center/index.tsx +6 -11
  25. package/components/ui/center/index.web.tsx +3 -9
  26. package/components/ui/checkbox/index.tsx +46 -107
  27. package/components/ui/date-time-picker/creator.tsx +14 -1
  28. package/components/ui/date-time-picker/index.tsx +107 -156
  29. package/components/ui/date-time-picker/index.web.tsx +11 -33
  30. package/components/ui/date-time-picker/styles.tsx +5 -5
  31. package/components/ui/divider/index.tsx +5 -6
  32. package/components/ui/drawer/index.tsx +108 -128
  33. package/components/ui/fab/index.tsx +25 -68
  34. package/components/ui/flat-list/index.tsx +11 -8
  35. package/components/ui/form-control/index.tsx +49 -90
  36. package/components/ui/gluestack-ui-provider/index.tsx +4 -18
  37. package/components/ui/gluestack-ui-provider/index.web.tsx +10 -11
  38. package/components/ui/gluestack-ui-provider/script.ts +1 -3
  39. package/components/ui/gluestack-ui-provider/theme-context.ts +2 -2
  40. package/components/ui/gluestack-ui-provider/useGluestackColors.ts +2 -6
  41. package/components/ui/grid/index.tsx +128 -165
  42. package/components/ui/grid/index.web.tsx +17 -19
  43. package/components/ui/grid/styles.tsx +1 -3
  44. package/components/ui/heading/index.tsx +146 -169
  45. package/components/ui/heading/index.web.tsx +7 -28
  46. package/components/ui/heading/styles.tsx +5 -5
  47. package/components/ui/hstack/index.tsx +16 -15
  48. package/components/ui/hstack/index.web.tsx +17 -17
  49. package/components/ui/hstack/styles.tsx +5 -5
  50. package/components/ui/icon/index.tsx +95 -486
  51. package/components/ui/icon/index.web.tsx +79 -439
  52. package/components/ui/image/index.tsx +13 -18
  53. package/components/ui/image-viewer/index.tsx +149 -221
  54. package/components/ui/image-viewer/index.web.tsx +88 -113
  55. package/components/ui/input/index.tsx +20 -33
  56. package/components/ui/link/index.tsx +16 -22
  57. package/components/ui/liquid-glass/index.tsx +19 -25
  58. package/components/ui/menu/index.tsx +44 -66
  59. package/components/ui/modal/index.tsx +70 -91
  60. package/components/ui/popover/index.tsx +102 -121
  61. package/components/ui/portal/index.tsx +5 -6
  62. package/components/ui/pressable/index.tsx +5 -9
  63. package/components/ui/progress/index.tsx +4 -11
  64. package/components/ui/radio/index.tsx +47 -83
  65. package/components/ui/select/index.tsx +38 -59
  66. package/components/ui/select/select-actionsheet.tsx +61 -108
  67. package/components/ui/skeleton/index.tsx +22 -43
  68. package/components/ui/skeleton/index.web.tsx +63 -75
  69. package/components/ui/slider/index.tsx +36 -56
  70. package/components/ui/spinner/index.tsx +1 -10
  71. package/components/ui/switch/index.tsx +6 -13
  72. package/components/ui/table/index.tsx +39 -102
  73. package/components/ui/table/index.web.tsx +41 -79
  74. package/components/ui/tabs/TabsAnimatedIndicator.tsx +10 -38
  75. package/components/ui/tabs/creator.tsx +32 -24
  76. package/components/ui/tabs/index.tsx +253 -309
  77. package/components/ui/text/index.tsx +23 -37
  78. package/components/ui/text/index.web.tsx +33 -35
  79. package/components/ui/text/styles.tsx +5 -5
  80. package/components/ui/textarea/index.tsx +24 -38
  81. package/components/ui/toast/index.tsx +47 -52
  82. package/components/ui/tooltip/index.tsx +12 -28
  83. package/components/ui/vstack/index.tsx +17 -17
  84. package/components/ui/vstack/index.web.tsx +17 -17
  85. package/components/ui/vstack/styles.tsx +5 -5
  86. package/design/tools/design.js +15 -12
  87. package/design/tools/npm.js +4 -3
  88. package/dist/{chunk-B277QSR5.mjs → chunk-2R66P5X5.mjs} +1816 -3124
  89. package/dist/chunk-2R66P5X5.mjs.map +1 -0
  90. package/dist/{chunk-GD37RFBR.js → chunk-LCTFQJZM.js} +1816 -3124
  91. package/dist/chunk-LCTFQJZM.js.map +1 -0
  92. package/dist/index.js +294 -294
  93. package/dist/index.mjs +1 -1
  94. package/dist/ui/index.js +294 -294
  95. package/dist/ui/index.mjs +1 -1
  96. package/package.json +12 -7
  97. package/dist/chunk-B277QSR5.mjs.map +0 -1
  98. package/dist/chunk-GD37RFBR.js.map +0 -1
@@ -17,178 +17,157 @@ cssInterop(H5, { className: 'style' });
17
17
  cssInterop(H6, { className: 'style' });
18
18
 
19
19
  const MappedHeading = memo(
20
- forwardRef<React.ComponentRef<typeof H1>, IHeadingProps>(
21
- function MappedHeading(
22
- {
23
- size,
24
- className,
25
- isTruncated,
26
- bold,
27
- underline,
28
- strikeThrough,
29
- sub,
30
- italic,
31
- highlight,
32
- ...props
33
- },
34
- ref
35
- ) {
36
- switch (size) {
37
- case '5xl':
38
- case '4xl':
39
- case '3xl':
40
- return (
41
- <H1
42
- className={headingStyle({
43
- size,
44
- isTruncated: isTruncated as boolean,
45
- bold: bold as boolean,
46
- underline: underline as boolean,
47
- strikeThrough: strikeThrough as boolean,
48
- sub: sub as boolean,
49
- italic: italic as boolean,
50
- highlight: highlight as boolean,
51
- class: className,
52
- })}
53
- {...props}
54
- // @ts-expect-error : type issue
55
- ref={ref}
56
- />
57
- );
58
- case '2xl':
59
- return (
60
- <H2
61
- className={headingStyle({
62
- size,
63
- isTruncated: isTruncated as boolean,
64
- bold: bold as boolean,
65
- underline: underline as boolean,
66
- strikeThrough: strikeThrough as boolean,
67
- sub: sub as boolean,
68
- italic: italic as boolean,
69
- highlight: highlight as boolean,
70
- class: className,
71
- })}
72
- {...props}
73
- // @ts-expect-error : type issue
74
- ref={ref}
75
- />
76
- );
77
- case 'xl':
78
- return (
79
- <H3
80
- className={headingStyle({
81
- size,
82
- isTruncated: isTruncated as boolean,
83
- bold: bold as boolean,
84
- underline: underline as boolean,
85
- strikeThrough: strikeThrough as boolean,
86
- sub: sub as boolean,
87
- italic: italic as boolean,
88
- highlight: highlight as boolean,
89
- class: className,
90
- })}
91
- {...props}
92
- // @ts-expect-error : type issue
93
- ref={ref}
94
- />
95
- );
96
- case 'lg':
97
- return (
98
- <H4
99
- className={headingStyle({
100
- size,
101
- isTruncated: isTruncated as boolean,
102
- bold: bold as boolean,
103
- underline: underline as boolean,
104
- strikeThrough: strikeThrough as boolean,
105
- sub: sub as boolean,
106
- italic: italic as boolean,
107
- highlight: highlight as boolean,
108
- class: className,
109
- })}
110
- {...props}
111
- // @ts-expect-error : type issue
112
- ref={ref}
113
- />
114
- );
115
- case 'md':
116
- return (
117
- <H5
118
- className={headingStyle({
119
- size,
120
- isTruncated: isTruncated as boolean,
121
- bold: bold as boolean,
122
- underline: underline as boolean,
123
- strikeThrough: strikeThrough as boolean,
124
- sub: sub as boolean,
125
- italic: italic as boolean,
126
- highlight: highlight as boolean,
127
- class: className,
128
- })}
129
- {...props}
130
- // @ts-expect-error : type issue
131
- ref={ref}
132
- />
133
- );
134
- case 'sm':
135
- case 'xs':
136
- return (
137
- <H6
138
- className={headingStyle({
139
- size,
140
- isTruncated: isTruncated as boolean,
141
- bold: bold as boolean,
142
- underline: underline as boolean,
143
- strikeThrough: strikeThrough as boolean,
144
- sub: sub as boolean,
145
- italic: italic as boolean,
146
- highlight: highlight as boolean,
147
- class: className,
148
- })}
149
- {...props}
150
- // @ts-expect-error : type issue
151
- ref={ref}
152
- />
153
- );
154
- default:
155
- return (
156
- <H4
157
- className={headingStyle({
158
- size,
159
- isTruncated: isTruncated as boolean,
160
- bold: bold as boolean,
161
- underline: underline as boolean,
162
- strikeThrough: strikeThrough as boolean,
163
- sub: sub as boolean,
164
- italic: italic as boolean,
165
- highlight: highlight as boolean,
166
- class: className,
167
- })}
168
- {...props}
169
- // @ts-expect-error : type issue
170
- ref={ref}
171
- />
172
- );
173
- }
20
+ forwardRef<React.ComponentRef<typeof H1>, IHeadingProps>(function MappedHeading(
21
+ { size, className, isTruncated, bold, underline, strikeThrough, sub, italic, highlight, ...props },
22
+ ref,
23
+ ) {
24
+ switch (size) {
25
+ case '5xl':
26
+ case '4xl':
27
+ case '3xl':
28
+ return (
29
+ <H1
30
+ className={headingStyle({
31
+ size,
32
+ isTruncated: isTruncated as boolean,
33
+ bold: bold as boolean,
34
+ underline: underline as boolean,
35
+ strikeThrough: strikeThrough as boolean,
36
+ sub: sub as boolean,
37
+ italic: italic as boolean,
38
+ highlight: highlight as boolean,
39
+ class: className,
40
+ })}
41
+ {...props}
42
+ // @ts-expect-error : type issue
43
+ ref={ref}
44
+ />
45
+ );
46
+ case '2xl':
47
+ return (
48
+ <H2
49
+ className={headingStyle({
50
+ size,
51
+ isTruncated: isTruncated as boolean,
52
+ bold: bold as boolean,
53
+ underline: underline as boolean,
54
+ strikeThrough: strikeThrough as boolean,
55
+ sub: sub as boolean,
56
+ italic: italic as boolean,
57
+ highlight: highlight as boolean,
58
+ class: className,
59
+ })}
60
+ {...props}
61
+ // @ts-expect-error : type issue
62
+ ref={ref}
63
+ />
64
+ );
65
+ case 'xl':
66
+ return (
67
+ <H3
68
+ className={headingStyle({
69
+ size,
70
+ isTruncated: isTruncated as boolean,
71
+ bold: bold as boolean,
72
+ underline: underline as boolean,
73
+ strikeThrough: strikeThrough as boolean,
74
+ sub: sub as boolean,
75
+ italic: italic as boolean,
76
+ highlight: highlight as boolean,
77
+ class: className,
78
+ })}
79
+ {...props}
80
+ // @ts-expect-error : type issue
81
+ ref={ref}
82
+ />
83
+ );
84
+ case 'lg':
85
+ return (
86
+ <H4
87
+ className={headingStyle({
88
+ size,
89
+ isTruncated: isTruncated as boolean,
90
+ bold: bold as boolean,
91
+ underline: underline as boolean,
92
+ strikeThrough: strikeThrough as boolean,
93
+ sub: sub as boolean,
94
+ italic: italic as boolean,
95
+ highlight: highlight as boolean,
96
+ class: className,
97
+ })}
98
+ {...props}
99
+ // @ts-expect-error : type issue
100
+ ref={ref}
101
+ />
102
+ );
103
+ case 'md':
104
+ return (
105
+ <H5
106
+ className={headingStyle({
107
+ size,
108
+ isTruncated: isTruncated as boolean,
109
+ bold: bold as boolean,
110
+ underline: underline as boolean,
111
+ strikeThrough: strikeThrough as boolean,
112
+ sub: sub as boolean,
113
+ italic: italic as boolean,
114
+ highlight: highlight as boolean,
115
+ class: className,
116
+ })}
117
+ {...props}
118
+ // @ts-expect-error : type issue
119
+ ref={ref}
120
+ />
121
+ );
122
+ case 'sm':
123
+ case 'xs':
124
+ return (
125
+ <H6
126
+ className={headingStyle({
127
+ size,
128
+ isTruncated: isTruncated as boolean,
129
+ bold: bold as boolean,
130
+ underline: underline as boolean,
131
+ strikeThrough: strikeThrough as boolean,
132
+ sub: sub as boolean,
133
+ italic: italic as boolean,
134
+ highlight: highlight as boolean,
135
+ class: className,
136
+ })}
137
+ {...props}
138
+ // @ts-expect-error : type issue
139
+ ref={ref}
140
+ />
141
+ );
142
+ default:
143
+ return (
144
+ <H4
145
+ className={headingStyle({
146
+ size,
147
+ isTruncated: isTruncated as boolean,
148
+ bold: bold as boolean,
149
+ underline: underline as boolean,
150
+ strikeThrough: strikeThrough as boolean,
151
+ sub: sub as boolean,
152
+ italic: italic as boolean,
153
+ highlight: highlight as boolean,
154
+ class: className,
155
+ })}
156
+ {...props}
157
+ // @ts-expect-error : type issue
158
+ ref={ref}
159
+ />
160
+ );
174
161
  }
175
- )
162
+ }),
176
163
  );
177
164
 
178
165
  const Heading = memo(
179
166
  forwardRef<React.ComponentRef<typeof H1>, IHeadingProps>(function Heading(
180
167
  { className, size = 'lg', as: AsComp, ...props },
181
- ref
168
+ ref,
182
169
  ) {
183
- const {
184
- isTruncated,
185
- bold,
186
- underline,
187
- strikeThrough,
188
- sub,
189
- italic,
190
- highlight,
191
- } = props;
170
+ const { isTruncated, bold, underline, strikeThrough, sub, italic, highlight } = props;
192
171
 
193
172
  if (AsComp) {
194
173
  return (
@@ -209,10 +188,8 @@ const Heading = memo(
209
188
  );
210
189
  }
211
190
 
212
- return (
213
- <MappedHeading className={className} size={size} ref={ref} {...props} />
214
- );
215
- })
191
+ return <MappedHeading className={className} size={size} ref={ref} {...props} />;
192
+ }),
216
193
  );
217
194
 
218
195
  Heading.displayName = 'Heading';
@@ -8,19 +8,8 @@ type IHeadingProps = VariantProps<typeof headingStyle> &
8
8
 
9
9
  const MappedHeading = memo(
10
10
  forwardRef<HTMLHeadingElement, IHeadingProps>(function MappedHeading(
11
- {
12
- size,
13
- className,
14
- isTruncated,
15
- bold,
16
- underline,
17
- strikeThrough,
18
- sub,
19
- italic,
20
- highlight,
21
- ...props
22
- },
23
- ref
11
+ { size, className, isTruncated, bold, underline, strikeThrough, sub, italic, highlight, ...props },
12
+ ref,
24
13
  ) {
25
14
  switch (size) {
26
15
  case '5xl':
@@ -153,23 +142,15 @@ const MappedHeading = memo(
153
142
  />
154
143
  );
155
144
  }
156
- })
145
+ }),
157
146
  );
158
147
 
159
148
  const Heading = memo(
160
149
  forwardRef<HTMLHeadingElement, IHeadingProps>(function Heading(
161
150
  { className, size = 'lg', as: AsComp, ...props },
162
- ref
151
+ ref,
163
152
  ) {
164
- const {
165
- isTruncated,
166
- bold,
167
- underline,
168
- strikeThrough,
169
- sub,
170
- italic,
171
- highlight,
172
- } = props;
153
+ const { isTruncated, bold, underline, strikeThrough, sub, italic, highlight } = props;
173
154
 
174
155
  if (AsComp) {
175
156
  return (
@@ -191,10 +172,8 @@ const Heading = memo(
191
172
  );
192
173
  }
193
174
 
194
- return (
195
- <MappedHeading className={className} size={size} ref={ref} {...props} />
196
- );
197
- })
175
+ return <MappedHeading className={className} size={size} ref={ref} {...props} />;
176
+ }),
198
177
  );
199
178
 
200
179
  Heading.displayName = 'Heading';
@@ -33,11 +33,11 @@ export const headingStyle = tva({
33
33
  '4xl': 'text-5xl',
34
34
  '3xl': 'text-4xl',
35
35
  '2xl': 'text-3xl',
36
- 'xl': 'text-2xl',
37
- 'lg': 'text-xl',
38
- 'md': 'text-lg',
39
- 'sm': 'text-base',
40
- 'xs': 'text-sm',
36
+ xl: 'text-2xl',
37
+ lg: 'text-xl',
38
+ md: 'text-lg',
39
+ sm: 'text-base',
40
+ xs: 'text-sm',
41
41
  },
42
42
  },
43
43
  });
@@ -6,21 +6,22 @@ import { hstackStyle } from './styles';
6
6
 
7
7
  type IHStackProps = ViewProps & VariantProps<typeof hstackStyle>;
8
8
 
9
- const HStack = React.forwardRef<React.ComponentRef<typeof View>, IHStackProps>(
10
- function HStack({ className, space, reversed, ...props }, ref) {
11
- return (
12
- <View
13
- className={hstackStyle({
14
- space,
15
- reversed: reversed as boolean,
16
- class: className,
17
- })}
18
- {...props}
19
- ref={ref}
20
- />
21
- );
22
- }
23
- );
9
+ const HStack = React.forwardRef<React.ComponentRef<typeof View>, IHStackProps>(function HStack(
10
+ { className, space, reversed, ...props },
11
+ ref,
12
+ ) {
13
+ return (
14
+ <View
15
+ className={hstackStyle({
16
+ space,
17
+ reversed: reversed as boolean,
18
+ class: className,
19
+ })}
20
+ {...props}
21
+ ref={ref}
22
+ />
23
+ );
24
+ });
24
25
 
25
26
  HStack.displayName = 'HStack';
26
27
 
@@ -2,24 +2,24 @@ import React from 'react';
2
2
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
3
3
  import { hstackStyle } from './styles';
4
4
 
5
- type IHStackProps = React.ComponentPropsWithoutRef<'div'> &
6
- VariantProps<typeof hstackStyle>;
5
+ type IHStackProps = React.ComponentPropsWithoutRef<'div'> & VariantProps<typeof hstackStyle>;
7
6
 
8
- const HStack = React.forwardRef<React.ComponentRef<'div'>, IHStackProps>(
9
- function HStack({ className, space, reversed, ...props }, ref) {
10
- return (
11
- <div
12
- className={hstackStyle({
13
- space,
14
- reversed: reversed as boolean,
15
- class: className,
16
- })}
17
- {...props}
18
- ref={ref}
19
- />
20
- );
21
- }
22
- );
7
+ const HStack = React.forwardRef<React.ComponentRef<'div'>, IHStackProps>(function HStack(
8
+ { className, space, reversed, ...props },
9
+ ref,
10
+ ) {
11
+ return (
12
+ <div
13
+ className={hstackStyle({
14
+ space,
15
+ reversed: reversed as boolean,
16
+ class: className,
17
+ })}
18
+ {...props}
19
+ ref={ref}
20
+ />
21
+ );
22
+ });
23
23
 
24
24
  HStack.displayName = 'HStack';
25
25
 
@@ -9,11 +9,11 @@ export const hstackStyle = tva({
9
9
  base: `flex-row ${baseStyle}`,
10
10
  variants: {
11
11
  space: {
12
- 'xs': 'gap-1',
13
- 'sm': 'gap-2',
14
- 'md': 'gap-3',
15
- 'lg': 'gap-4',
16
- 'xl': 'gap-5',
12
+ xs: 'gap-1',
13
+ sm: 'gap-2',
14
+ md: 'gap-3',
15
+ lg: 'gap-4',
16
+ xl: 'gap-5',
17
17
  '2xl': 'gap-6',
18
18
  '3xl': 'gap-7',
19
19
  '4xl': 'gap-8',