@idealyst/components 1.1.6 → 1.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.
Files changed (104) hide show
  1. package/package.json +8 -3
  2. package/src/Accordion/Accordion.native.tsx +15 -9
  3. package/src/Accordion/Accordion.styles.tsx +193 -168
  4. package/src/Accordion/Accordion.web.tsx +12 -7
  5. package/src/ActivityIndicator/ActivityIndicator.native.tsx +3 -2
  6. package/src/ActivityIndicator/ActivityIndicator.styles.tsx +22 -11
  7. package/src/ActivityIndicator/ActivityIndicator.web.tsx +2 -2
  8. package/src/Alert/Alert.native.tsx +11 -10
  9. package/src/Alert/Alert.styles.tsx +162 -253
  10. package/src/Alert/Alert.web.tsx +6 -10
  11. package/src/Avatar/Avatar.native.tsx +5 -2
  12. package/src/Avatar/Avatar.styles.tsx +48 -18
  13. package/src/Avatar/Avatar.web.tsx +2 -2
  14. package/src/Badge/Badge.native.tsx +2 -2
  15. package/src/Badge/Badge.styles.tsx +37 -16
  16. package/src/Badge/Badge.web.tsx +6 -6
  17. package/src/Breadcrumb/Breadcrumb.native.tsx +12 -5
  18. package/src/Breadcrumb/Breadcrumb.styles.tsx +59 -58
  19. package/src/Breadcrumb/Breadcrumb.web.tsx +13 -6
  20. package/src/Button/Button.native.tsx +39 -14
  21. package/src/Button/Button.styles.tsx +106 -208
  22. package/src/Button/Button.web.tsx +10 -8
  23. package/src/Card/Card.native.tsx +14 -6
  24. package/src/Card/Card.styles.tsx +64 -62
  25. package/src/Card/Card.web.tsx +5 -4
  26. package/src/Checkbox/Checkbox.native.tsx +7 -3
  27. package/src/Checkbox/Checkbox.styles.tsx +49 -25
  28. package/src/Checkbox/Checkbox.web.tsx +3 -3
  29. package/src/Chip/Chip.native.tsx +5 -5
  30. package/src/Chip/Chip.styles.tsx +71 -21
  31. package/src/Chip/Chip.web.tsx +5 -5
  32. package/src/Dialog/Dialog.native.tsx +10 -4
  33. package/src/Dialog/Dialog.styles.tsx +130 -90
  34. package/src/Dialog/Dialog.web.tsx +4 -4
  35. package/src/Divider/Divider.native.tsx +29 -42
  36. package/src/Divider/Divider.styles.tsx +138 -242
  37. package/src/Divider/Divider.web.tsx +17 -14
  38. package/src/Icon/Icon.native.tsx +11 -3
  39. package/src/Icon/Icon.styles.tsx +10 -4
  40. package/src/Image/Image.styles.tsx +53 -37
  41. package/src/Input/Input.native.tsx +6 -7
  42. package/src/Input/Input.styles.tsx +194 -174
  43. package/src/Input/Input.web.tsx +5 -8
  44. package/src/Link/Link.native.tsx +4 -1
  45. package/src/List/List.styles.tsx +79 -105
  46. package/src/List/ListItem.native.tsx +5 -3
  47. package/src/List/ListItem.web.tsx +4 -3
  48. package/src/Menu/Menu.native.tsx +1 -1
  49. package/src/Menu/Menu.styles.tsx +53 -37
  50. package/src/Menu/Menu.web.tsx +2 -2
  51. package/src/Menu/MenuItem.native.tsx +5 -3
  52. package/src/Menu/MenuItem.styles.tsx +68 -69
  53. package/src/Menu/MenuItem.web.tsx +16 -3
  54. package/src/Popover/Popover.native.tsx +1 -1
  55. package/src/Popover/Popover.styles.tsx +40 -29
  56. package/src/Popover/Popover.web.tsx +1 -1
  57. package/src/Pressable/Pressable.native.tsx +3 -1
  58. package/src/Pressable/Pressable.styles.tsx +20 -13
  59. package/src/Pressable/Pressable.web.tsx +1 -1
  60. package/src/Progress/Progress.native.tsx +15 -6
  61. package/src/Progress/Progress.styles.tsx +125 -85
  62. package/src/Progress/Progress.web.tsx +10 -9
  63. package/src/RadioButton/RadioButton.native.tsx +8 -3
  64. package/src/RadioButton/RadioButton.styles.tsx +44 -37
  65. package/src/RadioButton/RadioButton.web.tsx +3 -3
  66. package/src/SVGImage/SVGImage.styles.tsx +28 -16
  67. package/src/Screen/Screen.native.tsx +23 -13
  68. package/src/Screen/Screen.styles.tsx +57 -46
  69. package/src/Screen/Screen.web.tsx +1 -1
  70. package/src/Select/Select.native.tsx +11 -5
  71. package/src/Select/Select.styles.tsx +72 -52
  72. package/src/Select/Select.web.tsx +5 -5
  73. package/src/Skeleton/Skeleton.styles.tsx +26 -14
  74. package/src/Slider/Slider.native.tsx +9 -5
  75. package/src/Slider/Slider.styles.tsx +59 -48
  76. package/src/Slider/Slider.web.tsx +5 -5
  77. package/src/Switch/Switch.native.tsx +6 -2
  78. package/src/Switch/Switch.styles.tsx +46 -19
  79. package/src/Switch/Switch.web.tsx +4 -4
  80. package/src/TabBar/TabBar.native.tsx +23 -31
  81. package/src/TabBar/TabBar.styles.tsx +215 -371
  82. package/src/TabBar/TabBar.web.tsx +21 -33
  83. package/src/Table/Table.native.tsx +1 -1
  84. package/src/Table/Table.styles.tsx +11 -4
  85. package/src/Table/Table.web.tsx +1 -1
  86. package/src/Text/Text.native.tsx +3 -4
  87. package/src/Text/Text.styles.tsx +7 -1
  88. package/src/Text/Text.web.tsx +1 -1
  89. package/src/TextArea/TextArea.styles.tsx +90 -58
  90. package/src/Tooltip/Tooltip.native.tsx +2 -2
  91. package/src/Tooltip/Tooltip.styles.tsx +21 -12
  92. package/src/Tooltip/Tooltip.web.tsx +2 -2
  93. package/src/Video/Video.styles.tsx +39 -23
  94. package/src/View/View.native.tsx +4 -2
  95. package/src/View/View.styles.tsx +33 -22
  96. package/src/View/View.web.tsx +13 -2
  97. package/src/extensions/applyExtension.ts +210 -0
  98. package/src/extensions/extendComponent.ts +377 -0
  99. package/src/extensions/index.ts +102 -0
  100. package/src/extensions/types.ts +497 -0
  101. package/src/globals.ts +16 -0
  102. package/src/index.native.ts +4 -0
  103. package/src/index.ts +28 -0
  104. package/src/utils/deepMerge.ts +54 -2
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Component Style Extensions
3
+ *
4
+ * This module provides a type-safe way to globally customize component styles.
5
+ *
6
+ * @example Basic usage
7
+ * ```typescript
8
+ * import { extendComponent } from '@idealyst/components';
9
+ *
10
+ * // Add shadows and rounded corners to all buttons
11
+ * extendComponent('Button', {
12
+ * button: {
13
+ * borderRadius: 20,
14
+ * shadowColor: '#000',
15
+ * shadowOpacity: 0.1,
16
+ * shadowRadius: 4,
17
+ * },
18
+ * });
19
+ * ```
20
+ *
21
+ * @example Theme-aware extensions
22
+ * ```typescript
23
+ * extendComponent('Card', (theme) => ({
24
+ * card: {
25
+ * ...theme.shadows.md,
26
+ * borderColor: theme.colors.border.primary,
27
+ * },
28
+ * }));
29
+ * ```
30
+ *
31
+ * @module
32
+ */
33
+
34
+ // Public API
35
+ export {
36
+ // Extension functions
37
+ extendComponent,
38
+ clearExtension,
39
+ clearAllExtensions,
40
+ hasExtension,
41
+ getExtendedComponents,
42
+ getExtensionCount,
43
+ // Replacement functions
44
+ replaceStyles,
45
+ clearReplacement,
46
+ clearAllReplacements,
47
+ hasReplacement,
48
+ } from './extendComponent';
49
+
50
+ // Internal API (for component stylesheets)
51
+ export { getExtension, getReplacement } from './extendComponent';
52
+ export {
53
+ withExtension,
54
+ withSimpleExtension,
55
+ normalizeStyleFn,
56
+ normalizeSimpleStyleFn,
57
+ applyExtensions,
58
+ } from './applyExtension';
59
+
60
+ // Types
61
+ export type {
62
+ ComponentStyleElements,
63
+ ComponentStyleExtensions,
64
+ ComponentName,
65
+ StyleExtension,
66
+ ElementStyle,
67
+ Styles,
68
+ // Individual component styleable elements
69
+ ButtonStyleableElements,
70
+ CardStyleableElements,
71
+ InputStyleableElements,
72
+ ChipStyleableElements,
73
+ AlertStyleableElements,
74
+ SwitchStyleableElements,
75
+ SelectStyleableElements,
76
+ BadgeStyleableElements,
77
+ AvatarStyleableElements,
78
+ ProgressStyleableElements,
79
+ CheckboxStyleableElements,
80
+ RadioButtonStyleableElements,
81
+ SliderStyleableElements,
82
+ TextAreaStyleableElements,
83
+ AccordionStyleableElements,
84
+ DialogStyleableElements,
85
+ MenuStyleableElements,
86
+ MenuItemStyleableElements,
87
+ ListStyleableElements,
88
+ TabBarStyleableElements,
89
+ TableStyleableElements,
90
+ TooltipStyleableElements,
91
+ PopoverStyleableElements,
92
+ BreadcrumbStyleableElements,
93
+ ActivityIndicatorStyleableElements,
94
+ SkeletonStyleableElements,
95
+ DividerStyleableElements,
96
+ TextStyleableElements,
97
+ ViewStyleableElements,
98
+ IconStyleableElements,
99
+ ImageStyleableElements,
100
+ PressableStyleableElements,
101
+ ScreenStyleableElements,
102
+ } from './types';
@@ -0,0 +1,497 @@
1
+ import { Theme } from '@idealyst/theme';
2
+ import type { ViewStyle, TextStyle, ImageStyle } from 'react-native';
3
+
4
+ /**
5
+ * Generic styles type that covers most style properties.
6
+ * This is intentionally broad to allow flexibility in extensions.
7
+ */
8
+ export type Styles = ViewStyle & TextStyle & Partial<ImageStyle> & Record<string, any>;
9
+
10
+ /**
11
+ * An element style in an extension can be either:
12
+ * - A static styles object
13
+ * - A function that receives props and returns styles (for prop-aware extensions)
14
+ */
15
+ export type ElementStyle = Styles | ((props: any) => Styles);
16
+
17
+ /**
18
+ * A style extension can be either:
19
+ * - A partial style object (with static or function element styles)
20
+ * - A function that receives the theme and returns partial styles
21
+ */
22
+ export type StyleExtension<T> = Partial<T> | ((theme: Theme) => Partial<T>);
23
+
24
+ // ============================================================================
25
+ // Component Styleable Elements
26
+ // Each type defines the valid styleable elements for a component.
27
+ // These are derived from the XxxStylesheet types in @idealyst/theme/components
28
+ // ============================================================================
29
+
30
+ /**
31
+ * Button styleable elements.
32
+ * Each element can be either a static styles object or a function (props) => styles.
33
+ * @see ButtonStylesheet in @idealyst/theme/components/button
34
+ */
35
+ export type ButtonStyleableElements = {
36
+ button: ElementStyle;
37
+ text: ElementStyle;
38
+ icon: ElementStyle;
39
+ iconContainer: ElementStyle;
40
+ };
41
+
42
+ /**
43
+ * Card styleable elements.
44
+ * @see CardStylesheet in @idealyst/theme/components/card
45
+ */
46
+ export type CardStyleableElements = {
47
+ card: Styles;
48
+ };
49
+
50
+ /**
51
+ * Input styleable elements.
52
+ * @see InputStylesheet in @idealyst/theme/components/input
53
+ */
54
+ export type InputStyleableElements = {
55
+ container: Styles;
56
+ leftIconContainer: Styles;
57
+ rightIconContainer: Styles;
58
+ leftIcon: Styles;
59
+ rightIcon: Styles;
60
+ passwordToggle: Styles;
61
+ passwordToggleIcon: Styles;
62
+ input: Styles;
63
+ };
64
+
65
+ /**
66
+ * Chip styleable elements.
67
+ * @see ChipStylesheet in @idealyst/theme/components/chip
68
+ */
69
+ export type ChipStyleableElements = {
70
+ container: Styles;
71
+ label: Styles;
72
+ icon: Styles;
73
+ deleteButton: Styles;
74
+ deleteIcon: Styles;
75
+ };
76
+
77
+ /**
78
+ * Alert styleable elements.
79
+ * @see AlertStylesheet in @idealyst/theme/components/alert
80
+ */
81
+ export type AlertStyleableElements = {
82
+ container: Styles;
83
+ iconContainer: Styles;
84
+ content: Styles;
85
+ title: Styles;
86
+ message: Styles;
87
+ actions: Styles;
88
+ closeButton: Styles;
89
+ closeIcon: Styles;
90
+ };
91
+
92
+ /**
93
+ * Switch styleable elements.
94
+ * @see SwitchStylesheet in @idealyst/theme/components/switch
95
+ */
96
+ export type SwitchStyleableElements = {
97
+ container: Styles;
98
+ switchContainer: Styles;
99
+ switchTrack: Styles;
100
+ switchThumb: Styles;
101
+ thumbIcon: Styles;
102
+ label: Styles;
103
+ };
104
+
105
+ /**
106
+ * Select styleable elements.
107
+ * @see SelectStylesheet in @idealyst/theme/components/select
108
+ */
109
+ export type SelectStyleableElements = {
110
+ container: Styles;
111
+ label: Styles;
112
+ trigger: Styles;
113
+ triggerContent: Styles;
114
+ triggerText: Styles;
115
+ placeholder: Styles;
116
+ icon: Styles;
117
+ chevron: Styles;
118
+ chevronOpen: Styles;
119
+ dropdown: Styles;
120
+ searchContainer: Styles;
121
+ searchInput: Styles;
122
+ optionsList: Styles;
123
+ option: Styles;
124
+ optionContent: Styles;
125
+ optionIcon: Styles;
126
+ optionText: Styles;
127
+ optionTextDisabled: Styles;
128
+ helperText: Styles;
129
+ overlay: Styles;
130
+ };
131
+
132
+ /**
133
+ * Badge styleable elements.
134
+ * @see BadgeStylesheet in @idealyst/theme/components/badge
135
+ */
136
+ export type BadgeStyleableElements = {
137
+ container: Styles;
138
+ text: Styles;
139
+ };
140
+
141
+ /**
142
+ * Avatar styleable elements.
143
+ * @see AvatarStylesheet in @idealyst/theme/components/avatar
144
+ */
145
+ export type AvatarStyleableElements = {
146
+ container: Styles;
147
+ image: Styles;
148
+ fallback: Styles;
149
+ fallbackText: Styles;
150
+ };
151
+
152
+ /**
153
+ * Progress styleable elements.
154
+ * @see ProgressStylesheet in @idealyst/theme/components/progress
155
+ */
156
+ export type ProgressStyleableElements = {
157
+ container: Styles;
158
+ track: Styles;
159
+ fill: Styles;
160
+ label: Styles;
161
+ };
162
+
163
+ /**
164
+ * Checkbox styleable elements.
165
+ * @see CheckboxStylesheet in @idealyst/theme/components/checkbox
166
+ */
167
+ export type CheckboxStyleableElements = {
168
+ container: Styles;
169
+ checkbox: Styles;
170
+ checkIcon: Styles;
171
+ label: Styles;
172
+ };
173
+
174
+ /**
175
+ * RadioButton styleable elements.
176
+ * @see RadioButtonStylesheet in @idealyst/theme/components/radio-button
177
+ */
178
+ export type RadioButtonStyleableElements = {
179
+ container: Styles;
180
+ radio: Styles;
181
+ radioDot: Styles;
182
+ label: Styles;
183
+ };
184
+
185
+ /**
186
+ * Slider styleable elements.
187
+ * @see SliderStylesheet in @idealyst/theme/components/slider
188
+ */
189
+ export type SliderStyleableElements = {
190
+ container: Styles;
191
+ track: Styles;
192
+ trackFill: Styles;
193
+ thumb: Styles;
194
+ thumbIcon: Styles;
195
+ mark: Styles;
196
+ label: Styles;
197
+ };
198
+
199
+ /**
200
+ * TextArea styleable elements.
201
+ * @see TextAreaStylesheet in @idealyst/theme/components/textarea
202
+ */
203
+ export type TextAreaStyleableElements = {
204
+ container: Styles;
205
+ input: Styles;
206
+ label: Styles;
207
+ helperText: Styles;
208
+ };
209
+
210
+ /**
211
+ * Accordion styleable elements.
212
+ * @see AccordionStylesheet in @idealyst/theme/components/accordion
213
+ */
214
+ export type AccordionStyleableElements = {
215
+ container: Styles;
216
+ item: Styles;
217
+ header: Styles;
218
+ headerText: Styles;
219
+ icon: Styles;
220
+ content: Styles;
221
+ };
222
+
223
+ /**
224
+ * Dialog styleable elements.
225
+ * @see DialogStylesheet in @idealyst/theme/components/dialog
226
+ */
227
+ export type DialogStyleableElements = {
228
+ overlay: Styles;
229
+ container: Styles;
230
+ header: Styles;
231
+ title: Styles;
232
+ closeButton: Styles;
233
+ closeIcon: Styles;
234
+ content: Styles;
235
+ footer: Styles;
236
+ };
237
+
238
+ /**
239
+ * Menu styleable elements.
240
+ * @see MenuStylesheet in @idealyst/theme/components/menu
241
+ */
242
+ export type MenuStyleableElements = {
243
+ container: Styles;
244
+ trigger: Styles;
245
+ dropdown: Styles;
246
+ item: Styles;
247
+ itemIcon: Styles;
248
+ itemText: Styles;
249
+ divider: Styles;
250
+ };
251
+
252
+ /**
253
+ * MenuItem styleable elements.
254
+ * @see MenuItemStylesheet in @idealyst/theme/components/menu-item
255
+ */
256
+ export type MenuItemStyleableElements = {
257
+ container: Styles;
258
+ icon: Styles;
259
+ text: Styles;
260
+ };
261
+
262
+ /**
263
+ * List styleable elements.
264
+ * @see ListStylesheet in @idealyst/theme/components/list
265
+ */
266
+ export type ListStyleableElements = {
267
+ container: Styles;
268
+ item: Styles;
269
+ itemIcon: Styles;
270
+ itemText: Styles;
271
+ itemDescription: Styles;
272
+ itemRight: Styles;
273
+ section: Styles;
274
+ sectionHeader: Styles;
275
+ divider: Styles;
276
+ };
277
+
278
+ /**
279
+ * TabBar styleable elements.
280
+ * @see TabBarStylesheet in @idealyst/theme/components/tab-bar
281
+ */
282
+ export type TabBarStyleableElements = {
283
+ container: Styles;
284
+ tab: Styles;
285
+ tabIcon: Styles;
286
+ tabText: Styles;
287
+ indicator: Styles;
288
+ };
289
+
290
+ /**
291
+ * Table styleable elements.
292
+ * @see TableStylesheet in @idealyst/theme/components/table
293
+ */
294
+ export type TableStyleableElements = {
295
+ container: Styles;
296
+ header: Styles;
297
+ headerCell: Styles;
298
+ headerText: Styles;
299
+ row: Styles;
300
+ cell: Styles;
301
+ cellText: Styles;
302
+ };
303
+
304
+ /**
305
+ * Tooltip styleable elements.
306
+ * @see TooltipStylesheet in @idealyst/theme/components/tooltip
307
+ */
308
+ export type TooltipStyleableElements = {
309
+ container: Styles;
310
+ content: Styles;
311
+ text: Styles;
312
+ arrow: Styles;
313
+ };
314
+
315
+ /**
316
+ * Popover styleable elements.
317
+ * @see PopoverStylesheet in @idealyst/theme/components/popover
318
+ */
319
+ export type PopoverStyleableElements = {
320
+ overlay: Styles;
321
+ container: Styles;
322
+ content: Styles;
323
+ arrow: Styles;
324
+ };
325
+
326
+ /**
327
+ * Breadcrumb styleable elements.
328
+ * @see BreadcrumbStylesheet in @idealyst/theme/components/breadcrumb
329
+ */
330
+ export type BreadcrumbStyleableElements = {
331
+ container: Styles;
332
+ item: Styles;
333
+ itemText: Styles;
334
+ separator: Styles;
335
+ };
336
+
337
+ /**
338
+ * ActivityIndicator styleable elements.
339
+ * @see ActivityIndicatorStylesheet in @idealyst/theme/components/activity-indicator
340
+ */
341
+ export type ActivityIndicatorStyleableElements = {
342
+ container: Styles;
343
+ spinner: Styles;
344
+ };
345
+
346
+ /**
347
+ * Skeleton styleable elements.
348
+ * @see SkeletonStylesheet in @idealyst/theme/components/skeleton
349
+ */
350
+ export type SkeletonStyleableElements = {
351
+ container: Styles;
352
+ bone: Styles;
353
+ };
354
+
355
+ /**
356
+ * Divider styleable elements.
357
+ * @see DividerStylesheet in @idealyst/theme/components/divider
358
+ */
359
+ export type DividerStyleableElements = {
360
+ divider: Styles;
361
+ };
362
+
363
+ /**
364
+ * Text styleable elements.
365
+ * @see TextStylesheet in @idealyst/theme/components/text
366
+ */
367
+ export type TextStyleableElements = {
368
+ text: Styles;
369
+ };
370
+
371
+ /**
372
+ * View styleable elements.
373
+ * @see ViewStylesheet in @idealyst/theme/components/view
374
+ */
375
+ export type ViewStyleableElements = {
376
+ view: Styles;
377
+ };
378
+
379
+ /**
380
+ * Icon styleable elements.
381
+ * @see IconStylesheet in @idealyst/theme/components/icon
382
+ */
383
+ export type IconStyleableElements = {
384
+ icon: Styles;
385
+ };
386
+
387
+ /**
388
+ * Image styleable elements.
389
+ * @see ImageStylesheet in @idealyst/theme/components/image
390
+ */
391
+ export type ImageStyleableElements = {
392
+ container: Styles;
393
+ image: Styles;
394
+ };
395
+
396
+ /**
397
+ * Pressable styleable elements.
398
+ * @see PressableStylesheet in @idealyst/theme/components/pressable
399
+ */
400
+ export type PressableStyleableElements = {
401
+ pressable: Styles;
402
+ };
403
+
404
+ /**
405
+ * Screen styleable elements.
406
+ * @see ScreenStylesheet in @idealyst/theme/components/screen
407
+ */
408
+ export type ScreenStyleableElements = {
409
+ container: Styles;
410
+ content: Styles;
411
+ };
412
+
413
+ // ============================================================================
414
+ // Master Component Style Elements Map
415
+ // ============================================================================
416
+
417
+ /**
418
+ * Extension interface for custom components.
419
+ * Users can extend this via declaration merging to add their own components.
420
+ *
421
+ * @example
422
+ * ```typescript
423
+ * // In your app's type declarations (e.g., src/types/components.d.ts)
424
+ * declare module '@idealyst/components' {
425
+ * interface ComponentStyleExtensions {
426
+ * MyCustomButton: {
427
+ * container: Styles;
428
+ * label: Styles;
429
+ * icon: Styles;
430
+ * };
431
+ * MyCard: {
432
+ * wrapper: Styles;
433
+ * header: Styles;
434
+ * body: Styles;
435
+ * };
436
+ * }
437
+ * }
438
+ *
439
+ * // Then use extendComponent with your custom component
440
+ * extendComponent('MyCustomButton', {
441
+ * container: { borderRadius: 20 },
442
+ * label: { fontWeight: 'bold' },
443
+ * });
444
+ * ```
445
+ */
446
+ export interface ComponentStyleExtensions {}
447
+
448
+ /**
449
+ * Built-in component style elements.
450
+ * Maps component names to their styleable elements.
451
+ */
452
+ interface BuiltInComponentStyleElements {
453
+ Button: ButtonStyleableElements;
454
+ Card: CardStyleableElements;
455
+ Input: InputStyleableElements;
456
+ Chip: ChipStyleableElements;
457
+ Alert: AlertStyleableElements;
458
+ Switch: SwitchStyleableElements;
459
+ Select: SelectStyleableElements;
460
+ Badge: BadgeStyleableElements;
461
+ Avatar: AvatarStyleableElements;
462
+ Progress: ProgressStyleableElements;
463
+ Checkbox: CheckboxStyleableElements;
464
+ RadioButton: RadioButtonStyleableElements;
465
+ Slider: SliderStyleableElements;
466
+ TextArea: TextAreaStyleableElements;
467
+ Accordion: AccordionStyleableElements;
468
+ Dialog: DialogStyleableElements;
469
+ Menu: MenuStyleableElements;
470
+ MenuItem: MenuItemStyleableElements;
471
+ List: ListStyleableElements;
472
+ TabBar: TabBarStyleableElements;
473
+ Table: TableStyleableElements;
474
+ Tooltip: TooltipStyleableElements;
475
+ Popover: PopoverStyleableElements;
476
+ Breadcrumb: BreadcrumbStyleableElements;
477
+ ActivityIndicator: ActivityIndicatorStyleableElements;
478
+ Skeleton: SkeletonStyleableElements;
479
+ Divider: DividerStyleableElements;
480
+ Text: TextStyleableElements;
481
+ View: ViewStyleableElements;
482
+ Icon: IconStyleableElements;
483
+ Image: ImageStyleableElements;
484
+ Pressable: PressableStyleableElements;
485
+ Screen: ScreenStyleableElements;
486
+ }
487
+
488
+ /**
489
+ * Combined component style elements including built-in and custom components.
490
+ * This is the source of truth for type-safe component extensions.
491
+ */
492
+ export type ComponentStyleElements = BuiltInComponentStyleElements & ComponentStyleExtensions;
493
+
494
+ /**
495
+ * All available component names for extensions.
496
+ */
497
+ export type ComponentName = keyof ComponentStyleElements;
package/src/globals.ts ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Global type declarations for the components package.
3
+ * Sets up Unistyles theme types.
4
+ */
5
+ import { Theme } from '@idealyst/theme';
6
+
7
+ // Declare UnistylesThemes to match @idealyst/theme
8
+ declare module 'react-native-unistyles' {
9
+ export interface UnistylesThemes {
10
+ light: Theme;
11
+ dark: Theme;
12
+ }
13
+ }
14
+
15
+ // Force this module to be included
16
+ export {};
@@ -101,6 +101,9 @@ export * from './Chip/types';
101
101
  export { default as Breadcrumb } from './Breadcrumb';
102
102
  export * from './Breadcrumb/types';
103
103
 
104
+ export { default as Link } from './Link';
105
+ export * from './Link/types';
106
+
104
107
  export type { ButtonProps } from './Button/types';
105
108
  export type { TextProps } from './Text/types';
106
109
  export type { ViewProps } from './View/types';
@@ -133,6 +136,7 @@ export type { AlertProps } from './Alert/types';
133
136
  export type { SkeletonProps, SkeletonGroupProps, SkeletonShape, SkeletonAnimation } from './Skeleton/types';
134
137
  export type { ChipProps, ChipSize, ChipIntent } from './Chip/types';
135
138
  export type { BreadcrumbProps, BreadcrumbItem } from './Breadcrumb/types';
139
+ export type { LinkProps } from './Link/types';
136
140
 
137
141
  // Event utilities
138
142
  export * from './utils/events';
package/src/index.ts CHANGED
@@ -1,3 +1,6 @@
1
+ // Import globals to set up Unistyles theme types
2
+ import './globals';
3
+
1
4
  import useMergeRefs from './hooks/useMergeRefs';
2
5
 
3
6
  export { default as Button } from './Button';
@@ -149,4 +152,29 @@ export * from './utils/events';
149
152
  export * from './utils/viewStyleProps';
150
153
  export * from './utils/buildViewStyleVariants';
151
154
 
155
+ // Component style extensions
156
+ export {
157
+ extendComponent,
158
+ clearExtension,
159
+ clearAllExtensions,
160
+ hasExtension,
161
+ getExtendedComponents,
162
+ getExtensionCount,
163
+ } from './extensions';
164
+
165
+ export type {
166
+ ComponentStyleElements,
167
+ ComponentStyleExtensions,
168
+ ComponentName,
169
+ StyleExtension,
170
+ Styles,
171
+ ButtonStyleableElements,
172
+ CardStyleableElements,
173
+ InputStyleableElements,
174
+ ChipStyleableElements,
175
+ AlertStyleableElements,
176
+ SwitchStyleableElements,
177
+ SelectStyleableElements,
178
+ } from './extensions';
179
+
152
180
  export type { AppTheme } from '@idealyst/theme';