@impulse-ui-native/primitives 2.1.0 → 2.1.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 (112) hide show
  1. package/dist/components/atoms/button.d.mts +10 -0
  2. package/dist/components/atoms/button.js +60 -0
  3. package/dist/components/atoms/button.js.map +1 -0
  4. package/dist/components/atoms/icon-button.d.mts +12 -0
  5. package/dist/components/atoms/icon-button.js +51 -0
  6. package/dist/components/atoms/icon-button.js.map +1 -0
  7. package/dist/components/atoms/index.d.mts +18 -0
  8. package/dist/components/atoms/index.js +17 -0
  9. package/dist/components/atoms/index.js.map +1 -0
  10. package/dist/components/atoms/pressable.d.mts +9 -0
  11. package/dist/components/atoms/pressable.js +52 -0
  12. package/dist/components/atoms/pressable.js.map +1 -0
  13. package/dist/components/atoms/safe-area-view.d.mts +8 -0
  14. package/dist/components/atoms/safe-area-view.js +103 -0
  15. package/dist/components/atoms/safe-area-view.js.map +1 -0
  16. package/dist/components/atoms/tag.d.mts +9 -0
  17. package/dist/components/atoms/tag.js +82 -0
  18. package/dist/components/atoms/tag.js.map +1 -0
  19. package/dist/components/atoms/typography.d.mts +99 -0
  20. package/dist/components/atoms/typography.js +184 -0
  21. package/dist/components/atoms/typography.js.map +1 -0
  22. package/dist/components/atoms/view.d.mts +8 -0
  23. package/dist/components/atoms/view.js +27 -0
  24. package/dist/components/atoms/view.js.map +1 -0
  25. package/dist/components/controls/addon.d.mts +11 -0
  26. package/dist/components/controls/addon.js +72 -0
  27. package/dist/components/controls/addon.js.map +1 -0
  28. package/dist/components/controls/container.d.mts +11 -0
  29. package/dist/components/controls/container.js +54 -0
  30. package/dist/components/controls/container.js.map +1 -0
  31. package/dist/components/controls/control.d.mts +23 -0
  32. package/dist/components/controls/control.js +26 -0
  33. package/dist/components/controls/control.js.map +1 -0
  34. package/dist/components/controls/error.d.mts +11 -0
  35. package/dist/components/controls/error.js +33 -0
  36. package/dist/components/controls/error.js.map +1 -0
  37. package/dist/components/controls/index.d.mts +10 -0
  38. package/dist/components/controls/index.js +7 -0
  39. package/dist/components/controls/index.js.map +1 -0
  40. package/dist/components/controls/input.d.mts +11 -0
  41. package/dist/components/controls/input.js +63 -0
  42. package/dist/components/controls/input.js.map +1 -0
  43. package/dist/components/controls/label.d.mts +11 -0
  44. package/dist/components/controls/label.js +42 -0
  45. package/dist/components/controls/label.js.map +1 -0
  46. package/dist/components/controls/loader.d.mts +6 -0
  47. package/dist/components/controls/loader.js +10 -0
  48. package/dist/components/controls/loader.js.map +1 -0
  49. package/dist/components/controls/placeholder.d.mts +11 -0
  50. package/dist/components/controls/placeholder.js +51 -0
  51. package/dist/components/controls/placeholder.js.map +1 -0
  52. package/dist/components/controls/provider.d.mts +13 -0
  53. package/dist/components/controls/provider.js +19 -0
  54. package/dist/components/controls/provider.js.map +1 -0
  55. package/dist/components/controls/root.d.mts +9 -0
  56. package/dist/components/controls/root.js +18 -0
  57. package/dist/components/controls/root.js.map +1 -0
  58. package/dist/components/controls/value.d.mts +11 -0
  59. package/dist/components/controls/value.js +36 -0
  60. package/dist/components/controls/value.js.map +1 -0
  61. package/dist/components/index.d.mts +22 -0
  62. package/dist/components/index.js +3 -0
  63. package/dist/components/index.js.map +1 -0
  64. package/dist/constants/control-container.constants.d.mts +6 -0
  65. package/dist/constants/control-container.constants.js +15 -0
  66. package/dist/constants/control-container.constants.js.map +1 -0
  67. package/dist/constants/index.d.mts +3 -0
  68. package/dist/constants/index.js +3 -0
  69. package/dist/constants/index.js.map +1 -0
  70. package/dist/constants/safe-area-view.constants.d.mts +14 -0
  71. package/dist/constants/safe-area-view.constants.js +17 -0
  72. package/dist/constants/safe-area-view.constants.js.map +1 -0
  73. package/dist/hocs/create-preset.hoc.d.mts +12 -0
  74. package/dist/hocs/create-preset.hoc.js +38 -0
  75. package/dist/hocs/create-preset.hoc.js.map +1 -0
  76. package/dist/hocs/index.d.mts +6 -0
  77. package/dist/hocs/index.js +5 -0
  78. package/dist/hocs/index.js.map +1 -0
  79. package/dist/index.d.mts +25 -241
  80. package/dist/index.js +4 -998
  81. package/dist/index.js.map +1 -1
  82. package/dist/types/button.types.d.mts +21 -0
  83. package/dist/types/button.types.js +1 -0
  84. package/dist/types/button.types.js.map +1 -0
  85. package/dist/types/control-components.types.d.mts +45 -0
  86. package/dist/types/control-components.types.js +1 -0
  87. package/dist/types/control-components.types.js.map +1 -0
  88. package/dist/types/icon-button.types.d.mts +15 -0
  89. package/dist/types/icon-button.types.js +1 -0
  90. package/dist/types/icon-button.types.js.map +1 -0
  91. package/dist/types/index.d.mts +12 -0
  92. package/dist/types/index.js +9 -0
  93. package/dist/types/index.js.map +1 -0
  94. package/dist/types/safe-area-view.types.d.mts +5 -0
  95. package/dist/types/safe-area-view.types.js +1 -0
  96. package/dist/types/safe-area-view.types.js.map +1 -0
  97. package/dist/types/tag.types.d.mts +22 -0
  98. package/dist/types/tag.types.js +1 -0
  99. package/dist/types/tag.types.js.map +1 -0
  100. package/dist/types/typography.types.d.mts +8 -0
  101. package/dist/types/typography.types.js +1 -0
  102. package/dist/types/typography.types.js.map +1 -0
  103. package/dist/types/view.types.d.mts +6 -0
  104. package/dist/types/view.types.js +1 -0
  105. package/dist/types/view.types.js.map +1 -0
  106. package/dist/utils/controls.utils.d.mts +13 -0
  107. package/dist/utils/controls.utils.js +18 -0
  108. package/dist/utils/controls.utils.js.map +1 -0
  109. package/dist/utils/index.d.mts +2 -0
  110. package/dist/utils/index.js +2 -0
  111. package/dist/utils/index.js.map +1 -0
  112. package/package.json +7 -6
@@ -0,0 +1,184 @@
1
+ import { createPreset } from "../../hocs";
2
+ const Typography = {
3
+ Master: createPreset(
4
+ (theme) => ({ fontWeight: theme.fontWeight.regular }),
5
+ "Master"
6
+ ),
7
+ DisplayLarge: createPreset(
8
+ (theme) => ({
9
+ fontWeight: theme.fontWeight.bold,
10
+ fontSize: theme.fontSize.colossal,
11
+ lineHeight: theme.lineHeight.colossal
12
+ }),
13
+ "DisplayLarge"
14
+ ),
15
+ DisplayMedium: createPreset(
16
+ (theme) => ({
17
+ fontWeight: theme.fontWeight.bold,
18
+ fontSize: theme.fontSize.giant,
19
+ lineHeight: theme.lineHeight.giant
20
+ }),
21
+ "DisplayMedium"
22
+ ),
23
+ DisplaySmall: createPreset(
24
+ (theme) => ({
25
+ fontWeight: theme.fontWeight.semiBold,
26
+ fontSize: theme.fontSize.huge,
27
+ lineHeight: theme.lineHeight.huge
28
+ }),
29
+ "DisplaySmall"
30
+ ),
31
+ Title1: createPreset(
32
+ (theme) => ({
33
+ fontWeight: theme.fontWeight.bold,
34
+ fontSize: theme.fontSize.xxxl,
35
+ lineHeight: theme.lineHeight.xxxl
36
+ }),
37
+ "Title1"
38
+ ),
39
+ Title2: createPreset(
40
+ (theme) => ({
41
+ fontWeight: theme.fontWeight.bold,
42
+ fontSize: theme.fontSize.xxl,
43
+ lineHeight: theme.lineHeight.xxl
44
+ }),
45
+ "Title2"
46
+ ),
47
+ Title3: createPreset(
48
+ (theme) => ({
49
+ fontWeight: theme.fontWeight.semiBold,
50
+ fontSize: theme.fontSize.xl,
51
+ lineHeight: theme.lineHeight.xl
52
+ }),
53
+ "Title3"
54
+ ),
55
+ Title4: createPreset(
56
+ (theme) => ({
57
+ fontWeight: theme.fontWeight.semiBold,
58
+ fontSize: theme.fontSize.lg,
59
+ lineHeight: theme.lineHeight.lg
60
+ }),
61
+ "Title4"
62
+ ),
63
+ Title5: createPreset(
64
+ (theme) => ({
65
+ fontWeight: theme.fontWeight.semiBold,
66
+ fontSize: theme.fontSize.md,
67
+ lineHeight: theme.lineHeight.md
68
+ }),
69
+ "Title5"
70
+ ),
71
+ Title6: createPreset(
72
+ (theme) => ({
73
+ fontWeight: theme.fontWeight.semiBold,
74
+ fontSize: theme.fontSize.sm,
75
+ lineHeight: theme.lineHeight.sm
76
+ }),
77
+ "Title6"
78
+ ),
79
+ Subtitle1: createPreset(
80
+ (theme) => ({
81
+ fontWeight: theme.fontWeight.medium,
82
+ fontSize: theme.fontSize.md,
83
+ lineHeight: theme.lineHeight.lg
84
+ }),
85
+ "Subtitle1"
86
+ ),
87
+ Subtitle2: createPreset(
88
+ (theme) => ({
89
+ fontWeight: theme.fontWeight.regular,
90
+ fontSize: theme.fontSize.sm,
91
+ lineHeight: theme.lineHeight.sm
92
+ }),
93
+ "Subtitle2"
94
+ ),
95
+ BodyLarge: createPreset(
96
+ (theme) => ({
97
+ fontWeight: theme.fontWeight.regular,
98
+ fontSize: theme.fontSize.md,
99
+ lineHeight: theme.lineHeight.lg
100
+ }),
101
+ "BodyLarge"
102
+ ),
103
+ Body: createPreset(
104
+ (theme) => ({
105
+ fontWeight: theme.fontWeight.regular,
106
+ fontSize: theme.fontSize.sm,
107
+ lineHeight: theme.lineHeight.sm
108
+ }),
109
+ "Body"
110
+ ),
111
+ BodySmall: createPreset(
112
+ (theme) => ({
113
+ fontWeight: theme.fontWeight.regular,
114
+ fontSize: theme.fontSize.xsm,
115
+ lineHeight: theme.lineHeight.xsm
116
+ }),
117
+ "BodySmall"
118
+ ),
119
+ Caption: createPreset(
120
+ (theme) => ({
121
+ fontWeight: theme.fontWeight.regular,
122
+ fontSize: theme.fontSize.xs,
123
+ lineHeight: theme.lineHeight.xs
124
+ }),
125
+ "Caption"
126
+ ),
127
+ Label: createPreset(
128
+ (theme) => ({
129
+ fontWeight: theme.fontWeight.medium,
130
+ fontSize: theme.fontSize.xsm,
131
+ lineHeight: theme.lineHeight.xsm
132
+ }),
133
+ "Label"
134
+ ),
135
+ Overline: createPreset(
136
+ (theme) => ({
137
+ fontWeight: theme.fontWeight.semiBold,
138
+ fontSize: theme.fontSize.xs,
139
+ lineHeight: theme.lineHeight.xs,
140
+ textTransform: "uppercase",
141
+ letterSpacing: 1
142
+ }),
143
+ "Overline"
144
+ ),
145
+ Helper: createPreset(
146
+ (theme) => ({
147
+ fontWeight: theme.fontWeight.regular,
148
+ fontSize: theme.fontSize.xsm,
149
+ lineHeight: theme.lineHeight.xsm
150
+ }),
151
+ "Helper"
152
+ ),
153
+ Code: createPreset(
154
+ (theme) => ({
155
+ fontFamily: "monospace",
156
+ fontSize: theme.fontSize.xsm,
157
+ lineHeight: theme.lineHeight.xsm
158
+ }),
159
+ "Code"
160
+ ),
161
+ Quote: createPreset(
162
+ (theme) => ({
163
+ fontWeight: theme.fontWeight.regular,
164
+ fontSize: theme.fontSize.md,
165
+ lineHeight: theme.lineHeight.lg,
166
+ fontStyle: "italic"
167
+ }),
168
+ "Quote"
169
+ ),
170
+ Eyebrow: createPreset(
171
+ (theme) => ({
172
+ fontWeight: theme.fontWeight.medium,
173
+ fontSize: theme.fontSize.xs,
174
+ lineHeight: theme.lineHeight.xs,
175
+ textTransform: "uppercase",
176
+ letterSpacing: 1
177
+ }),
178
+ "Eyebrow"
179
+ )
180
+ };
181
+ export {
182
+ Typography
183
+ };
184
+ //# sourceMappingURL=typography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/atoms/typography.tsx"],"sourcesContent":["import { createPreset } from \"../../hocs\";\n\nexport const Typography = {\n Master: createPreset(\n (theme) => ({ fontWeight: theme.fontWeight.regular }),\n \"Master\",\n ),\n\n DisplayLarge: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.colossal,\n lineHeight: theme.lineHeight.colossal,\n }),\n \"DisplayLarge\",\n ),\n\n DisplayMedium: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.giant,\n lineHeight: theme.lineHeight.giant,\n }),\n \"DisplayMedium\",\n ),\n\n DisplaySmall: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.semiBold,\n fontSize: theme.fontSize.huge,\n lineHeight: theme.lineHeight.huge,\n }),\n \"DisplaySmall\",\n ),\n\n Title1: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.xxxl,\n lineHeight: theme.lineHeight.xxxl,\n }),\n \"Title1\",\n ),\n\n Title2: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.bold,\n fontSize: theme.fontSize.xxl,\n lineHeight: theme.lineHeight.xxl,\n }),\n \"Title2\",\n ),\n\n Title3: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.semiBold,\n fontSize: theme.fontSize.xl,\n lineHeight: theme.lineHeight.xl,\n }),\n \"Title3\",\n ),\n\n Title4: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.semiBold,\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n }),\n \"Title4\",\n ),\n\n Title5: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.semiBold,\n fontSize: theme.fontSize.md,\n lineHeight: theme.lineHeight.md,\n }),\n \"Title5\",\n ),\n\n Title6: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.semiBold,\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n }),\n \"Title6\",\n ),\n\n Subtitle1: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.medium,\n fontSize: theme.fontSize.md,\n lineHeight: theme.lineHeight.lg,\n }),\n \"Subtitle1\",\n ),\n\n Subtitle2: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.regular,\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n }),\n \"Subtitle2\",\n ),\n\n BodyLarge: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.regular,\n fontSize: theme.fontSize.md,\n lineHeight: theme.lineHeight.lg,\n }),\n \"BodyLarge\",\n ),\n\n Body: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.regular,\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n }),\n \"Body\",\n ),\n\n BodySmall: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.regular,\n fontSize: theme.fontSize.xsm,\n lineHeight: theme.lineHeight.xsm,\n }),\n \"BodySmall\",\n ),\n\n Caption: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.regular,\n fontSize: theme.fontSize.xs,\n lineHeight: theme.lineHeight.xs,\n }),\n \"Caption\",\n ),\n\n Label: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.medium,\n fontSize: theme.fontSize.xsm,\n lineHeight: theme.lineHeight.xsm,\n }),\n \"Label\",\n ),\n\n Overline: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.semiBold,\n fontSize: theme.fontSize.xs,\n lineHeight: theme.lineHeight.xs,\n textTransform: \"uppercase\",\n letterSpacing: 1,\n }),\n \"Overline\",\n ),\n\n Helper: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.regular,\n fontSize: theme.fontSize.xsm,\n lineHeight: theme.lineHeight.xsm,\n }),\n \"Helper\",\n ),\n\n Code: createPreset(\n (theme) => ({\n fontFamily: \"monospace\",\n fontSize: theme.fontSize.xsm,\n lineHeight: theme.lineHeight.xsm,\n }),\n \"Code\",\n ),\n\n Quote: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.regular,\n fontSize: theme.fontSize.md,\n lineHeight: theme.lineHeight.lg,\n fontStyle: \"italic\",\n }),\n \"Quote\",\n ),\n\n Eyebrow: createPreset(\n (theme) => ({\n fontWeight: theme.fontWeight.medium,\n fontSize: theme.fontSize.xs,\n lineHeight: theme.lineHeight.xs,\n textTransform: \"uppercase\",\n letterSpacing: 1,\n }),\n \"Eyebrow\",\n ),\n};\n\nexport type TypographyComponent = (typeof Typography)[keyof typeof Typography];\n"],"mappings":"AAAA,SAAS,oBAAoB;AAEtB,MAAM,aAAa;AAAA,EACxB,QAAQ;AAAA,IACN,CAAC,WAAW,EAAE,YAAY,MAAM,WAAW,QAAQ;AAAA,IACnD;AAAA,EACF;AAAA,EAEA,cAAc;AAAA,IACZ,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,eAAe;AAAA,IACb,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,cAAc;AAAA,IACZ,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,WAAW;AAAA,IACT,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,WAAW;AAAA,IACT,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,WAAW;AAAA,IACT,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,MAAM;AAAA,IACJ,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,WAAW;AAAA,IACT,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,SAAS;AAAA,IACP,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAO;AAAA,IACL,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,UAAU;AAAA,IACR,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,MAC7B,eAAe;AAAA,MACf,eAAe;AAAA,IACjB;AAAA,IACA;AAAA,EACF;AAAA,EAEA,QAAQ;AAAA,IACN,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,MAAM;AAAA,IACJ,CAAC,WAAW;AAAA,MACV,YAAY;AAAA,MACZ,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,IAC/B;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAO;AAAA,IACL,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,MAC7B,WAAW;AAAA,IACb;AAAA,IACA;AAAA,EACF;AAAA,EAEA,SAAS;AAAA,IACP,CAAC,WAAW;AAAA,MACV,YAAY,MAAM,WAAW;AAAA,MAC7B,UAAU,MAAM,SAAS;AAAA,MACzB,YAAY,MAAM,WAAW;AAAA,MAC7B,eAAe;AAAA,MACf,eAAe;AAAA,IACjB;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ import * as react from 'react';
2
+ import * as _impulse_ui_native_theme from '@impulse-ui-native/theme';
3
+ import * as react_native from 'react-native';
4
+ import { View as View$1 } from 'react-native';
5
+
6
+ declare const View: react.NamedExoticComponent<react_native.ViewProps & _impulse_ui_native_theme.SpacingProps & _impulse_ui_native_theme.ColorProps & _impulse_ui_native_theme.ShadowProps & _impulse_ui_native_theme.BorderProps & _impulse_ui_native_theme.FlexProps & _impulse_ui_native_theme.DimensionProps & react.RefAttributes<View$1>>;
7
+
8
+ export { View };
@@ -0,0 +1,27 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef, memo, useMemo } from "react";
3
+ import { View as NativeView, StyleSheet } from "react-native";
4
+ import {
5
+ getShadowStyle,
6
+ useColors,
7
+ useStyleProps
8
+ } from "@impulse-ui-native/theme";
9
+ const View = memo(
10
+ forwardRef(function View2(props, ref) {
11
+ const { style, shadow, shadowPosition, ...rest } = props;
12
+ const colors = useColors();
13
+ const extractedStyleProps = useStyleProps(props);
14
+ const viewStyle = useMemo(() => {
15
+ return StyleSheet.flatten([
16
+ getShadowStyle(shadow, shadowPosition, colors),
17
+ extractedStyleProps,
18
+ style
19
+ ]);
20
+ }, [extractedStyleProps, style, shadow, shadowPosition, colors]);
21
+ return /* @__PURE__ */ jsx(NativeView, { ...rest, style: viewStyle, ref });
22
+ })
23
+ );
24
+ export {
25
+ View
26
+ };
27
+ //# sourceMappingURL=view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/atoms/view.tsx"],"sourcesContent":["import { forwardRef, memo, useMemo } from \"react\";\nimport { View as NativeView, StyleSheet } from \"react-native\";\n\nimport {\n getShadowStyle,\n useColors,\n useStyleProps,\n} from \"@impulse-ui-native/theme\";\n\nimport { ViewProps } from \"../../types\";\n\nexport const View = memo(\n forwardRef<NativeView, ViewProps>(function View(props: ViewProps, ref) {\n const { style, shadow, shadowPosition, ...rest } = props;\n\n const colors = useColors();\n const extractedStyleProps = useStyleProps(props);\n\n const viewStyle = useMemo(() => {\n return StyleSheet.flatten([\n getShadowStyle(shadow, shadowPosition, colors),\n extractedStyleProps,\n style,\n ]);\n }, [extractedStyleProps, style, shadow, shadowPosition, colors]);\n\n return <NativeView {...rest} style={viewStyle} ref={ref} />;\n }),\n);\n"],"mappings":"AA0BW;AA1BX,SAAS,YAAY,MAAM,eAAe;AAC1C,SAAS,QAAQ,YAAY,kBAAkB;AAE/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIA,MAAM,OAAO;AAAA,EAClB,WAAkC,SAASA,MAAK,OAAkB,KAAK;AACrE,UAAM,EAAE,OAAO,QAAQ,gBAAgB,GAAG,KAAK,IAAI;AAEnD,UAAM,SAAS,UAAU;AACzB,UAAM,sBAAsB,cAAc,KAAK;AAE/C,UAAM,YAAY,QAAQ,MAAM;AAC9B,aAAO,WAAW,QAAQ;AAAA,QACxB,eAAe,QAAQ,gBAAgB,MAAM;AAAA,QAC7C;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,GAAG,CAAC,qBAAqB,OAAO,QAAQ,gBAAgB,MAAM,CAAC;AAE/D,WAAO,oBAAC,cAAY,GAAG,MAAM,OAAO,WAAW,KAAU;AAAA,EAC3D,CAAC;AACH;","names":["View"]}
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ControlAddonProps } from '../../types/control-components.types.mjs';
4
+ import 'react-native';
5
+ import '@impulse-ui-native/icon/types';
6
+ import '@impulse-ui-native/theme';
7
+ import '../../types/button.types.mjs';
8
+
9
+ declare const ControlAddon: react.MemoExoticComponent<(props: ControlAddonProps) => react_jsx_runtime.JSX.Element | null>;
10
+
11
+ export { ControlAddon };
@@ -0,0 +1,72 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { memo, useMemo } from "react";
3
+ import { StyleSheet } from "react-native";
4
+ import { Icon } from "@impulse-ui-native/icon/components/icon";
5
+ import {
6
+ useComponentsTokens,
7
+ useThemedStyles
8
+ } from "@impulse-ui-native/theme";
9
+ import { Pressable, View } from "../atoms";
10
+ import { useControlContext } from "./provider";
11
+ const ControlAddon = memo(function ControlAddon2(props) {
12
+ const { icon: AddonIcon, onPress, Content, style, ...rest } = props;
13
+ const { disabled, error } = useControlContext();
14
+ const tokens = useComponentsTokens();
15
+ const styles = useThemedStyles(
16
+ themedStyles,
17
+ {
18
+ disabled,
19
+ error
20
+ },
21
+ [disabled, error]
22
+ );
23
+ const Container = useMemo(() => {
24
+ if (onPress) {
25
+ return Pressable;
26
+ }
27
+ return View;
28
+ }, [onPress]);
29
+ const children = useMemo(() => {
30
+ if (Content) {
31
+ return /* @__PURE__ */ jsx(Content, {});
32
+ }
33
+ if (AddonIcon) {
34
+ return /* @__PURE__ */ jsx(Icon, { color: styles.icon.color, icon: AddonIcon });
35
+ }
36
+ return null;
37
+ }, [AddonIcon, Content, styles.icon.color]);
38
+ const containerStyle = useMemo(
39
+ () => [styles.container, style],
40
+ [styles.container, style]
41
+ );
42
+ if (!children) {
43
+ return null;
44
+ }
45
+ return /* @__PURE__ */ jsx(
46
+ Container,
47
+ {
48
+ ...rest,
49
+ style: containerStyle,
50
+ hitSlop: tokens.controlAddon.hitSlop,
51
+ onPress,
52
+ disabled,
53
+ children
54
+ }
55
+ );
56
+ });
57
+ function themedStyles(theme, props) {
58
+ const { disabled, error } = props;
59
+ const controlAddonTokens = theme.components.controlAddon;
60
+ return StyleSheet.create({
61
+ container: {
62
+ marginHorizontal: controlAddonTokens.marginHorizontal
63
+ },
64
+ icon: {
65
+ color: disabled ? controlAddonTokens.disabledIconColor : error ? controlAddonTokens.errorIconColor : controlAddonTokens.iconColor
66
+ }
67
+ });
68
+ }
69
+ export {
70
+ ControlAddon
71
+ };
72
+ //# sourceMappingURL=addon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/addon.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport { Icon } from \"@impulse-ui-native/icon/components/icon\";\nimport {\n AppTheme,\n useComponentsTokens,\n useThemedStyles,\n} from \"@impulse-ui-native/theme\";\n\nimport { ControlAddonProps } from \"../../types\";\nimport { Pressable, View } from \"../atoms\";\nimport { useControlContext } from \"./provider\";\n\nexport const ControlAddon = memo(function ControlAddon(\n props: ControlAddonProps,\n) {\n const { icon: AddonIcon, onPress, Content, style, ...rest } = props;\n\n const { disabled, error } = useControlContext();\n\n const tokens = useComponentsTokens();\n\n const styles = useThemedStyles(\n themedStyles,\n {\n disabled,\n error,\n },\n [disabled, error],\n );\n\n const Container = useMemo(() => {\n if (onPress) {\n return Pressable;\n }\n\n return View;\n }, [onPress]);\n\n const children = useMemo(() => {\n if (Content) {\n return <Content />;\n }\n\n if (AddonIcon) {\n return <Icon color={styles.icon.color} icon={AddonIcon} />;\n }\n\n return null;\n }, [AddonIcon, Content, styles.icon.color]);\n\n const containerStyle = useMemo(\n () => [styles.container, style],\n [styles.container, style],\n );\n\n if (!children) {\n return null;\n }\n\n return (\n <Container\n {...rest}\n style={containerStyle}\n hitSlop={tokens.controlAddon.hitSlop}\n onPress={onPress}\n disabled={disabled}\n >\n {children}\n </Container>\n );\n});\n\nfunction themedStyles(\n theme: AppTheme,\n props: {\n disabled?: boolean;\n error?: string;\n },\n) {\n const { disabled, error } = props;\n\n const controlAddonTokens = theme.components.controlAddon;\n\n return StyleSheet.create({\n container: {\n marginHorizontal: controlAddonTokens.marginHorizontal,\n },\n\n icon: {\n color: disabled\n ? controlAddonTokens.disabledIconColor\n : error\n ? controlAddonTokens.errorIconColor\n : controlAddonTokens.iconColor,\n },\n });\n}\n"],"mappings":"AA0Ca;AA1Cb,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAE3B,SAAS,YAAY;AACrB;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,WAAW,YAAY;AAChC,SAAS,yBAAyB;AAE3B,MAAM,eAAe,KAAK,SAASA,cACxC,OACA;AACA,QAAM,EAAE,MAAM,WAAW,SAAS,SAAS,OAAO,GAAG,KAAK,IAAI;AAE9D,QAAM,EAAE,UAAU,MAAM,IAAI,kBAAkB;AAE9C,QAAM,SAAS,oBAAoB;AAEnC,QAAM,SAAS;AAAA,IACb;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,UAAU,KAAK;AAAA,EAClB;AAEA,QAAM,YAAY,QAAQ,MAAM;AAC9B,QAAI,SAAS;AACX,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,WAAW,QAAQ,MAAM;AAC7B,QAAI,SAAS;AACX,aAAO,oBAAC,WAAQ;AAAA,IAClB;AAEA,QAAI,WAAW;AACb,aAAO,oBAAC,QAAK,OAAO,OAAO,KAAK,OAAO,MAAM,WAAW;AAAA,IAC1D;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,WAAW,SAAS,OAAO,KAAK,KAAK,CAAC;AAE1C,QAAM,iBAAiB;AAAA,IACrB,MAAM,CAAC,OAAO,WAAW,KAAK;AAAA,IAC9B,CAAC,OAAO,WAAW,KAAK;AAAA,EAC1B;AAEA,MAAI,CAAC,UAAU;AACb,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,MACP,SAAS,OAAO,aAAa;AAAA,MAC7B;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,SAAS,aACP,OACA,OAIA;AACA,QAAM,EAAE,UAAU,MAAM,IAAI;AAE5B,QAAM,qBAAqB,MAAM,WAAW;AAE5C,SAAO,WAAW,OAAO;AAAA,IACvB,WAAW;AAAA,MACT,kBAAkB,mBAAmB;AAAA,IACvC;AAAA,IAEA,MAAM;AAAA,MACJ,OAAO,WACH,mBAAmB,oBACnB,QACE,mBAAmB,iBACnB,mBAAmB;AAAA,IAC3B;AAAA,EACF,CAAC;AACH;","names":["ControlAddon"]}
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ControlContainerProps } from '../../types/control-components.types.mjs';
4
+ import 'react-native';
5
+ import '@impulse-ui-native/icon/types';
6
+ import '@impulse-ui-native/theme';
7
+ import '../../types/button.types.mjs';
8
+
9
+ declare const ControlContainer: react.MemoExoticComponent<(props: ControlContainerProps) => react_jsx_runtime.JSX.Element>;
10
+
11
+ export { ControlContainer };
@@ -0,0 +1,54 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { memo, useMemo } from "react";
3
+ import { StyleSheet } from "react-native";
4
+ import {
5
+ useThemedStyles
6
+ } from "@impulse-ui-native/theme";
7
+ import { View } from "../atoms/view";
8
+ import { useControlContext } from "./provider";
9
+ const ControlContainer = memo(function ControlContainer2(props) {
10
+ const { style, ...rest } = props;
11
+ const { size, variant, disabled, error } = useControlContext();
12
+ const styles = useThemedStyles(
13
+ themedStyles,
14
+ {
15
+ size,
16
+ variant,
17
+ disabled,
18
+ error
19
+ },
20
+ [size, variant, disabled, error]
21
+ );
22
+ const containerStyle = useMemo(
23
+ () => [styles.inputContainer, style],
24
+ [styles.inputContainer, style]
25
+ );
26
+ return /* @__PURE__ */ jsx(View, { style: containerStyle, ...rest });
27
+ });
28
+ function themedStyles(theme, {
29
+ size,
30
+ variant,
31
+ disabled,
32
+ error
33
+ }) {
34
+ const controlContainerTokens = theme.components.controlContainer;
35
+ const sizeTokens = controlContainerTokens.sizes[size];
36
+ const variantTokens = controlContainerTokens.variants[variant];
37
+ return StyleSheet.create({
38
+ inputContainer: {
39
+ flexDirection: "row",
40
+ alignItems: "center",
41
+ height: sizeTokens.height,
42
+ paddingHorizontal: sizeTokens.paddingHorizontal,
43
+ borderRadius: controlContainerTokens.borderRadius,
44
+ borderWidth: controlContainerTokens.borderWidth,
45
+ opacity: disabled ? controlContainerTokens.disabledOpacity : 1,
46
+ backgroundColor: disabled ? variantTokens.disabledBackgroundColor : variantTokens.backgroundColor,
47
+ borderColor: error ? variantTokens.errorBorderColor : disabled ? variantTokens.disabledBorderColor : variantTokens.borderColor
48
+ }
49
+ });
50
+ }
51
+ export {
52
+ ControlContainer
53
+ };
54
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/container.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport {\n AppTheme,\n ComponentSize,\n ComponentVariant,\n useThemedStyles,\n} from \"@impulse-ui-native/theme\";\n\nimport { ControlContainerProps } from \"../../types\";\nimport { View } from \"../atoms/view\";\nimport { useControlContext } from \"./provider\";\n\nexport const ControlContainer = memo(function ControlContainer(\n props: ControlContainerProps,\n) {\n const { style, ...rest } = props;\n\n const { size, variant, disabled, error } = useControlContext();\n\n const styles = useThemedStyles(\n themedStyles,\n {\n size,\n variant,\n disabled,\n error,\n },\n [size, variant, disabled, error],\n );\n\n const containerStyle = useMemo(\n () => [styles.inputContainer, style],\n [styles.inputContainer, style],\n );\n\n return <View style={containerStyle} {...rest} />;\n});\n\nfunction themedStyles(\n theme: AppTheme,\n {\n size,\n variant,\n disabled,\n error,\n }: {\n size: ComponentSize;\n variant: ComponentVariant;\n disabled?: boolean;\n error?: string;\n },\n) {\n const controlContainerTokens = theme.components.controlContainer;\n const sizeTokens = controlContainerTokens.sizes[size];\n const variantTokens = controlContainerTokens.variants[variant];\n\n return StyleSheet.create({\n inputContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n\n height: sizeTokens.height,\n paddingHorizontal: sizeTokens.paddingHorizontal,\n\n borderRadius: controlContainerTokens.borderRadius,\n borderWidth: controlContainerTokens.borderWidth,\n\n opacity: disabled ? controlContainerTokens.disabledOpacity : 1,\n\n backgroundColor: disabled\n ? variantTokens.disabledBackgroundColor\n : variantTokens.backgroundColor,\n\n borderColor: error\n ? variantTokens.errorBorderColor\n : disabled\n ? variantTokens.disabledBorderColor\n : variantTokens.borderColor,\n },\n });\n}\n"],"mappings":"AAqCS;AArCT,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAE3B;AAAA,EAIE;AAAA,OACK;AAGP,SAAS,YAAY;AACrB,SAAS,yBAAyB;AAE3B,MAAM,mBAAmB,KAAK,SAASA,kBAC5C,OACA;AACA,QAAM,EAAE,OAAO,GAAG,KAAK,IAAI;AAE3B,QAAM,EAAE,MAAM,SAAS,UAAU,MAAM,IAAI,kBAAkB;AAE7D,QAAM,SAAS;AAAA,IACb;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,MAAM,SAAS,UAAU,KAAK;AAAA,EACjC;AAEA,QAAM,iBAAiB;AAAA,IACrB,MAAM,CAAC,OAAO,gBAAgB,KAAK;AAAA,IACnC,CAAC,OAAO,gBAAgB,KAAK;AAAA,EAC/B;AAEA,SAAO,oBAAC,QAAK,OAAO,gBAAiB,GAAG,MAAM;AAChD,CAAC;AAED,SAAS,aACP,OACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMA;AACA,QAAM,yBAAyB,MAAM,WAAW;AAChD,QAAM,aAAa,uBAAuB,MAAM,IAAI;AACpD,QAAM,gBAAgB,uBAAuB,SAAS,OAAO;AAE7D,SAAO,WAAW,OAAO;AAAA,IACvB,gBAAgB;AAAA,MACd,eAAe;AAAA,MACf,YAAY;AAAA,MAEZ,QAAQ,WAAW;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAE9B,cAAc,uBAAuB;AAAA,MACrC,aAAa,uBAAuB;AAAA,MAEpC,SAAS,WAAW,uBAAuB,kBAAkB;AAAA,MAE7D,iBAAiB,WACb,cAAc,0BACd,cAAc;AAAA,MAElB,aAAa,QACT,cAAc,mBACd,WACE,cAAc,sBACd,cAAc;AAAA,IACtB;AAAA,EACF,CAAC;AACH;","names":["ControlContainer"]}
@@ -0,0 +1,23 @@
1
+ import * as react from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ViewProps } from '../../types/view.types.mjs';
4
+ import { ControlContainerProps, ControlContextData, ControlLabelProps, ControlErrorLabelProps, ControlAddonProps, ControlInputProps, ControlPlaceholderProps, ControlValueProps } from '../../types/control-components.types.mjs';
5
+ import 'react-native';
6
+ import '@impulse-ui-native/theme';
7
+ import '@impulse-ui-native/icon/types';
8
+ import '../../types/button.types.mjs';
9
+
10
+ declare const Control: {
11
+ Container: react.MemoExoticComponent<(props: ControlContainerProps) => react_jsx_runtime.JSX.Element>;
12
+ Provider: react.MemoExoticComponent<(props: react.PropsWithChildren<ControlContextData>) => react_jsx_runtime.JSX.Element>;
13
+ Root: react.MemoExoticComponent<(props: ViewProps) => react_jsx_runtime.JSX.Element>;
14
+ Label: react.MemoExoticComponent<(props: ControlLabelProps) => react_jsx_runtime.JSX.Element | null>;
15
+ Error: react.MemoExoticComponent<(props: ControlErrorLabelProps) => react_jsx_runtime.JSX.Element | null>;
16
+ Addon: react.MemoExoticComponent<(props: ControlAddonProps) => react_jsx_runtime.JSX.Element | null>;
17
+ Input: react.MemoExoticComponent<(props: ControlInputProps) => react_jsx_runtime.JSX.Element>;
18
+ Placeholder: react.MemoExoticComponent<(props: ControlPlaceholderProps) => react_jsx_runtime.JSX.Element>;
19
+ Value: react.MemoExoticComponent<(props: ControlValueProps) => react_jsx_runtime.JSX.Element>;
20
+ Loader: react.MemoExoticComponent<() => react_jsx_runtime.JSX.Element>;
21
+ };
22
+
23
+ export { Control };
@@ -0,0 +1,26 @@
1
+ import { ControlAddon } from "./addon";
2
+ import { ControlContainer } from "./container";
3
+ import { ControlError } from "./error";
4
+ import { ControlInput } from "./input";
5
+ import { ControlLabel } from "./label";
6
+ import { ControlLoader } from "./loader";
7
+ import { ControlPlaceholder } from "./placeholder";
8
+ import { ControlProvider } from "./provider";
9
+ import { ControlRoot } from "./root";
10
+ import { ControlValue } from "./value";
11
+ const Control = {
12
+ Container: ControlContainer,
13
+ Provider: ControlProvider,
14
+ Root: ControlRoot,
15
+ Label: ControlLabel,
16
+ Error: ControlError,
17
+ Addon: ControlAddon,
18
+ Input: ControlInput,
19
+ Placeholder: ControlPlaceholder,
20
+ Value: ControlValue,
21
+ Loader: ControlLoader
22
+ };
23
+ export {
24
+ Control
25
+ };
26
+ //# sourceMappingURL=control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/control.tsx"],"sourcesContent":["import { ControlAddon } from \"./addon\";\nimport { ControlContainer } from \"./container\";\nimport { ControlError } from \"./error\";\nimport { ControlInput } from \"./input\";\nimport { ControlLabel } from \"./label\";\nimport { ControlLoader } from \"./loader\";\nimport { ControlPlaceholder } from \"./placeholder\";\nimport { ControlProvider } from \"./provider\";\nimport { ControlRoot } from \"./root\";\nimport { ControlValue } from \"./value\";\n\nexport const Control = {\n Container: ControlContainer,\n Provider: ControlProvider,\n Root: ControlRoot,\n Label: ControlLabel,\n Error: ControlError,\n Addon: ControlAddon,\n Input: ControlInput,\n Placeholder: ControlPlaceholder,\n Value: ControlValue,\n Loader: ControlLoader,\n};\n"],"mappings":"AAAA,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAEtB,MAAM,UAAU;AAAA,EACrB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AAAA,EACP,QAAQ;AACV;","names":[]}
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ControlErrorLabelProps } from '../../types/control-components.types.mjs';
4
+ import 'react-native';
5
+ import '@impulse-ui-native/icon/types';
6
+ import '@impulse-ui-native/theme';
7
+ import '../../types/button.types.mjs';
8
+
9
+ declare const ControlError: react.MemoExoticComponent<(props: ControlErrorLabelProps) => react_jsx_runtime.JSX.Element | null>;
10
+
11
+ export { ControlError };
@@ -0,0 +1,33 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { memo, useMemo } from "react";
3
+ import { StyleSheet } from "react-native";
4
+ import { useThemedStyles } from "@impulse-ui-native/theme";
5
+ import { Typography } from "../atoms";
6
+ import { useControlContext } from "./provider";
7
+ const ControlError = memo(function ControlError2(props) {
8
+ const { style, ...rest } = props;
9
+ const { error } = useControlContext();
10
+ const styles = useThemedStyles(themedStyles);
11
+ const errorStyle = useMemo(
12
+ () => [styles.error, style],
13
+ [styles.error, style]
14
+ );
15
+ if (!Boolean(error)) {
16
+ return null;
17
+ }
18
+ return /* @__PURE__ */ jsx(Typography.Caption, { ...rest, style: errorStyle, children: error });
19
+ });
20
+ function themedStyles(theme) {
21
+ const controlErrorTokens = theme.components.controlError;
22
+ return StyleSheet.create({
23
+ error: {
24
+ marginTop: controlErrorTokens.marginTop,
25
+ color: controlErrorTokens.color,
26
+ fontSize: controlErrorTokens.fontSize
27
+ }
28
+ });
29
+ }
30
+ export {
31
+ ControlError
32
+ };
33
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/error.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport { AppTheme, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport { ControlErrorLabelProps } from \"../../types\";\nimport { Typography } from \"../atoms\";\nimport { useControlContext } from \"./provider\";\n\nexport const ControlError = memo(function ControlError(\n props: ControlErrorLabelProps,\n) {\n const { style, ...rest } = props;\n\n const { error } = useControlContext();\n\n const styles = useThemedStyles(themedStyles);\n\n const errorStyle = useMemo(\n () => [styles.error, style],\n [styles.error, style],\n );\n\n if (!Boolean(error)) {\n return null;\n }\n\n return (\n <Typography.Caption {...rest} style={errorStyle}>\n {error}\n </Typography.Caption>\n );\n});\n\nfunction themedStyles(theme: AppTheme) {\n const controlErrorTokens = theme.components.controlError;\n\n return StyleSheet.create({\n error: {\n marginTop: controlErrorTokens.marginTop,\n color: controlErrorTokens.color,\n fontSize: controlErrorTokens.fontSize,\n },\n });\n}\n"],"mappings":"AA4BI;AA5BJ,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAE3B,SAAmB,uBAAuB;AAG1C,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAE3B,MAAM,eAAe,KAAK,SAASA,cACxC,OACA;AACA,QAAM,EAAE,OAAO,GAAG,KAAK,IAAI;AAE3B,QAAM,EAAE,MAAM,IAAI,kBAAkB;AAEpC,QAAM,SAAS,gBAAgB,YAAY;AAE3C,QAAM,aAAa;AAAA,IACjB,MAAM,CAAC,OAAO,OAAO,KAAK;AAAA,IAC1B,CAAC,OAAO,OAAO,KAAK;AAAA,EACtB;AAEA,MAAI,CAAC,QAAQ,KAAK,GAAG;AACnB,WAAO;AAAA,EACT;AAEA,SACE,oBAAC,WAAW,SAAX,EAAoB,GAAG,MAAM,OAAO,YAClC,iBACH;AAEJ,CAAC;AAED,SAAS,aAAa,OAAiB;AACrC,QAAM,qBAAqB,MAAM,WAAW;AAE5C,SAAO,WAAW,OAAO;AAAA,IACvB,OAAO;AAAA,MACL,WAAW,mBAAmB;AAAA,MAC9B,OAAO,mBAAmB;AAAA,MAC1B,UAAU,mBAAmB;AAAA,IAC/B;AAAA,EACF,CAAC;AACH;","names":["ControlError"]}
@@ -0,0 +1,10 @@
1
+ export { Control } from './control.mjs';
2
+ export { useControlContext } from './provider.mjs';
3
+ import 'react';
4
+ import 'react/jsx-runtime';
5
+ import '../../types/view.types.mjs';
6
+ import 'react-native';
7
+ import '@impulse-ui-native/theme';
8
+ import '../../types/control-components.types.mjs';
9
+ import '@impulse-ui-native/icon/types';
10
+ import '../../types/button.types.mjs';
@@ -0,0 +1,7 @@
1
+ import { Control } from "./control";
2
+ import { useControlContext } from "./provider";
3
+ export {
4
+ Control,
5
+ useControlContext
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/index.ts"],"sourcesContent":["export { Control } from \"./control\";\nexport { useControlContext } from \"./provider\";\n"],"mappings":"AAAA,SAAS,eAAe;AACxB,SAAS,yBAAyB;","names":[]}
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ControlInputProps } from '../../types/control-components.types.mjs';
4
+ import 'react-native';
5
+ import '@impulse-ui-native/icon/types';
6
+ import '@impulse-ui-native/theme';
7
+ import '../../types/button.types.mjs';
8
+
9
+ declare const ControlInput: react.MemoExoticComponent<(props: ControlInputProps) => react_jsx_runtime.JSX.Element>;
10
+
11
+ export { ControlInput };
@@ -0,0 +1,63 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { memo, useMemo } from "react";
3
+ import { StyleSheet, TextInput } from "react-native";
4
+ import {
5
+ useThemedStyles
6
+ } from "@impulse-ui-native/theme";
7
+ import { useControlContext } from "./provider";
8
+ const ControlInput = memo(function ControlInput2(props) {
9
+ const { onPress, style, ...rest } = props;
10
+ const { size, variant, disabled, error } = useControlContext();
11
+ const styles = useThemedStyles(
12
+ themedStyles,
13
+ {
14
+ size,
15
+ variant,
16
+ disabled,
17
+ error
18
+ },
19
+ [size, variant, disabled, error]
20
+ );
21
+ const inputStyles = useMemo(
22
+ () => [styles.input, style],
23
+ [styles.input, style]
24
+ );
25
+ return /* @__PURE__ */ jsx(
26
+ TextInput,
27
+ {
28
+ ...rest,
29
+ style: inputStyles,
30
+ placeholderTextColor: styles.placeholder.color,
31
+ editable: !disabled
32
+ }
33
+ );
34
+ });
35
+ function themedStyles(theme, {
36
+ size,
37
+ variant,
38
+ disabled,
39
+ error
40
+ }) {
41
+ const controlInputTokens = theme.components.controlInput;
42
+ const sizeTokens = controlInputTokens.sizes[size];
43
+ const variantTokens = controlInputTokens.variants[variant];
44
+ const color = disabled ? variantTokens.disabledColor : error ? variantTokens.errorColor : variantTokens.color;
45
+ const placeholderColor = disabled ? variantTokens.disabledPlaceholderColor : error ? variantTokens.errorPlaceholderColor : variantTokens.placeholderColor;
46
+ return StyleSheet.create({
47
+ input: {
48
+ flex: controlInputTokens.flex,
49
+ color,
50
+ fontSize: sizeTokens.fontSize,
51
+ fontFamily: controlInputTokens.fontFamily,
52
+ paddingHorizontal: controlInputTokens.paddingHorizontal,
53
+ height: "100%"
54
+ },
55
+ placeholder: {
56
+ color: placeholderColor
57
+ }
58
+ });
59
+ }
60
+ export {
61
+ ControlInput
62
+ };
63
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/input.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet, TextInput } from \"react-native\";\n\nimport {\n AppTheme,\n ComponentSize,\n ComponentVariant,\n useThemedStyles,\n} from \"@impulse-ui-native/theme\";\n\nimport { ControlInputProps } from \"../../types\";\nimport { useControlContext } from \"./provider\";\n\nexport const ControlInput = memo(function ControlInput(\n props: ControlInputProps,\n) {\n const { onPress, style, ...rest } = props;\n\n const { size, variant, disabled, error } = useControlContext();\n\n const styles = useThemedStyles(\n themedStyles,\n {\n size,\n variant,\n disabled,\n error,\n },\n [size, variant, disabled, error],\n );\n\n const inputStyles = useMemo(\n () => [styles.input, style],\n [styles.input, style],\n );\n\n return (\n <TextInput\n {...rest}\n style={inputStyles}\n placeholderTextColor={styles.placeholder.color}\n editable={!disabled}\n />\n );\n});\n\nfunction themedStyles(\n theme: AppTheme,\n {\n size,\n variant,\n disabled,\n error,\n }: {\n size: ComponentSize;\n variant: ComponentVariant;\n disabled?: boolean;\n error?: string;\n },\n) {\n const controlInputTokens = theme.components.controlInput;\n const sizeTokens = controlInputTokens.sizes[size];\n const variantTokens = controlInputTokens.variants[variant];\n\n const color = disabled\n ? variantTokens.disabledColor\n : error\n ? variantTokens.errorColor\n : variantTokens.color;\n\n const placeholderColor = disabled\n ? variantTokens.disabledPlaceholderColor\n : error\n ? variantTokens.errorPlaceholderColor\n : variantTokens.placeholderColor;\n\n return StyleSheet.create({\n input: {\n flex: controlInputTokens.flex,\n color,\n fontSize: sizeTokens.fontSize,\n fontFamily: controlInputTokens.fontFamily,\n paddingHorizontal: controlInputTokens.paddingHorizontal,\n height: \"100%\",\n },\n\n placeholder: {\n color: placeholderColor,\n },\n });\n}\n"],"mappings":"AAqCI;AArCJ,SAAS,MAAM,eAAe;AAC9B,SAAS,YAAY,iBAAiB;AAEtC;AAAA,EAIE;AAAA,OACK;AAGP,SAAS,yBAAyB;AAE3B,MAAM,eAAe,KAAK,SAASA,cACxC,OACA;AACA,QAAM,EAAE,SAAS,OAAO,GAAG,KAAK,IAAI;AAEpC,QAAM,EAAE,MAAM,SAAS,UAAU,MAAM,IAAI,kBAAkB;AAE7D,QAAM,SAAS;AAAA,IACb;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,MAAM,SAAS,UAAU,KAAK;AAAA,EACjC;AAEA,QAAM,cAAc;AAAA,IAClB,MAAM,CAAC,OAAO,OAAO,KAAK;AAAA,IAC1B,CAAC,OAAO,OAAO,KAAK;AAAA,EACtB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,MACP,sBAAsB,OAAO,YAAY;AAAA,MACzC,UAAU,CAAC;AAAA;AAAA,EACb;AAEJ,CAAC;AAED,SAAS,aACP,OACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMA;AACA,QAAM,qBAAqB,MAAM,WAAW;AAC5C,QAAM,aAAa,mBAAmB,MAAM,IAAI;AAChD,QAAM,gBAAgB,mBAAmB,SAAS,OAAO;AAEzD,QAAM,QAAQ,WACV,cAAc,gBACd,QACE,cAAc,aACd,cAAc;AAEpB,QAAM,mBAAmB,WACrB,cAAc,2BACd,QACE,cAAc,wBACd,cAAc;AAEpB,SAAO,WAAW,OAAO;AAAA,IACvB,OAAO;AAAA,MACL,MAAM,mBAAmB;AAAA,MACzB;AAAA,MACA,UAAU,WAAW;AAAA,MACrB,YAAY,mBAAmB;AAAA,MAC/B,mBAAmB,mBAAmB;AAAA,MACtC,QAAQ;AAAA,IACV;AAAA,IAEA,aAAa;AAAA,MACX,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":["ControlInput"]}
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ControlLabelProps } from '../../types/control-components.types.mjs';
4
+ import 'react-native';
5
+ import '@impulse-ui-native/icon/types';
6
+ import '@impulse-ui-native/theme';
7
+ import '../../types/button.types.mjs';
8
+
9
+ declare const ControlLabel: react.MemoExoticComponent<(props: ControlLabelProps) => react_jsx_runtime.JSX.Element | null>;
10
+
11
+ export { ControlLabel };