@nori-ui/core 1.0.6 → 1.2.0

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 (174) hide show
  1. package/dist/chunk-2UXKXUX2.js +286 -0
  2. package/dist/chunk-2UXKXUX2.js.map +1 -0
  3. package/dist/{chunk-DDGMLLS3.js → chunk-46OT4PA6.js} +3 -3
  4. package/dist/{chunk-DDGMLLS3.js.map → chunk-46OT4PA6.js.map} +1 -1
  5. package/dist/{chunk-SFNDR6DI.js → chunk-5BM6H2CD.js} +3 -3
  6. package/dist/{chunk-SFNDR6DI.js.map → chunk-5BM6H2CD.js.map} +1 -1
  7. package/dist/{chunk-EWWQQ5DB.js → chunk-6JVUVBZH.js} +5 -5
  8. package/dist/{chunk-EWWQQ5DB.js.map → chunk-6JVUVBZH.js.map} +1 -1
  9. package/dist/{chunk-FT2XBBQJ.js → chunk-6PO2IWB3.js} +8 -5
  10. package/dist/chunk-6PO2IWB3.js.map +1 -0
  11. package/dist/{chunk-YNKKEO2A.js → chunk-7D2BHQ6M.js} +3 -3
  12. package/dist/{chunk-YNKKEO2A.js.map → chunk-7D2BHQ6M.js.map} +1 -1
  13. package/dist/{chunk-MRJWPRCX.js → chunk-AFQIK6JI.js} +3 -3
  14. package/dist/{chunk-MRJWPRCX.js.map → chunk-AFQIK6JI.js.map} +1 -1
  15. package/dist/{chunk-IKLA2CVQ.js → chunk-C6TRLHMW.js} +21 -5
  16. package/dist/chunk-C6TRLHMW.js.map +1 -0
  17. package/dist/{chunk-NRYWNOG5.js → chunk-CGQIVFCN.js} +3 -3
  18. package/dist/{chunk-NRYWNOG5.js.map → chunk-CGQIVFCN.js.map} +1 -1
  19. package/dist/chunk-EFK7726V.js +104 -0
  20. package/dist/chunk-EFK7726V.js.map +1 -0
  21. package/dist/{chunk-3BDDPFCI.js → chunk-FDBQOQMW.js} +3 -3
  22. package/dist/{chunk-3BDDPFCI.js.map → chunk-FDBQOQMW.js.map} +1 -1
  23. package/dist/{chunk-XALU6LOT.js → chunk-GELLSU64.js} +3 -3
  24. package/dist/{chunk-XALU6LOT.js.map → chunk-GELLSU64.js.map} +1 -1
  25. package/dist/{chunk-BZLT6R62.js → chunk-GRDVE3IR.js} +3 -3
  26. package/dist/{chunk-BZLT6R62.js.map → chunk-GRDVE3IR.js.map} +1 -1
  27. package/dist/{chunk-OMU4R4Y5.js → chunk-HTF6FDB6.js} +3 -3
  28. package/dist/{chunk-OMU4R4Y5.js.map → chunk-HTF6FDB6.js.map} +1 -1
  29. package/dist/{chunk-X7APG7G2.js → chunk-HZKXPN6B.js} +154 -34
  30. package/dist/chunk-HZKXPN6B.js.map +1 -0
  31. package/dist/{chunk-WGT345SV.js → chunk-IGLMPAWE.js} +3 -3
  32. package/dist/{chunk-WGT345SV.js.map → chunk-IGLMPAWE.js.map} +1 -1
  33. package/dist/{chunk-5XEGZFG5.js → chunk-LWQZ257T.js} +3 -3
  34. package/dist/{chunk-5XEGZFG5.js.map → chunk-LWQZ257T.js.map} +1 -1
  35. package/dist/{chunk-RFW5SRZA.js → chunk-MJ4AGXS7.js} +3 -3
  36. package/dist/{chunk-RFW5SRZA.js.map → chunk-MJ4AGXS7.js.map} +1 -1
  37. package/dist/{chunk-PNP7L4TA.js → chunk-RM5TSXVE.js} +3 -3
  38. package/dist/{chunk-PNP7L4TA.js.map → chunk-RM5TSXVE.js.map} +1 -1
  39. package/dist/{chunk-MKSDYRWQ.js → chunk-SINLREQV.js} +3 -3
  40. package/dist/{chunk-MKSDYRWQ.js.map → chunk-SINLREQV.js.map} +1 -1
  41. package/dist/{chunk-TLS54G6Y.js → chunk-UF5OENHV.js} +3 -3
  42. package/dist/{chunk-TLS54G6Y.js.map → chunk-UF5OENHV.js.map} +1 -1
  43. package/dist/{chunk-ZQMNGPLE.js → chunk-UJ5KFRDE.js} +18 -6
  44. package/dist/chunk-UJ5KFRDE.js.map +1 -0
  45. package/dist/{chunk-SWC5CNKE.js → chunk-UPVNZPFV.js} +3 -3
  46. package/dist/{chunk-SWC5CNKE.js.map → chunk-UPVNZPFV.js.map} +1 -1
  47. package/dist/{chunk-3F4TXKDY.js → chunk-UUXWRDWW.js} +3 -3
  48. package/dist/chunk-UUXWRDWW.js.map +1 -0
  49. package/dist/{chunk-7GPDNQSX.js → chunk-V2AWSDDZ.js} +5 -5
  50. package/dist/{chunk-7GPDNQSX.js.map → chunk-V2AWSDDZ.js.map} +1 -1
  51. package/dist/{chunk-JQQ3FBN7.js → chunk-VCJF75T2.js} +3 -3
  52. package/dist/{chunk-JQQ3FBN7.js.map → chunk-VCJF75T2.js.map} +1 -1
  53. package/dist/{chunk-ZBW3BA5R.js → chunk-VMAGFYHG.js} +39 -4
  54. package/dist/chunk-VMAGFYHG.js.map +1 -0
  55. package/dist/{chunk-JZ774T7U.js → chunk-W3HMOOON.js} +3 -3
  56. package/dist/{chunk-JZ774T7U.js.map → chunk-W3HMOOON.js.map} +1 -1
  57. package/dist/{chunk-6AD6KCVB.js → chunk-WAKKQROH.js} +3 -3
  58. package/dist/{chunk-6AD6KCVB.js.map → chunk-WAKKQROH.js.map} +1 -1
  59. package/dist/{chunk-LVWNMQGR.js → chunk-WDNDTSNX.js} +5 -5
  60. package/dist/{chunk-LVWNMQGR.js.map → chunk-WDNDTSNX.js.map} +1 -1
  61. package/dist/chunk-WOF67PKT.js +60 -0
  62. package/dist/chunk-WOF67PKT.js.map +1 -0
  63. package/dist/{chunk-QJNV7YQP.js → chunk-WTNDPO2V.js} +39 -4
  64. package/dist/chunk-WTNDPO2V.js.map +1 -0
  65. package/dist/chunk-XBNVKPJN.js +343 -0
  66. package/dist/chunk-XBNVKPJN.js.map +1 -0
  67. package/dist/{chunk-FEPTH5RV.js → chunk-XP55RZ3D.js} +3 -3
  68. package/dist/{chunk-FEPTH5RV.js.map → chunk-XP55RZ3D.js.map} +1 -1
  69. package/dist/{chunk-CCUXO2HN.js → chunk-Y4ZRSW35.js} +3 -3
  70. package/dist/{chunk-CCUXO2HN.js.map → chunk-Y4ZRSW35.js.map} +1 -1
  71. package/dist/client.cjs +948 -123
  72. package/dist/client.cjs.map +1 -1
  73. package/dist/client.d.cts +3 -0
  74. package/dist/client.d.ts +3 -0
  75. package/dist/client.js +42 -39
  76. package/dist/client.js.map +1 -1
  77. package/dist/components/Accordion/index.js +2 -2
  78. package/dist/components/Alert/index.js +2 -2
  79. package/dist/components/AlertDialog/index.js +2 -2
  80. package/dist/components/Avatar/index.js +2 -2
  81. package/dist/components/Badge/index.js +2 -2
  82. package/dist/components/Box/index.js +4 -4
  83. package/dist/components/Breadcrumb/index.cjs +6 -3
  84. package/dist/components/Breadcrumb/index.cjs.map +1 -1
  85. package/dist/components/Breadcrumb/index.js +5 -5
  86. package/dist/components/Button/index.js +2 -2
  87. package/dist/components/Calendar/index.cjs +170 -35
  88. package/dist/components/Calendar/index.cjs.map +1 -1
  89. package/dist/components/Calendar/index.js +5 -5
  90. package/dist/components/Card/index.js +2 -2
  91. package/dist/components/Checkbox/index.cjs +36 -1
  92. package/dist/components/Checkbox/index.cjs.map +1 -1
  93. package/dist/components/Checkbox/index.d.cts +17 -1
  94. package/dist/components/Checkbox/index.d.ts +17 -1
  95. package/dist/components/Checkbox/index.js +2 -2
  96. package/dist/components/DatePicker/index.cjs +3875 -0
  97. package/dist/components/DatePicker/index.cjs.map +1 -0
  98. package/dist/components/DatePicker/index.d.cts +58 -0
  99. package/dist/components/DatePicker/index.d.ts +58 -0
  100. package/dist/components/DatePicker/index.js +14 -0
  101. package/dist/components/DatePicker/index.js.map +1 -0
  102. package/dist/components/Dialog/index.js +2 -2
  103. package/dist/components/Field/index.cjs +703 -0
  104. package/dist/components/Field/index.cjs.map +1 -0
  105. package/dist/components/Field/index.d.cts +51 -0
  106. package/dist/components/Field/index.d.ts +51 -0
  107. package/dist/components/Field/index.js +9 -0
  108. package/dist/components/Field/index.js.map +1 -0
  109. package/dist/components/FloatButton/index.cjs +6 -3
  110. package/dist/components/FloatButton/index.cjs.map +1 -1
  111. package/dist/components/FloatButton/index.js +5 -5
  112. package/dist/components/HStack/index.js +4 -4
  113. package/dist/components/InputGroup/index.cjs.map +1 -1
  114. package/dist/components/InputGroup/index.d.cts +8 -1
  115. package/dist/components/InputGroup/index.d.ts +8 -1
  116. package/dist/components/InputGroup/index.js +2 -2
  117. package/dist/components/Label/index.cjs +458 -0
  118. package/dist/components/Label/index.cjs.map +1 -0
  119. package/dist/components/Label/index.d.cts +14 -0
  120. package/dist/components/Label/index.d.ts +14 -0
  121. package/dist/components/Label/index.js +8 -0
  122. package/dist/components/Label/index.js.map +1 -0
  123. package/dist/components/Pagination/index.cjs +21 -6
  124. package/dist/components/Pagination/index.cjs.map +1 -1
  125. package/dist/components/Pagination/index.js +5 -5
  126. package/dist/components/Popover/index.js +2 -2
  127. package/dist/components/Progress/index.js +2 -2
  128. package/dist/components/Radio/index.cjs +18 -2
  129. package/dist/components/Radio/index.cjs.map +1 -1
  130. package/dist/components/Radio/index.d.cts +17 -1
  131. package/dist/components/Radio/index.d.ts +17 -1
  132. package/dist/components/Radio/index.js +2 -2
  133. package/dist/components/SegmentedControl/index.js +2 -2
  134. package/dist/components/Select/index.cjs +15 -3
  135. package/dist/components/Select/index.cjs.map +1 -1
  136. package/dist/components/Select/index.d.cts +6 -0
  137. package/dist/components/Select/index.d.ts +6 -0
  138. package/dist/components/Select/index.js +2 -2
  139. package/dist/components/Switch/index.cjs +36 -1
  140. package/dist/components/Switch/index.cjs.map +1 -1
  141. package/dist/components/Switch/index.d.cts +17 -1
  142. package/dist/components/Switch/index.d.ts +17 -1
  143. package/dist/components/Switch/index.js +2 -2
  144. package/dist/components/Tabs/index.js +2 -2
  145. package/dist/components/Text/index.js +2 -2
  146. package/dist/components/TextArea/index.cjs +35 -84
  147. package/dist/components/TextArea/index.cjs.map +1 -1
  148. package/dist/components/TextArea/index.js +3 -3
  149. package/dist/components/TextInput/index.cjs +35 -84
  150. package/dist/components/TextInput/index.cjs.map +1 -1
  151. package/dist/components/TextInput/index.d.cts +7 -8
  152. package/dist/components/TextInput/index.d.ts +7 -8
  153. package/dist/components/TextInput/index.js +2 -2
  154. package/dist/components/Toggle/index.js +2 -2
  155. package/dist/components/Tooltip/index.js +2 -2
  156. package/dist/components/VStack/index.js +4 -4
  157. package/dist/i18n/index.cjs +6 -3
  158. package/dist/i18n/index.cjs.map +1 -1
  159. package/dist/i18n/index.js +1 -1
  160. package/dist/index.cjs +948 -123
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.d.cts +3 -0
  163. package/dist/index.d.ts +3 -0
  164. package/dist/index.js +39 -36
  165. package/package.json +8 -1
  166. package/dist/chunk-3F4TXKDY.js.map +0 -1
  167. package/dist/chunk-FT2XBBQJ.js.map +0 -1
  168. package/dist/chunk-IKLA2CVQ.js.map +0 -1
  169. package/dist/chunk-QJNV7YQP.js.map +0 -1
  170. package/dist/chunk-X7APG7G2.js.map +0 -1
  171. package/dist/chunk-ZBW3BA5R.js.map +0 -1
  172. package/dist/chunk-ZQMNGPLE.js.map +0 -1
  173. package/dist/chunk-ZRD4FQBT.js +0 -153
  174. package/dist/chunk-ZRD4FQBT.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { defaultSemanticIcons } from './chunk-7Z4NMNX6.js';
2
2
  import { Slot } from './chunk-ZIBNLXIV.js';
3
- import { px } from './chunk-5A2QOOVN.js';
4
3
  import { cn } from './chunk-CHXHRJNZ.js';
4
+ import { px } from './chunk-5A2QOOVN.js';
5
5
  import { useThemeColors } from './chunk-R5JMDDCB.js';
6
6
  import { __name } from './chunk-WCQVDF3K.js';
7
7
  import { createContext, useContext, useState, useCallback } from 'react';
@@ -41,7 +41,15 @@ var Checkbox = /* @__PURE__ */ __name(({
41
41
  className,
42
42
  testID,
43
43
  asChild,
44
- children
44
+ children,
45
+ id,
46
+ name,
47
+ "aria-labelledby": ariaLabelledBy,
48
+ accessibilityLabelledBy,
49
+ "aria-describedby": ariaDescribedBy,
50
+ accessibilityDescribedBy,
51
+ "aria-invalid": ariaInvalid,
52
+ "aria-required": ariaRequired
45
53
  }) => {
46
54
  const colors = useThemeColors();
47
55
  const [inner, setInner] = useState(defaultChecked);
@@ -69,6 +77,13 @@ var Checkbox = /* @__PURE__ */ __name(({
69
77
  accessibilityState: { checked: value, disabled: Boolean(disabled) },
70
78
  testID
71
79
  };
80
+ if (id !== void 0) {
81
+ commonProps.id = id;
82
+ commonProps.nativeID = id;
83
+ }
84
+ if (name !== void 0) {
85
+ commonProps.name = name;
86
+ }
72
87
  if (disabled) {
73
88
  commonProps["aria-disabled"] = true;
74
89
  }
@@ -76,6 +91,26 @@ var Checkbox = /* @__PURE__ */ __name(({
76
91
  commonProps["aria-label"] = label;
77
92
  commonProps.accessibilityLabel = label;
78
93
  }
94
+ if (ariaLabelledBy !== void 0) {
95
+ commonProps["aria-labelledby"] = ariaLabelledBy;
96
+ commonProps.accessibilityLabelledBy = ariaLabelledBy;
97
+ }
98
+ if (accessibilityLabelledBy !== void 0) {
99
+ commonProps.accessibilityLabelledBy = accessibilityLabelledBy;
100
+ }
101
+ if (ariaDescribedBy !== void 0) {
102
+ commonProps["aria-describedby"] = ariaDescribedBy;
103
+ commonProps.accessibilityDescribedBy = ariaDescribedBy;
104
+ }
105
+ if (accessibilityDescribedBy !== void 0) {
106
+ commonProps.accessibilityDescribedBy = accessibilityDescribedBy;
107
+ }
108
+ if (ariaInvalid) {
109
+ commonProps["aria-invalid"] = true;
110
+ }
111
+ if (ariaRequired) {
112
+ commonProps["aria-required"] = true;
113
+ }
79
114
  if (asChild) {
80
115
  const slotProps = {
81
116
  role: "checkbox",
@@ -134,5 +169,5 @@ var Checkbox = /* @__PURE__ */ __name(({
134
169
  }, "Checkbox");
135
170
 
136
171
  export { Checkbox, SemanticIconsProvider, useSemanticIcon };
137
- //# sourceMappingURL=chunk-QJNV7YQP.js.map
138
- //# sourceMappingURL=chunk-QJNV7YQP.js.map
172
+ //# sourceMappingURL=chunk-WTNDPO2V.js.map
173
+ //# sourceMappingURL=chunk-WTNDPO2V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/icons/semantic-context.tsx","../src/icons/use-semantic-icon.ts","../src/components/Checkbox/Checkbox.tsx"],"names":["jsx","RNText"],"mappings":";;;;;;;;;;AAMO,IAAM,oBAAA,GAAuB,cAA6B,oBAAoB,CAAA;AACrF,oBAAA,CAAqB,WAAA,GAAc,sBAAA;AAO5B,SAAS,qBAAA,CAAsB,EAAE,KAAA,EAAO,QAAA,EAAS,EAA+B;AACnF,EAAA,MAAM,SAAwB,KAAA,GAAQ,EAAE,GAAG,oBAAA,EAAsB,GAAG,OAAM,GAAI,oBAAA;AAC9E,EAAA,2BAAQ,oBAAA,CAAqB,QAAA,EAArB,EAA8B,KAAA,EAAO,QAAS,QAAA,EAAS,CAAA;AACnE;AAHgB,MAAA,CAAA,qBAAA,EAAA,uBAAA,CAAA;;;ACRT,SAAS,gBAA+C,IAAA,EAA2B;AACtF,EAAA,MAAM,KAAA,GAAQ,WAAW,oBAAoB,CAAA;AAC7C,EAAA,OAAO,MAAM,IAAI,CAAA;AACrB;AAHgB,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA;ACoChB,IAAM,eAAA,GAA6B,EAAE,aAAA,EAAe,KAAA,EAAO,YAAY,QAAA,EAAS;AAChF,IAAM,eAAA,GAA6B;AAAA;AAAA,EAE/B,KAAA,EAAO,EAAA;AAAA,EACP,MAAA,EAAQ,EAAA;AAAA,EACR,WAAA,EAAa,CAAA;AAAA,EACb,UAAA,EAAY,QAAA;AAAA,EACZ,cAAA,EAAgB;AACpB,CAAA;AAMO,IAAM,2BAAW,MAAA,CAAA,CAAC;AAAA,EACrB,OAAA;AAAA,EACA,cAAA,GAAiB,KAAA;AAAA,EACjB,aAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,EAAA;AAAA,EACA,IAAA;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tC,EAAA,uBACI,IAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACG,OAAA,EAAS,MAAA;AAAA,MACR,GAAG,WAAA;AAAA,MACJ,WAAW,EAAA,CAAG,6BAAA,EAA+B,QAAA,GAAW,YAAA,GAAe,QAAW,SAAS,CAAA;AAAA,MAC3F,KAAA,EAAO,CAAC,QAAA,EAAU,QAAA,GAAW,EAAE,OAAA,EAAS,GAAA,KAAQ,IAAI,CAAA;AAAA,MAEpD,QAAA,EAAA;AAAA,wBAAAA,IAAC,IAAA,EAAA,EAAK,SAAA,EAAW,UAAA,EAAY,KAAA,EAAO,CAAC,YAAA,EAAc,OAAO,CAAA,EACrD,QAAA,EAAA,aAAA,IAAiB,CAAC,QAAA,mBACfA,IAAC,IAAA,EAAA,EAAK,KAAA,EAAO,EAAE,KAAA,EAAO,EAAA,EAAI,MAAA,EAAQ,CAAA,EAAG,cAAc,CAAA,EAAG,eAAA,EAAiB,QAAA,EAAS,EAAG,IACnF,KAAA,IAAS,CAAC,QAAA,mBACVA,IAAC,KAAA,EAAA,EAAM,IAAA,EAAM,IAAI,KAAA,EAAO,QAAA,EAAU,IAClC,IAAA,EACR,CAAA;AAAA,QACC,QAAA,KACI,KAAA,KAAU,MAAA,mBACPA,GAAAA;AAAA,UAACC,IAAA;AAAA,UAAA;AAAA,YACG,KAAA,EAAO;AAAA,cACH,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,OAAA;AAAA,cAC5B,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,cAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE;AAAA,aACnC;AAAA,YAEC,QAAA,EAAA;AAAA;AAAA,SACL,GACA,IAAA;AAAA;AAAA;AAAA,GACZ;AAER,CAAA,EAjKwB,UAAA","file":"chunk-WTNDPO2V.js","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { createContext } from 'react';\nimport { defaultSemanticIcons, type SemanticIcons } from './default-semantic-icons';\n\nexport const SemanticIconsContext = createContext<SemanticIcons>(defaultSemanticIcons);\nSemanticIconsContext.displayName = 'SemanticIconsContext';\n\nexport type SemanticIconsProviderProps = {\n icons?: Partial<SemanticIcons>;\n children?: ReactNode;\n};\n\nexport function SemanticIconsProvider({ icons, children }: SemanticIconsProviderProps) {\n const merged: SemanticIcons = icons ? { ...defaultSemanticIcons, ...icons } : defaultSemanticIcons;\n return <SemanticIconsContext.Provider value={merged}>{children}</SemanticIconsContext.Provider>;\n}\n","'use client';\n\nimport { useContext } from 'react';\nimport type { SemanticIcons } from './default-semantic-icons';\nimport { SemanticIconsContext } from './semantic-context';\n\nexport function useSemanticIcon<K extends keyof SemanticIcons>(name: K): SemanticIcons[K] {\n const icons = useContext(SemanticIconsContext);\n return icons[name];\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { useCallback, useState } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport { Pressable, Text as RNText, View } from 'react-native';\nimport { useSemanticIcon } from '../../icons/use-semantic-icon';\nimport { Slot } from '../../slot';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type CheckboxProps = {\n checked?: boolean;\n defaultChecked?: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n onChange?: (next: boolean) => void;\n label?: string;\n className?: string;\n testID?: string;\n asChild?: boolean;\n children?: ReactNode;\n /** DOM id / nativeID forwarded to the Pressable — used by Field.Control */\n id?: string;\n /** HTML name attribute (web only) */\n name?: string;\n /** aria-labelledby forwarded to the Pressable */\n 'aria-labelledby'?: string;\n /** React Native accessibilityLabelledBy forwarded to the Pressable */\n accessibilityLabelledBy?: string;\n /** aria-describedby forwarded to the Pressable */\n 'aria-describedby'?: string;\n /** React Native accessibilityDescribedBy forwarded to the Pressable */\n accessibilityDescribedBy?: string;\n /** Marks the control as invalid — set by Field.Control when there is an error */\n 'aria-invalid'?: boolean;\n /** Marks the control as required — set by Field.Control */\n 'aria-required'?: boolean;\n};\n\n// Layout-only base; theme-driven dimensions are merged inside the component.\nconst ROW_LAYOUT_BASE: ViewStyle = { flexDirection: 'row', alignItems: 'center' };\nconst BOX_LAYOUT_BASE: ViewStyle = {\n // 20×20 box — component-density literal — not from theme\n width: 20,\n height: 20,\n borderWidth: 1,\n alignItems: 'center',\n justifyContent: 'center',\n};\n\n/**\n * Checkbox — supports controlled + uncontrolled state, indeterminate (aria-checked=\"mixed\"),\n * asChild (via Slot), and a visible label that doubles as the accessibility label.\n */\nexport const Checkbox = ({\n checked,\n defaultChecked = false,\n indeterminate,\n disabled,\n onChange,\n label,\n className,\n testID,\n asChild,\n children,\n id,\n name,\n 'aria-labelledby': ariaLabelledBy,\n accessibilityLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n accessibilityDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n}: CheckboxProps) => {\n const colors = useThemeColors();\n const [inner, setInner] = useState<boolean>(defaultChecked);\n const isControlled = checked !== undefined;\n const value = isControlled ? Boolean(checked) : inner;\n\n const ariaChecked: 'true' | 'false' | 'mixed' = indeterminate ? 'mixed' : value ? 'true' : 'false';\n const isMarked = value || Boolean(indeterminate);\n\n const toggle = useCallback(() => {\n if (disabled) {\n return;\n }\n const next = !value;\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n }, [disabled, value, isControlled, onChange]);\n\n const Check = useSemanticIcon('checkmark');\n\n const rowStyle: ViewStyle = { ...ROW_LAYOUT_BASE, gap: px(colors.spacing['2']) };\n const boxBaseStyle: ViewStyle = { ...BOX_LAYOUT_BASE, borderRadius: px(colors.radius.sm) };\n\n const commonProps: Record<string, unknown> = {\n role: 'checkbox',\n 'aria-checked': ariaChecked,\n accessibilityRole: 'checkbox' as const,\n accessibilityState: { checked: value, disabled: Boolean(disabled) },\n testID,\n };\n if (id !== undefined) {\n commonProps.id = id;\n commonProps.nativeID = id;\n }\n if (name !== undefined) {\n commonProps.name = name;\n }\n if (disabled) {\n commonProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n commonProps['aria-label'] = label;\n commonProps.accessibilityLabel = label;\n }\n if (ariaLabelledBy !== undefined) {\n commonProps['aria-labelledby'] = ariaLabelledBy;\n commonProps.accessibilityLabelledBy = ariaLabelledBy;\n }\n if (accessibilityLabelledBy !== undefined) {\n commonProps.accessibilityLabelledBy = accessibilityLabelledBy;\n }\n if (ariaDescribedBy !== undefined) {\n commonProps['aria-describedby'] = ariaDescribedBy;\n commonProps.accessibilityDescribedBy = ariaDescribedBy;\n }\n if (accessibilityDescribedBy !== undefined) {\n commonProps.accessibilityDescribedBy = accessibilityDescribedBy;\n }\n if (ariaInvalid) {\n commonProps['aria-invalid'] = true;\n }\n if (ariaRequired) {\n commonProps['aria-required'] = true;\n }\n\n if (asChild) {\n const slotProps: Record<string, unknown> = {\n role: 'checkbox',\n 'aria-checked': ariaChecked,\n onClick: toggle,\n };\n if (disabled) {\n slotProps['aria-disabled'] = true;\n }\n if (label !== undefined) {\n slotProps['aria-label'] = label;\n }\n if (testID !== undefined) {\n slotProps['data-testid'] = testID;\n }\n if (className !== undefined) {\n slotProps.className = className;\n }\n return <Slot {...slotProps}>{children}</Slot>;\n }\n\n const boxClasses = cn(\n 'w-5 h-5 rounded-sm border items-center justify-center',\n isMarked && !disabled\n ? 'bg-semantic-interactive-primary border-semantic-interactive-primary'\n : 'bg-semantic-background-elevated border-semantic-border-strong'\n );\n const boxFill: ViewStyle =\n isMarked && !disabled\n ? {\n backgroundColor: colors.semantic.interactive.primary,\n borderColor: colors.semantic.interactive.primary,\n }\n : {\n backgroundColor: colors.semantic.background.elevated,\n borderColor: colors.semantic.border.strong,\n };\n\n // The whole row is the interactive element so clicking the label text\n // toggles the checkbox. The visual box is a non-interactive View — one\n // role=\"checkbox\" per logical control, not two competing hit-areas.\n // Indeterminate uses a horizontal dash (the W3C convention) rather than\n // a checkmark, so the user can tell at a glance that the state is\n // \"partial / mixed\", not \"fully checked.\" Clicking still fires onChange\n // — consumers typically toggle indeterminate off and set checked=true\n // in their handler.\n const inverted = colors.semantic.text.inverted;\n return (\n <Pressable\n onPress={toggle}\n {...commonProps}\n className={cn('flex-row items-center gap-2', disabled ? 'opacity-60' : undefined, className)}\n style={[rowStyle, disabled ? { opacity: 0.6 } : null]}\n >\n <View className={boxClasses} style={[boxBaseStyle, boxFill]}>\n {indeterminate && !disabled ? (\n <View style={{ width: 10, height: 2, borderRadius: 1, backgroundColor: inverted }} />\n ) : value && !disabled ? (\n <Check size={14} color={inverted} />\n ) : null}\n </View>\n {children ??\n (label !== undefined ? (\n <RNText\n style={{\n color: colors.semantic.text.default,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n }}\n >\n {label}\n </RNText>\n ) : null)}\n </Pressable>\n );\n};\n"]}
@@ -0,0 +1,343 @@
1
+ import { Popover } from './chunk-7D2BHQ6M.js';
2
+ import { useLocale, Calendar } from './chunk-HZKXPN6B.js';
3
+ import { cn } from './chunk-CHXHRJNZ.js';
4
+ import { px } from './chunk-5A2QOOVN.js';
5
+ import { useThemeColors } from './chunk-R5JMDDCB.js';
6
+ import { __name } from './chunk-WCQVDF3K.js';
7
+ import { getLocalTimeZone } from '@internationalized/date';
8
+ import { useState, useCallback } from 'react';
9
+ import { Platform, Text, Pressable, View } from 'react-native';
10
+ import { jsx, jsxs } from 'nativewind/jsx-runtime';
11
+
12
+ function formatDate(date, locale) {
13
+ try {
14
+ return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date.toDate(getLocalTimeZone()));
15
+ } catch {
16
+ return `${date.year}-${String(date.month).padStart(2, "0")}-${String(date.day).padStart(2, "0")}`;
17
+ }
18
+ }
19
+ __name(formatDate, "formatDate");
20
+ function CalendarIcon({ size = 16, color = "currentColor" }) {
21
+ const colors = useThemeColors();
22
+ if (Platform.OS === "web") {
23
+ return /* @__PURE__ */ jsx(
24
+ "svg",
25
+ {
26
+ width: size,
27
+ height: size,
28
+ viewBox: "0 0 24 24",
29
+ fill: "none",
30
+ stroke: color,
31
+ strokeWidth: "2",
32
+ strokeLinecap: "round",
33
+ strokeLinejoin: "round",
34
+ "aria-hidden": "true",
35
+ children: /* @__PURE__ */ jsx("path", { d: "M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z" })
36
+ }
37
+ );
38
+ }
39
+ const resolvedColor = color === "currentColor" ? colors.semantic.text.muted : color;
40
+ return /* @__PURE__ */ jsx(
41
+ Text,
42
+ {
43
+ accessibilityElementsHidden: true,
44
+ importantForAccessibility: "no-hide-descendants",
45
+ style: { fontSize: size, lineHeight: size, color: resolvedColor },
46
+ children: "\u{1F4C5}"
47
+ }
48
+ );
49
+ }
50
+ __name(CalendarIcon, "CalendarIcon");
51
+ function buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek) {
52
+ const out = {};
53
+ if (minValue !== void 0) {
54
+ out.minValue = minValue;
55
+ }
56
+ if (maxValue !== void 0) {
57
+ out.maxValue = maxValue;
58
+ }
59
+ if (isDateUnavailable !== void 0) {
60
+ out.isDateUnavailable = isDateUnavailable;
61
+ }
62
+ if (firstDayOfWeek !== void 0) {
63
+ out.firstDayOfWeek = firstDayOfWeek;
64
+ }
65
+ return out;
66
+ }
67
+ __name(buildCalendarOptional, "buildCalendarOptional");
68
+ function buildTriggerAriaProps(ariaProps) {
69
+ const out = {};
70
+ if (ariaProps["aria-labelledby"] !== void 0) {
71
+ out["aria-labelledby"] = ariaProps["aria-labelledby"];
72
+ }
73
+ if (ariaProps["aria-describedby"] !== void 0) {
74
+ out["aria-describedby"] = ariaProps["aria-describedby"];
75
+ }
76
+ if (ariaProps["aria-invalid"] !== void 0) {
77
+ out["aria-invalid"] = ariaProps["aria-invalid"];
78
+ }
79
+ if (ariaProps["aria-required"] !== void 0) {
80
+ out["aria-required"] = ariaProps["aria-required"];
81
+ }
82
+ return out;
83
+ }
84
+ __name(buildTriggerAriaProps, "buildTriggerAriaProps");
85
+ var DatePickerRoot = /* @__PURE__ */ __name(({
86
+ value,
87
+ defaultValue,
88
+ onChange,
89
+ locale: localeProp,
90
+ minValue,
91
+ maxValue,
92
+ isDateUnavailable,
93
+ firstDayOfWeek,
94
+ placeholder,
95
+ disabled = false,
96
+ id,
97
+ name: _name,
98
+ className,
99
+ testID,
100
+ ...ariaProps
101
+ }) => {
102
+ const providerLocale = useLocale();
103
+ const locale = localeProp ?? providerLocale;
104
+ const [open, setOpen] = useState(false);
105
+ const isControlled = value !== void 0;
106
+ const [inner, setInner] = useState(defaultValue ?? null);
107
+ const current = isControlled ? value ?? null : inner;
108
+ const handleChange = useCallback(
109
+ (date) => {
110
+ if (!isControlled) {
111
+ setInner(date);
112
+ }
113
+ onChange?.(date);
114
+ setOpen(false);
115
+ },
116
+ [isControlled, onChange]
117
+ );
118
+ const handleOpenChange = useCallback(
119
+ (next) => {
120
+ if (!disabled) {
121
+ setOpen(next);
122
+ }
123
+ },
124
+ [disabled]
125
+ );
126
+ const displayValue = current ? formatDate(current, locale) : null;
127
+ const calendarOptional = buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek);
128
+ const triggerAriaProps = buildTriggerAriaProps(ariaProps);
129
+ const colors = useThemeColors();
130
+ const hasError = ariaProps["aria-invalid"] === true || ariaProps["aria-invalid"] === "true";
131
+ const pressableStyle = {
132
+ flexDirection: "row",
133
+ alignItems: "center",
134
+ borderWidth: 1,
135
+ borderRadius: px(colors.radius.md),
136
+ paddingHorizontal: px(colors.spacing["3"]),
137
+ paddingVertical: px(colors.spacing["2"]),
138
+ backgroundColor: colors.semantic.background.elevated,
139
+ borderColor: hasError ? colors.color.danger : colors.semantic.border.default,
140
+ opacity: disabled ? 0.6 : 1
141
+ };
142
+ const textStyle = {
143
+ flex: 1,
144
+ fontFamily: colors.fontFamily.body,
145
+ fontSize: px(colors.fontSize.md),
146
+ color: displayValue ? colors.semantic.text.default : colors.semantic.text.muted
147
+ };
148
+ const triggerExtraProps = {
149
+ role: "combobox",
150
+ accessibilityRole: "button",
151
+ "aria-haspopup": "dialog",
152
+ "aria-expanded": open,
153
+ ...triggerAriaProps
154
+ };
155
+ if (id !== void 0) {
156
+ triggerExtraProps.id = id;
157
+ triggerExtraProps.nativeID = id;
158
+ }
159
+ if (testID !== void 0) {
160
+ triggerExtraProps.testID = testID;
161
+ }
162
+ if (hasError) {
163
+ triggerExtraProps["aria-invalid"] = true;
164
+ }
165
+ if (ariaProps["aria-required"]) {
166
+ triggerExtraProps["aria-required"] = true;
167
+ }
168
+ if (disabled) {
169
+ triggerExtraProps["aria-disabled"] = true;
170
+ }
171
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
172
+ /* @__PURE__ */ jsx(Popover.Trigger, { asChild: false, className: cn(className), children: /* @__PURE__ */ jsxs(
173
+ Pressable,
174
+ {
175
+ onPress: disabled ? void 0 : () => setOpen(!open),
176
+ disabled,
177
+ className: cn(
178
+ "flex-row items-center rounded-md border px-3 py-2",
179
+ hasError ? "border-semantic-interactive-destructive" : "border-semantic-border-default",
180
+ disabled ? "opacity-60" : void 0,
181
+ className
182
+ ),
183
+ style: pressableStyle,
184
+ ...triggerExtraProps,
185
+ children: [
186
+ /* @__PURE__ */ jsx(Text, { style: textStyle, numberOfLines: 1, children: displayValue ?? placeholder ?? "" }),
187
+ /* @__PURE__ */ jsx(View, { style: { marginLeft: px(colors.spacing["2"]) }, children: /* @__PURE__ */ jsx(CalendarIcon, { size: 16, color: colors.semantic.text.muted }) })
188
+ ]
189
+ }
190
+ ) }),
191
+ /* @__PURE__ */ jsx(Popover.Content, { "aria-label": "Date picker", side: "bottom", align: "start", children: /* @__PURE__ */ jsx(
192
+ Calendar,
193
+ {
194
+ mode: "single",
195
+ value: current,
196
+ onChange: (date) => {
197
+ handleChange(date);
198
+ },
199
+ locale,
200
+ ...calendarOptional
201
+ }
202
+ ) })
203
+ ] });
204
+ }, "DatePickerRoot");
205
+ var DatePickerRange = /* @__PURE__ */ __name(({
206
+ value,
207
+ defaultValue,
208
+ onChange,
209
+ locale: localeProp,
210
+ minValue,
211
+ maxValue,
212
+ isDateUnavailable,
213
+ firstDayOfWeek,
214
+ placeholder,
215
+ disabled = false,
216
+ id,
217
+ name: _name,
218
+ className,
219
+ testID,
220
+ ...ariaProps
221
+ }) => {
222
+ const providerLocale = useLocale();
223
+ const locale = localeProp ?? providerLocale;
224
+ const [open, setOpen] = useState(false);
225
+ const isControlled = value !== void 0;
226
+ const [inner, setInner] = useState(defaultValue ?? { start: null, end: null });
227
+ const current = isControlled ? value ?? { start: null, end: null } : inner;
228
+ const calendarValue = current.start !== null ? { start: current.start, end: current.end } : null;
229
+ const handleChange = useCallback(
230
+ (calRange) => {
231
+ const next = {
232
+ start: calRange?.start ?? null,
233
+ end: calRange?.end ?? null
234
+ };
235
+ if (!isControlled) {
236
+ setInner(next);
237
+ }
238
+ onChange?.(next);
239
+ if (next.start !== null && next.end !== null) {
240
+ setOpen(false);
241
+ }
242
+ },
243
+ [isControlled, onChange]
244
+ );
245
+ const handleOpenChange = useCallback(
246
+ (next) => {
247
+ if (!disabled) {
248
+ setOpen(next);
249
+ }
250
+ },
251
+ [disabled]
252
+ );
253
+ let displayValue = null;
254
+ if (current.start !== null) {
255
+ const startStr = formatDate(current.start, locale);
256
+ const endStr = current.end !== null ? formatDate(current.end, locale) : "";
257
+ displayValue = `${startStr} \u2013 ${endStr}`;
258
+ }
259
+ const calendarOptional = buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek);
260
+ const triggerAriaProps = buildTriggerAriaProps(ariaProps);
261
+ const colors = useThemeColors();
262
+ const hasError = ariaProps["aria-invalid"] === true || ariaProps["aria-invalid"] === "true";
263
+ const pressableStyle = {
264
+ flexDirection: "row",
265
+ alignItems: "center",
266
+ borderWidth: 1,
267
+ borderRadius: px(colors.radius.md),
268
+ paddingHorizontal: px(colors.spacing["3"]),
269
+ paddingVertical: px(colors.spacing["2"]),
270
+ backgroundColor: colors.semantic.background.elevated,
271
+ borderColor: hasError ? colors.color.danger : colors.semantic.border.default,
272
+ opacity: disabled ? 0.6 : 1
273
+ };
274
+ const textStyle = {
275
+ flex: 1,
276
+ fontFamily: colors.fontFamily.body,
277
+ fontSize: px(colors.fontSize.md),
278
+ color: displayValue ? colors.semantic.text.default : colors.semantic.text.muted
279
+ };
280
+ const triggerExtraProps = {
281
+ role: "combobox",
282
+ accessibilityRole: "button",
283
+ "aria-haspopup": "dialog",
284
+ "aria-expanded": open,
285
+ ...triggerAriaProps
286
+ };
287
+ if (id !== void 0) {
288
+ triggerExtraProps.id = id;
289
+ triggerExtraProps.nativeID = id;
290
+ }
291
+ if (testID !== void 0) {
292
+ triggerExtraProps.testID = testID;
293
+ }
294
+ if (hasError) {
295
+ triggerExtraProps["aria-invalid"] = true;
296
+ }
297
+ if (ariaProps["aria-required"]) {
298
+ triggerExtraProps["aria-required"] = true;
299
+ }
300
+ if (disabled) {
301
+ triggerExtraProps["aria-disabled"] = true;
302
+ }
303
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
304
+ /* @__PURE__ */ jsx(Popover.Trigger, { asChild: false, className: cn(className), children: /* @__PURE__ */ jsxs(
305
+ Pressable,
306
+ {
307
+ onPress: disabled ? void 0 : () => setOpen(!open),
308
+ disabled,
309
+ className: cn(
310
+ "flex-row items-center rounded-md border px-3 py-2",
311
+ hasError ? "border-semantic-interactive-destructive" : "border-semantic-border-default",
312
+ disabled ? "opacity-60" : void 0,
313
+ className
314
+ ),
315
+ style: pressableStyle,
316
+ ...triggerExtraProps,
317
+ children: [
318
+ /* @__PURE__ */ jsx(Text, { style: textStyle, numberOfLines: 1, children: displayValue ?? placeholder ?? "" }),
319
+ /* @__PURE__ */ jsx(View, { style: { marginLeft: px(colors.spacing["2"]) }, children: /* @__PURE__ */ jsx(CalendarIcon, { size: 16, color: colors.semantic.text.muted }) })
320
+ ]
321
+ }
322
+ ) }),
323
+ /* @__PURE__ */ jsx(Popover.Content, { "aria-label": "Date range picker", side: "bottom", align: "start", children: /* @__PURE__ */ jsx(
324
+ Calendar,
325
+ {
326
+ mode: "range",
327
+ value: calendarValue,
328
+ onChange: (range) => {
329
+ handleChange(range);
330
+ },
331
+ locale,
332
+ ...calendarOptional
333
+ }
334
+ ) })
335
+ ] });
336
+ }, "DatePickerRange");
337
+ var DatePicker = Object.assign(DatePickerRoot, {
338
+ Range: DatePickerRange
339
+ });
340
+
341
+ export { DatePicker };
342
+ //# sourceMappingURL=chunk-XBNVKPJN.js.map
343
+ //# sourceMappingURL=chunk-XBNVKPJN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/DatePicker/DatePicker.tsx"],"names":["RNText"],"mappings":";;;;;;;;;;;AAmBA,SAAS,UAAA,CAAW,MAAoB,MAAA,EAAwB;AAC5D,EAAA,IAAI;AACA,IAAA,OAAO,IAAI,IAAA,CAAK,cAAA,CAAe,MAAA,EAAQ,EAAE,SAAA,EAAW,QAAA,EAAU,CAAA,CAAE,MAAA,CAAO,IAAA,CAAK,MAAA,CAAO,gBAAA,EAAkB,CAAC,CAAA;AAAA,EAC1G,CAAA,CAAA,MAAQ;AACJ,IAAA,OAAO,CAAA,EAAG,KAAK,IAAI,CAAA,CAAA,EAAI,OAAO,IAAA,CAAK,KAAK,EAAE,QAAA,CAAS,CAAA,EAAG,GAAG,CAAC,CAAA,CAAA,EAAI,OAAO,IAAA,CAAK,GAAG,EAAE,QAAA,CAAS,CAAA,EAAG,GAAG,CAAC,CAAA,CAAA;AAAA,EACnG;AACJ;AANS,MAAA,CAAA,UAAA,EAAA,YAAA,CAAA;AAYT,SAAS,aAAa,EAAE,IAAA,GAAO,EAAA,EAAI,KAAA,GAAQ,gBAAe,EAAsC;AAC5F,EAAA,MAAM,SAAS,cAAA,EAAe;AAE9B,EAAA,IAAI,QAAA,CAAS,OAAO,KAAA,EAAO;AAC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A;AAAA,QACN,GAAI,iBAAA;AAAA,QAEL,QAAA,EAAA;AAAA,0BAAA,GAAA,CAACA,QAAO,KAAA,EAAO,SAAA,EAAW,eAAe,CAAA,EACpC,QAAA,EAAA,YAAA,IAAgB,eAAe,EAAA,EACpC,CAAA;AAAA,0BACA,GAAA,CAAC,QAAK,KAAA,EAAO,EAAE,YAAY,EAAA,CAAG,MAAA,CAAO,QAAQ,GAAG,CAAC,GAAE,EAC/C,QAAA,kBAAA,GAAA,CAAC,gBAAa,IAAA,EAAM,EAAA,EAAI,OAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,KAAA,EAAO,CAAA,EAC/D;AAAA;AAAA;AAAA,KACJ,EACJ,CAAA;AAAA,oBACA,GAAA,CAAC,QAAQ,OAAA,EAAR,EAAgB,cAAW,mBAAA,EAAoB,IAAA,EAAK,QAAA,EAAS,KAAA,EAAM,OAAA,EAChE,QAAA,kBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACG,IAAA,EAAK,OAAA;AAAA,QACL,KAAA,EAAO,aAAA;AAAA,QACP,QAAA,EAAU,CAAC,KAAA,KAAU;AACjB,UAAA,YAAA,CAAa,KAAyB,CAAA;AAAA,QAC1C,CAAA;AAAA,QACA,MAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACR,EACJ;AAAA,GAAA,EACJ,CAAA;AAER,CAAA,EAlJwB,iBAAA,CAAA;AAwJjB,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACpD,KAAA,EAAO;AACX,CAAC","file":"chunk-XBNVKPJN.js","sourcesContent":["'use client';\n\nimport type { CalendarDate } from '@internationalized/date';\nimport { getLocalTimeZone } from '@internationalized/date';\nimport { useCallback, useState } from 'react';\nimport { Platform, Pressable, Text as RNText, View } from 'react-native';\nimport { useLocale } from '../../i18n/locale';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\nimport type { DateRange } from '../Calendar';\nimport { Calendar } from '../Calendar';\nimport { Popover } from '../Popover';\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Format a single CalendarDate for display using Intl. */\nfunction formatDate(date: CalendarDate, locale: string): string {\n try {\n return new Intl.DateTimeFormat(locale, { dateStyle: 'medium' }).format(date.toDate(getLocalTimeZone()));\n } catch {\n return `${date.year}-${String(date.month).padStart(2, '0')}-${String(date.day).padStart(2, '0')}`;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Calendar icon\n// ---------------------------------------------------------------------------\n\nfunction CalendarIcon({ size = 16, color = 'currentColor' }: { size?: number; color?: string }) {\n const colors = useThemeColors();\n\n if (Platform.OS === 'web') {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z\" />\n </svg>\n );\n }\n\n const resolvedColor = color === 'currentColor' ? colors.semantic.text.muted : color;\n return (\n <RNText\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={{ fontSize: size, lineHeight: size, color: resolvedColor }}\n >\n {'📅'}\n </RNText>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type DatePickerProps = {\n value?: CalendarDate | null;\n defaultValue?: CalendarDate | null;\n onChange?: (date: CalendarDate | null) => void;\n\n /** BCP 47 locale; defaults from NoriProvider's i18n context. */\n locale?: string;\n\n /** Min/max selectable date. */\n minValue?: CalendarDate;\n maxValue?: CalendarDate;\n\n /** Custom unavailable predicate. */\n isDateUnavailable?: (date: CalendarDate) => boolean;\n\n /** First day of week override (0=Sun, 1=Mon, ...). Defaults from locale. */\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\n /** Placeholder text shown when no value. */\n placeholder?: string;\n\n /** Disable the whole picker. */\n disabled?: boolean;\n\n // A11y / Field.Control hook props\n id?: string;\n name?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: boolean;\n 'aria-required'?: boolean;\n\n testID?: string;\n className?: string;\n};\n\nexport type DateRangeValue = { start: CalendarDate | null; end: CalendarDate | null };\n\nexport type DatePickerRangeProps = {\n value?: DateRangeValue;\n defaultValue?: DateRangeValue;\n onChange?: (range: DateRangeValue) => void;\n\n locale?: string;\n minValue?: CalendarDate;\n maxValue?: CalendarDate;\n isDateUnavailable?: (date: CalendarDate) => boolean;\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n placeholder?: string;\n disabled?: boolean;\n\n id?: string;\n name?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: boolean;\n 'aria-required'?: boolean;\n\n testID?: string;\n className?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Shared Calendar optional props builder\n// ---------------------------------------------------------------------------\n\ntype CalendarOptional = {\n minValue?: CalendarDate;\n maxValue?: CalendarDate;\n isDateUnavailable?: (date: CalendarDate) => boolean;\n firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n};\n\nfunction buildCalendarOptional(\n minValue: CalendarDate | undefined,\n maxValue: CalendarDate | undefined,\n isDateUnavailable: ((date: CalendarDate) => boolean) | undefined,\n firstDayOfWeek: (0 | 1 | 2 | 3 | 4 | 5 | 6) | undefined\n): CalendarOptional {\n const out: CalendarOptional = {};\n if (minValue !== undefined) {\n out.minValue = minValue;\n }\n if (maxValue !== undefined) {\n out.maxValue = maxValue;\n }\n if (isDateUnavailable !== undefined) {\n out.isDateUnavailable = isDateUnavailable;\n }\n if (firstDayOfWeek !== undefined) {\n out.firstDayOfWeek = firstDayOfWeek;\n }\n return out;\n}\n\nfunction buildTriggerAriaProps(ariaProps: {\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: boolean;\n 'aria-required'?: boolean;\n}): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n if (ariaProps['aria-labelledby'] !== undefined) {\n out['aria-labelledby'] = ariaProps['aria-labelledby'];\n }\n if (ariaProps['aria-describedby'] !== undefined) {\n out['aria-describedby'] = ariaProps['aria-describedby'];\n }\n if (ariaProps['aria-invalid'] !== undefined) {\n out['aria-invalid'] = ariaProps['aria-invalid'];\n }\n if (ariaProps['aria-required'] !== undefined) {\n out['aria-required'] = ariaProps['aria-required'];\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// DatePicker (single)\n//\n// Uses Popover.Trigger + asChild so the Popover correctly sets the trigger\n// ref for web positioning and handles outside-click dismissal.\n// The trigger renders as a Pressable (via Popover.Trigger asChild pattern).\n// ---------------------------------------------------------------------------\n\nconst DatePickerRoot = ({\n value,\n defaultValue,\n onChange,\n locale: localeProp,\n minValue,\n maxValue,\n isDateUnavailable,\n firstDayOfWeek,\n placeholder,\n disabled = false,\n id,\n name: _name,\n className,\n testID,\n ...ariaProps\n}: DatePickerProps) => {\n const providerLocale = useLocale();\n const locale = localeProp ?? providerLocale;\n\n const [open, setOpen] = useState(false);\n\n const isControlled = value !== undefined;\n const [inner, setInner] = useState<CalendarDate | null>(defaultValue ?? null);\n const current = isControlled ? (value ?? null) : inner;\n\n const handleChange = useCallback(\n (date: CalendarDate | null) => {\n if (!isControlled) {\n setInner(date);\n }\n onChange?.(date);\n setOpen(false);\n },\n [isControlled, onChange]\n );\n\n const handleOpenChange = useCallback(\n (next: boolean) => {\n if (!disabled) {\n setOpen(next);\n }\n },\n [disabled]\n );\n\n const displayValue = current ? formatDate(current, locale) : null;\n const calendarOptional = buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek);\n const triggerAriaProps = buildTriggerAriaProps(ariaProps);\n\n const colors = useThemeColors();\n const hasError = ariaProps['aria-invalid'] === true || (ariaProps['aria-invalid'] as unknown as string) === 'true';\n\n const pressableStyle = {\n flexDirection: 'row' as const,\n alignItems: 'center' as const,\n borderWidth: 1,\n borderRadius: px(colors.radius.md),\n paddingHorizontal: px(colors.spacing['3']),\n paddingVertical: px(colors.spacing['2']),\n backgroundColor: colors.semantic.background.elevated,\n borderColor: hasError ? colors.color.danger : colors.semantic.border.default,\n opacity: disabled ? 0.6 : 1,\n };\n\n const textStyle = {\n flex: 1,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n color: displayValue ? colors.semantic.text.default : colors.semantic.text.muted,\n };\n\n // Extra a11y props for the trigger\n const triggerExtraProps: Record<string, unknown> = {\n role: 'combobox',\n accessibilityRole: 'button',\n 'aria-haspopup': 'dialog',\n 'aria-expanded': open,\n ...triggerAriaProps,\n };\n if (id !== undefined) {\n triggerExtraProps.id = id;\n triggerExtraProps.nativeID = id;\n }\n if (testID !== undefined) {\n triggerExtraProps.testID = testID;\n }\n if (hasError) {\n triggerExtraProps['aria-invalid'] = true;\n }\n if (ariaProps['aria-required']) {\n triggerExtraProps['aria-required'] = true;\n }\n if (disabled) {\n triggerExtraProps['aria-disabled'] = true;\n }\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <Popover.Trigger asChild={false} className={cn(className)}>\n <Pressable\n onPress={disabled ? undefined : () => setOpen(!open)}\n disabled={disabled}\n className={cn(\n 'flex-row items-center rounded-md border px-3 py-2',\n hasError ? 'border-semantic-interactive-destructive' : 'border-semantic-border-default',\n disabled ? 'opacity-60' : undefined,\n className\n )}\n style={pressableStyle}\n {...(triggerExtraProps as Record<string, unknown>)}\n >\n <RNText style={textStyle} numberOfLines={1}>\n {displayValue ?? placeholder ?? ''}\n </RNText>\n <View style={{ marginLeft: px(colors.spacing['2']) }}>\n <CalendarIcon size={16} color={colors.semantic.text.muted} />\n </View>\n </Pressable>\n </Popover.Trigger>\n <Popover.Content aria-label=\"Date picker\" side=\"bottom\" align=\"start\">\n <Calendar\n mode=\"single\"\n value={current}\n onChange={(date) => {\n handleChange(date as CalendarDate | null);\n }}\n locale={locale}\n {...calendarOptional}\n />\n </Popover.Content>\n </Popover>\n );\n};\n\n// ---------------------------------------------------------------------------\n// DatePicker.Range\n// ---------------------------------------------------------------------------\n\nconst DatePickerRange = ({\n value,\n defaultValue,\n onChange,\n locale: localeProp,\n minValue,\n maxValue,\n isDateUnavailable,\n firstDayOfWeek,\n placeholder,\n disabled = false,\n id,\n name: _name,\n className,\n testID,\n ...ariaProps\n}: DatePickerRangeProps) => {\n const providerLocale = useLocale();\n const locale = localeProp ?? providerLocale;\n\n const [open, setOpen] = useState(false);\n\n const isControlled = value !== undefined;\n const [inner, setInner] = useState<DateRangeValue>(defaultValue ?? { start: null, end: null });\n const current = isControlled ? (value ?? { start: null, end: null }) : inner;\n\n const calendarValue: DateRange | null = current.start !== null ? { start: current.start, end: current.end } : null;\n\n const handleChange = useCallback(\n (calRange: DateRange | null) => {\n const next: DateRangeValue = {\n start: calRange?.start ?? null,\n end: calRange?.end ?? null,\n };\n if (!isControlled) {\n setInner(next);\n }\n onChange?.(next);\n if (next.start !== null && next.end !== null) {\n setOpen(false);\n }\n },\n [isControlled, onChange]\n );\n\n const handleOpenChange = useCallback(\n (next: boolean) => {\n if (!disabled) {\n setOpen(next);\n }\n },\n [disabled]\n );\n\n let displayValue: string | null = null;\n if (current.start !== null) {\n const startStr = formatDate(current.start, locale);\n const endStr = current.end !== null ? formatDate(current.end, locale) : '';\n displayValue = `${startStr} – ${endStr}`;\n }\n\n const calendarOptional = buildCalendarOptional(minValue, maxValue, isDateUnavailable, firstDayOfWeek);\n const triggerAriaProps = buildTriggerAriaProps(ariaProps);\n\n const colors = useThemeColors();\n const hasError = ariaProps['aria-invalid'] === true || (ariaProps['aria-invalid'] as unknown as string) === 'true';\n\n const pressableStyle = {\n flexDirection: 'row' as const,\n alignItems: 'center' as const,\n borderWidth: 1,\n borderRadius: px(colors.radius.md),\n paddingHorizontal: px(colors.spacing['3']),\n paddingVertical: px(colors.spacing['2']),\n backgroundColor: colors.semantic.background.elevated,\n borderColor: hasError ? colors.color.danger : colors.semantic.border.default,\n opacity: disabled ? 0.6 : 1,\n };\n\n const textStyle = {\n flex: 1,\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.md),\n color: displayValue ? colors.semantic.text.default : colors.semantic.text.muted,\n };\n\n const triggerExtraProps: Record<string, unknown> = {\n role: 'combobox',\n accessibilityRole: 'button',\n 'aria-haspopup': 'dialog',\n 'aria-expanded': open,\n ...triggerAriaProps,\n };\n if (id !== undefined) {\n triggerExtraProps.id = id;\n triggerExtraProps.nativeID = id;\n }\n if (testID !== undefined) {\n triggerExtraProps.testID = testID;\n }\n if (hasError) {\n triggerExtraProps['aria-invalid'] = true;\n }\n if (ariaProps['aria-required']) {\n triggerExtraProps['aria-required'] = true;\n }\n if (disabled) {\n triggerExtraProps['aria-disabled'] = true;\n }\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <Popover.Trigger asChild={false} className={cn(className)}>\n <Pressable\n onPress={disabled ? undefined : () => setOpen(!open)}\n disabled={disabled}\n className={cn(\n 'flex-row items-center rounded-md border px-3 py-2',\n hasError ? 'border-semantic-interactive-destructive' : 'border-semantic-border-default',\n disabled ? 'opacity-60' : undefined,\n className\n )}\n style={pressableStyle}\n {...(triggerExtraProps as Record<string, unknown>)}\n >\n <RNText style={textStyle} numberOfLines={1}>\n {displayValue ?? placeholder ?? ''}\n </RNText>\n <View style={{ marginLeft: px(colors.spacing['2']) }}>\n <CalendarIcon size={16} color={colors.semantic.text.muted} />\n </View>\n </Pressable>\n </Popover.Trigger>\n <Popover.Content aria-label=\"Date range picker\" side=\"bottom\" align=\"start\">\n <Calendar\n mode=\"range\"\n value={calendarValue}\n onChange={(range) => {\n handleChange(range as DateRange | null);\n }}\n locale={locale}\n {...calendarOptional}\n />\n </Popover.Content>\n </Popover>\n );\n};\n\n// ---------------------------------------------------------------------------\n// Public export\n// ---------------------------------------------------------------------------\n\nexport const DatePicker = Object.assign(DatePickerRoot, {\n Range: DatePickerRange,\n});\n"]}
@@ -1,5 +1,5 @@
1
- import { px } from './chunk-5A2QOOVN.js';
2
1
  import { cn } from './chunk-CHXHRJNZ.js';
2
+ import { px } from './chunk-5A2QOOVN.js';
3
3
  import { useThemeColors } from './chunk-R5JMDDCB.js';
4
4
  import { __name } from './chunk-WCQVDF3K.js';
5
5
  import { useRef, useEffect } from 'react';
@@ -165,5 +165,5 @@ var Progress = /* @__PURE__ */ __name(({
165
165
  }, "Progress");
166
166
 
167
167
  export { Progress };
168
- //# sourceMappingURL=chunk-FEPTH5RV.js.map
169
- //# sourceMappingURL=chunk-FEPTH5RV.js.map
168
+ //# sourceMappingURL=chunk-XP55RZ3D.js.map
169
+ //# sourceMappingURL=chunk-XP55RZ3D.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Progress/Progress.tsx"],"names":["RNText"],"mappings":";;;;;;;;AAmDA,IAAM,OAAA,GAAwC;AAAA,EAC1C,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI;AACR,CAAA;AAEA,IAAM,yBAAA,GAA4B,IAAA;AAClC,IAAM,iBAAA,GAAoB,EAAA;AAmBnB,IAAM,2BAAW,MAAA,CAAA,CAAC;AAAA,EACrB,KAAA;AAAA,EACA,GAAA,GAAM,GAAA;AAAA,EACN,IAAA,GAAO,SAAA;AAAA,EACP,IAAA,GAAO,IAAA;AAAA,EACP,KAAA;AAAA,EACA,cAAA,GAAiB,KAAA;AAAA,EACjB,SAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACP,CAAA,KAAqB;AACjB,EAAA,MAAM,SAAS,cAAA,EAAe;AAC9B,EAAA,MAAM,SAAA,GAAY,KAAK,YAAY,CAAA;AACnC,EAAA,MAAM,cAAA,GAAiB,KAAK,iBAAiB,CAAA;AAE7C,EAAA,MAAM,kBA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","sourcesContent":["'use client';\n\nimport { useEffect, useRef } from 'react';\nimport { Animated, Easing, Text as RNText, View, type ViewStyle } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type ProgressTone = 'primary' | 'info' | 'success' | 'warning' | 'danger';\nexport type ProgressSize = 'sm' | 'md' | 'lg';\n\nexport type ProgressProps = {\n /**\n * Current progress value (`0..max`). Omit to render the indeterminate\n * marquee variant (use this when you don't know how long the work\n * will take, e.g. an initial load before headers come back).\n */\n value?: number;\n /** Upper bound for `value`. @defaultValue 100 */\n max?: number;\n /**\n * Color of the fill / shuttle. `primary` follows the theme's interactive\n * color (matches buttons + sliders); the rest map to semantic status colors.\n * @defaultValue 'primary'\n */\n tone?: ProgressTone;\n /**\n * Bar height — `sm` 4px, `md` 8px (default), `lg` 12px. The track is\n * always pill-shaped (border-radius = height/2).\n * @defaultValue 'md'\n */\n size?: ProgressSize;\n /**\n * Optional label rendered above the bar. When set, also enables a\n * percentage readout on the right side for determinate progress.\n */\n label?: string;\n /**\n * Hide the auto-rendered percentage when a `label` is provided. Useful\n * when the label itself already conveys the number (e.g. \"Step 3 of 5\").\n * @defaultValue false\n */\n hidePercentage?: boolean;\n /** Accessibility label when no visible `label` is provided. */\n 'aria-label'?: string;\n /** Reference to a labeling element by id. */\n 'aria-labelledby'?: string;\n className?: string;\n testID?: string;\n};\n\nconst SIZE_PX: Record<ProgressSize, number> = {\n sm: 4,\n md: 8,\n lg: 12,\n};\n\nconst INDETERMINATE_DURATION_MS = 1500;\nconst SHUTTLE_WIDTH_PCT = 30;\n\n/**\n * Linear progress indicator. Use the determinate form (`value` set) to\n * communicate \"we're 42% done\"; use the indeterminate form (`value`\n * omitted) for \"we're working, no ETA\". The track is always pill-shaped\n * and the fill animates smoothly between renders for the determinate\n * variant — keep updates throttled to ~10/s in the parent to avoid\n * jitter.\n *\n * Cross-platform: built on `View` + `Animated.View` so it renders\n * identically on web (rn-web) and native. Uses `useThemeColors()` to\n * pick up dark-mode flips automatically.\n *\n * Accessibility: maps to `role=\"progressbar\"` with `aria-valuemin`,\n * `aria-valuemax`, and (for determinate) `aria-valuenow`. Provide an\n * `aria-label`, `aria-labelledby`, or visible `label` so the bar is\n * named.\n */\nexport const Progress = ({\n value,\n max = 100,\n tone = 'primary',\n size = 'md',\n label,\n hidePercentage = false,\n className,\n testID,\n ...rest\n}: ProgressProps) => {\n const colors = useThemeColors();\n const ariaLabel = rest['aria-label'];\n const ariaLabelledBy = rest['aria-labelledby'];\n\n const isIndeterminate = value === undefined;\n const safeMax = max <= 0 ? 100 : max;\n const clamped = isIndeterminate ? 0 : Math.min(safeMax, Math.max(0, value));\n const pct = isIndeterminate ? 0 : (clamped / safeMax) * 100;\n\n const height = SIZE_PX[size];\n\n const fillColor =\n tone === 'primary'\n ? colors.semantic.interactive.primary\n : tone === 'success'\n ? colors.color.success\n : tone === 'warning'\n ? colors.color.warning\n : tone === 'danger'\n ? colors.color.danger\n : colors.color.info;\n\n // Indeterminate marquee — a 30%-wide shuttle that slides from -30% to\n // 100% on a continuous loop. Driven by `Animated.Value` (0..1) which we\n // interpolate to a percent string for `left`. ease-in-out keeps the\n // motion subtle so the bar never feels frantic.\n const shuttle = useRef(new Animated.Value(0)).current;\n useEffect(() => {\n if (!isIndeterminate) {\n return;\n }\n const loop = Animated.loop(\n Animated.timing(shuttle, {\n toValue: 1,\n duration: INDETERMINATE_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n // We animate `left` (a layout property), so the native driver\n // can't be used. Web (rn-web) ignores `useNativeDriver`.\n useNativeDriver: false,\n })\n );\n loop.start();\n return () => {\n loop.stop();\n };\n }, [isIndeterminate, shuttle]);\n\n const trackStyle: ViewStyle = {\n width: '100%',\n height,\n backgroundColor: colors.semantic.background.subtle,\n borderRadius: height / 2,\n overflow: 'hidden',\n position: 'relative',\n };\n\n const determinateFillStyle: ViewStyle = {\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0,\n // Cast at the boundary — RN's typed DimensionValue is narrower than\n // the percentage strings rn-web actually accepts.\n width: `${pct}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n\n // Build the indeterminate style only when needed — `Animated.Value.interpolate`\n // returns an animated node that RN reads at render; we keep the call inside\n // the branch so determinate renders never hit it (and so test envs that\n // stub `Animated.Value` don't choke on a missing `interpolate`).\n const buildIndeterminateStyle = () => {\n const left =\n typeof shuttle.interpolate === 'function'\n ? shuttle.interpolate({\n inputRange: [0, 1],\n outputRange: [`-${SHUTTLE_WIDTH_PCT}%`, '100%'],\n })\n : (`-${SHUTTLE_WIDTH_PCT}%` as unknown as number);\n return {\n position: 'absolute' as const,\n top: 0,\n bottom: 0,\n left: left as unknown as number,\n width: `${SHUTTLE_WIDTH_PCT}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n };\n\n // ARIA: only emit aria-valuenow when determinate so AT announces\n // \"in progress\" rather than \"0%\" while indeterminate.\n const ariaProps: Record<string, unknown> = {\n role: 'progressbar',\n accessibilityRole: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n };\n if (!isIndeterminate) {\n ariaProps['aria-valuenow'] = clamped;\n ariaProps.accessibilityValue = { min: 0, max: safeMax, now: clamped };\n }\n if (ariaLabel !== undefined) {\n ariaProps['aria-label'] = ariaLabel;\n ariaProps.accessibilityLabel = ariaLabel;\n } else if (label !== undefined) {\n ariaProps['aria-label'] = label;\n ariaProps.accessibilityLabel = label;\n }\n if (ariaLabelledBy !== undefined) {\n ariaProps['aria-labelledby'] = ariaLabelledBy;\n }\n\n const showHeader = label !== undefined;\n const showPercentage = showHeader && !hidePercentage && !isIndeterminate;\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('w-full', className)}\n style={{ width: '100%' }}\n >\n {showHeader ? (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: px(colors.spacing['2']) - 2, // closest to legacy 6\n }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {label}\n </RNText>\n {showPercentage ? (\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n // Tabular numerals keep the percentage from\n // jittering as digits change width.\n fontVariant: ['tabular-nums'],\n }}\n >\n {Math.round(pct)}%\n </RNText>\n ) : null}\n </View>\n ) : null}\n <View {...ariaProps} style={trackStyle}>\n {isIndeterminate ? (\n <Animated.View style={buildIndeterminateStyle()} />\n ) : (\n <View style={determinateFillStyle} />\n )}\n </View>\n </View>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/components/Progress/Progress.tsx"],"names":["RNText"],"mappings":";;;;;;;;AAmDA,IAAM,OAAA,GAAwC;AAAA,EAC1C,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI;AACR,CAAA;AAEA,IAAM,yBAAA,GAA4B,IAAA;AAClC,IAAM,iBAAA,GAAoB,EAAA;AAmBnB,IAAM,2BAAW,MAAA,CAAA,CAAC;AAAA,EACrB,KAAA;AAAA,EACA,GAAA,GAAM,GAAA;AAAA,EACN,IAAA,GAAO,SAAA;AAAA,EACP,IAAA,GAAO,IAAA;AAAA,EACP,KAAA;AAAA,EACA,cAAA,GAAiB,KAAA;AAAA,EACjB,SAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACP,CAAA,KAAqB;AACjB,EAAA,MAAM,SAAS,cAAA,EAAe;AAC9B,EAAA,MAAM,SAAA,GAAY,KAAK,YAAY,CAAA;AACnC,EAAA,MAAM,cAAA,GAAiB,KAAK,iBAAiB,CAAA;AAE7C,EAAA,MAAM,kBAAkB,KAAA,KAAU,MAAA;AAClC,EAAA,MAAM,OAAA,GAAU,GAAA,IAAO,CAAA,GAAI,GAAA,GAAM,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Q,GAAG,CAAC,CAAA,GAAI;AAAA;AAAA,aAC5C;AAAA,YAEA,QAAA,EAAA;AAAA,8BAAA,GAAA;AAAA,gBAACA,IAAA;AAAA,gBAAA;AAAA,kBACG,KAAA,EAAO;AAAA,oBACH,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,oBAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA;AAAA,oBAC/B,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK;AAAA,mBAChC;AAAA,kBAEC,QAAA,EAAA;AAAA;AAAA,eACL;AAAA,cACC,cAAA,mBACG,IAAA;AAAA,gBAACA,IAAA;AAAA,gBAAA;AAAA,kBACG,KAAA,EAAO;AAAA,oBACH,UAAA,EAAY,OAAO,UAAA,CAAW,IAAA;AAAA,oBAC9B,QAAA,EAAU,EAAA,CAAG,MAAA,CAAO,QAAA,CAAS,EAAE,CAAA;AAAA,oBAC/B,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,KAAA;AAAA;AAAA;AAAA,oBAG5B,WAAA,EAAa,CAAC,cAAc;AAAA,mBAChC;AAAA,kBAEC,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAK,MAAM,GAAG,CAAA;AAAA,oBAAE;AAAA;AAAA;AAAA,eACrB,GACA;AAAA;AAAA;AAAA,SACR,GACA,IAAA;AAAA,4BACH,IAAA,EAAA,EAAM,GAAG,WAAW,KAAA,EAAO,UAAA,EACvB,4CACG,GAAA,CAAC,QAAA,CAAS,MAAT,EAAc,KAAA,EAAO,yBAAwB,EAAG,CAAA,uBAEhD,IAAA,EAAA,EAAK,KAAA,EAAO,sBAAsB,CAAA,EAE3C;AAAA;AAAA;AAAA,GACJ;AAER,CAAA,EAjLwB,UAAA","file":"chunk-XP55RZ3D.js","sourcesContent":["'use client';\n\nimport { useEffect, useRef } from 'react';\nimport { Animated, Easing, Text as RNText, View, type ViewStyle } from 'react-native';\nimport { px } from '../../theme/px';\nimport { useThemeColors } from '../../theme/use-theme-colors';\nimport { cn } from '../../utils/cn';\n\nexport type ProgressTone = 'primary' | 'info' | 'success' | 'warning' | 'danger';\nexport type ProgressSize = 'sm' | 'md' | 'lg';\n\nexport type ProgressProps = {\n /**\n * Current progress value (`0..max`). Omit to render the indeterminate\n * marquee variant (use this when you don't know how long the work\n * will take, e.g. an initial load before headers come back).\n */\n value?: number;\n /** Upper bound for `value`. @defaultValue 100 */\n max?: number;\n /**\n * Color of the fill / shuttle. `primary` follows the theme's interactive\n * color (matches buttons + sliders); the rest map to semantic status colors.\n * @defaultValue 'primary'\n */\n tone?: ProgressTone;\n /**\n * Bar height — `sm` 4px, `md` 8px (default), `lg` 12px. The track is\n * always pill-shaped (border-radius = height/2).\n * @defaultValue 'md'\n */\n size?: ProgressSize;\n /**\n * Optional label rendered above the bar. When set, also enables a\n * percentage readout on the right side for determinate progress.\n */\n label?: string;\n /**\n * Hide the auto-rendered percentage when a `label` is provided. Useful\n * when the label itself already conveys the number (e.g. \"Step 3 of 5\").\n * @defaultValue false\n */\n hidePercentage?: boolean;\n /** Accessibility label when no visible `label` is provided. */\n 'aria-label'?: string;\n /** Reference to a labeling element by id. */\n 'aria-labelledby'?: string;\n className?: string;\n testID?: string;\n};\n\nconst SIZE_PX: Record<ProgressSize, number> = {\n sm: 4,\n md: 8,\n lg: 12,\n};\n\nconst INDETERMINATE_DURATION_MS = 1500;\nconst SHUTTLE_WIDTH_PCT = 30;\n\n/**\n * Linear progress indicator. Use the determinate form (`value` set) to\n * communicate \"we're 42% done\"; use the indeterminate form (`value`\n * omitted) for \"we're working, no ETA\". The track is always pill-shaped\n * and the fill animates smoothly between renders for the determinate\n * variant — keep updates throttled to ~10/s in the parent to avoid\n * jitter.\n *\n * Cross-platform: built on `View` + `Animated.View` so it renders\n * identically on web (rn-web) and native. Uses `useThemeColors()` to\n * pick up dark-mode flips automatically.\n *\n * Accessibility: maps to `role=\"progressbar\"` with `aria-valuemin`,\n * `aria-valuemax`, and (for determinate) `aria-valuenow`. Provide an\n * `aria-label`, `aria-labelledby`, or visible `label` so the bar is\n * named.\n */\nexport const Progress = ({\n value,\n max = 100,\n tone = 'primary',\n size = 'md',\n label,\n hidePercentage = false,\n className,\n testID,\n ...rest\n}: ProgressProps) => {\n const colors = useThemeColors();\n const ariaLabel = rest['aria-label'];\n const ariaLabelledBy = rest['aria-labelledby'];\n\n const isIndeterminate = value === undefined;\n const safeMax = max <= 0 ? 100 : max;\n const clamped = isIndeterminate ? 0 : Math.min(safeMax, Math.max(0, value));\n const pct = isIndeterminate ? 0 : (clamped / safeMax) * 100;\n\n const height = SIZE_PX[size];\n\n const fillColor =\n tone === 'primary'\n ? colors.semantic.interactive.primary\n : tone === 'success'\n ? colors.color.success\n : tone === 'warning'\n ? colors.color.warning\n : tone === 'danger'\n ? colors.color.danger\n : colors.color.info;\n\n // Indeterminate marquee — a 30%-wide shuttle that slides from -30% to\n // 100% on a continuous loop. Driven by `Animated.Value` (0..1) which we\n // interpolate to a percent string for `left`. ease-in-out keeps the\n // motion subtle so the bar never feels frantic.\n const shuttle = useRef(new Animated.Value(0)).current;\n useEffect(() => {\n if (!isIndeterminate) {\n return;\n }\n const loop = Animated.loop(\n Animated.timing(shuttle, {\n toValue: 1,\n duration: INDETERMINATE_DURATION_MS,\n easing: Easing.inOut(Easing.ease),\n // We animate `left` (a layout property), so the native driver\n // can't be used. Web (rn-web) ignores `useNativeDriver`.\n useNativeDriver: false,\n })\n );\n loop.start();\n return () => {\n loop.stop();\n };\n }, [isIndeterminate, shuttle]);\n\n const trackStyle: ViewStyle = {\n width: '100%',\n height,\n backgroundColor: colors.semantic.background.subtle,\n borderRadius: height / 2,\n overflow: 'hidden',\n position: 'relative',\n };\n\n const determinateFillStyle: ViewStyle = {\n position: 'absolute',\n left: 0,\n top: 0,\n bottom: 0,\n // Cast at the boundary — RN's typed DimensionValue is narrower than\n // the percentage strings rn-web actually accepts.\n width: `${pct}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n\n // Build the indeterminate style only when needed — `Animated.Value.interpolate`\n // returns an animated node that RN reads at render; we keep the call inside\n // the branch so determinate renders never hit it (and so test envs that\n // stub `Animated.Value` don't choke on a missing `interpolate`).\n const buildIndeterminateStyle = () => {\n const left =\n typeof shuttle.interpolate === 'function'\n ? shuttle.interpolate({\n inputRange: [0, 1],\n outputRange: [`-${SHUTTLE_WIDTH_PCT}%`, '100%'],\n })\n : (`-${SHUTTLE_WIDTH_PCT}%` as unknown as number);\n return {\n position: 'absolute' as const,\n top: 0,\n bottom: 0,\n left: left as unknown as number,\n width: `${SHUTTLE_WIDTH_PCT}%` as unknown as number,\n backgroundColor: fillColor,\n borderRadius: height / 2,\n };\n };\n\n // ARIA: only emit aria-valuenow when determinate so AT announces\n // \"in progress\" rather than \"0%\" while indeterminate.\n const ariaProps: Record<string, unknown> = {\n role: 'progressbar',\n accessibilityRole: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n };\n if (!isIndeterminate) {\n ariaProps['aria-valuenow'] = clamped;\n ariaProps.accessibilityValue = { min: 0, max: safeMax, now: clamped };\n }\n if (ariaLabel !== undefined) {\n ariaProps['aria-label'] = ariaLabel;\n ariaProps.accessibilityLabel = ariaLabel;\n } else if (label !== undefined) {\n ariaProps['aria-label'] = label;\n ariaProps.accessibilityLabel = label;\n }\n if (ariaLabelledBy !== undefined) {\n ariaProps['aria-labelledby'] = ariaLabelledBy;\n }\n\n const showHeader = label !== undefined;\n const showPercentage = showHeader && !hidePercentage && !isIndeterminate;\n\n return (\n <View\n {...(testID !== undefined ? { testID } : {})}\n className={cn('w-full', className)}\n style={{ width: '100%' }}\n >\n {showHeader ? (\n <View\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: px(colors.spacing['2']) - 2, // closest to legacy 6\n }}\n >\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n }}\n >\n {label}\n </RNText>\n {showPercentage ? (\n <RNText\n style={{\n fontFamily: colors.fontFamily.body,\n fontSize: px(colors.fontSize.sm),\n color: colors.semantic.text.muted,\n // Tabular numerals keep the percentage from\n // jittering as digits change width.\n fontVariant: ['tabular-nums'],\n }}\n >\n {Math.round(pct)}%\n </RNText>\n ) : null}\n </View>\n ) : null}\n <View {...ariaProps} style={trackStyle}>\n {isIndeterminate ? (\n <Animated.View style={buildIndeterminateStyle()} />\n ) : (\n <View style={determinateFillStyle} />\n )}\n </View>\n </View>\n );\n};\n"]}
@@ -1,8 +1,8 @@
1
1
  import { useAnimatedNumber } from './chunk-RB3YBWQ4.js';
2
2
  import { AnimatedView } from './chunk-RGJ3NBKE.js';
3
3
  import { defaultSemanticIcons } from './chunk-7Z4NMNX6.js';
4
- import { px } from './chunk-5A2QOOVN.js';
5
4
  import { cn } from './chunk-CHXHRJNZ.js';
5
+ import { px } from './chunk-5A2QOOVN.js';
6
6
  import { useThemeColors } from './chunk-R5JMDDCB.js';
7
7
  import { __name } from './chunk-WCQVDF3K.js';
8
8
  import { createContext, useId, useRef, useState, useCallback, useMemo, useEffect, useContext } from 'react';
@@ -446,5 +446,5 @@ var Accordion = Object.assign(AccordionRoot, {
446
446
  });
447
447
 
448
448
  export { Accordion };
449
- //# sourceMappingURL=chunk-CCUXO2HN.js.map
450
- //# sourceMappingURL=chunk-CCUXO2HN.js.map
449
+ //# sourceMappingURL=chunk-Y4ZRSW35.js.map
450
+ //# sourceMappingURL=chunk-Y4ZRSW35.js.map