minerva-design 1.0.0 → 1.0.2

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 (138) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/custom-elements.json +663 -0
  3. package/dist/angular/fesm2022/minerva-angular.mjs +1163 -34
  4. package/dist/angular/fesm2022/minerva-angular.mjs.map +1 -1
  5. package/dist/angular/types/minerva-angular.d.ts +237 -1
  6. package/dist/core/calendar-date.d.cts +5 -0
  7. package/dist/core/calendar-date.d.ts +5 -0
  8. package/dist/core/contracts.cjs +1 -1
  9. package/dist/core/contracts.cjs.map +1 -1
  10. package/dist/core/contracts.js +1 -1
  11. package/dist/core/contracts.js.map +1 -1
  12. package/dist/core/index.cjs +6 -6
  13. package/dist/core/index.cjs.map +1 -1
  14. package/dist/core/index.js +671 -630
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/styling-hooks/components/date-picker.d.cts +45 -0
  17. package/dist/core/styling-hooks/components/date-picker.d.ts +45 -0
  18. package/dist/core/styling-hooks/manifest.d.cts +44 -0
  19. package/dist/core/styling-hooks/manifest.d.ts +44 -0
  20. package/dist/core/styling-hooks.cjs +1 -1
  21. package/dist/core/styling-hooks.cjs.map +1 -1
  22. package/dist/core/styling-hooks.js +62 -0
  23. package/dist/core/styling-hooks.js.map +1 -1
  24. package/dist/native/components/Calendar/Calendar.cjs +1 -1
  25. package/dist/native/components/Calendar/Calendar.cjs.map +1 -1
  26. package/dist/native/components/Calendar/Calendar.d.cts +2 -0
  27. package/dist/native/components/Calendar/Calendar.d.ts +2 -0
  28. package/dist/native/components/Calendar/Calendar.js +115 -112
  29. package/dist/native/components/Calendar/Calendar.js.map +1 -1
  30. package/dist/native/components/Checkbox/Checkbox.cjs +1 -1
  31. package/dist/native/components/Checkbox/Checkbox.cjs.map +1 -1
  32. package/dist/native/components/Checkbox/Checkbox.js +8 -8
  33. package/dist/native/components/Checkbox/CheckboxGroup.cjs +1 -1
  34. package/dist/native/components/Checkbox/CheckboxGroup.cjs.map +1 -1
  35. package/dist/native/components/Checkbox/CheckboxGroup.js +6 -6
  36. package/dist/native/components/DatePicker/DatePicker.cjs +2 -0
  37. package/dist/native/components/DatePicker/DatePicker.cjs.map +1 -0
  38. package/dist/native/components/DatePicker/DatePicker.d.cts +40 -0
  39. package/dist/native/components/DatePicker/DatePicker.d.ts +40 -0
  40. package/dist/native/components/DatePicker/DatePicker.js +110 -0
  41. package/dist/native/components/DatePicker/DatePicker.js.map +1 -0
  42. package/dist/native/components/DatePicker/index.cjs +1 -0
  43. package/dist/native/components/DatePicker/index.d.cts +2 -0
  44. package/dist/native/components/DatePicker/index.d.ts +2 -0
  45. package/dist/native/components/DatePicker/index.js +2 -0
  46. package/dist/native/components/Radio/RadioGroup.cjs +1 -1
  47. package/dist/native/components/Radio/RadioGroup.cjs.map +1 -1
  48. package/dist/native/components/Radio/RadioGroup.js +9 -9
  49. package/dist/native/components/Switch/Switch.cjs +1 -1
  50. package/dist/native/components/Switch/Switch.cjs.map +1 -1
  51. package/dist/native/components/Switch/Switch.js +23 -23
  52. package/dist/native/components/Switch/Switch.js.map +1 -1
  53. package/dist/native/index.cjs +1 -1
  54. package/dist/native/index.d.cts +1 -0
  55. package/dist/native/index.d.ts +1 -0
  56. package/dist/native/index.js +70 -68
  57. package/dist/native/source/components/Calendar/Calendar.tsx +14 -6
  58. package/dist/native/source/components/DatePicker/DatePicker.tsx +201 -0
  59. package/dist/native/source/components/DatePicker/index.ts +2 -0
  60. package/dist/native/source/index.ts +1 -0
  61. package/dist/native/source/manifest.ts +6 -0
  62. package/dist/react/components/DatePicker/DatePicker.cjs +2 -0
  63. package/dist/react/components/DatePicker/DatePicker.cjs.map +1 -0
  64. package/dist/react/components/DatePicker/DatePicker.d.cts +13 -0
  65. package/dist/react/components/DatePicker/DatePicker.d.ts +13 -0
  66. package/dist/react/components/DatePicker/DatePicker.js +315 -0
  67. package/dist/react/components/DatePicker/DatePicker.js.map +1 -0
  68. package/dist/react/components/DatePicker/datePicker.module.scss.cjs +2 -0
  69. package/dist/react/components/DatePicker/datePicker.module.scss.cjs.map +1 -0
  70. package/dist/react/components/DatePicker/datePicker.module.scss.js +23 -0
  71. package/dist/react/components/DatePicker/datePicker.module.scss.js.map +1 -0
  72. package/dist/react/components/DatePicker/index.cjs +1 -0
  73. package/dist/react/components/DatePicker/index.d.cts +5 -0
  74. package/dist/react/components/DatePicker/index.d.ts +5 -0
  75. package/dist/react/components/DatePicker/index.js +3 -0
  76. package/dist/react/components/DatePicker/types.d.cts +97 -0
  77. package/dist/react/components/DatePicker/types.d.ts +97 -0
  78. package/dist/react/components/Tooltip/Tooltip.cjs +1 -1
  79. package/dist/react/components/Tooltip/Tooltip.cjs.map +1 -1
  80. package/dist/react/components/Tooltip/Tooltip.js +5 -5
  81. package/dist/react/components/Tooltip/Tooltip.js.map +1 -1
  82. package/dist/react/components/index.cjs +1 -1
  83. package/dist/react/components/index.d.cts +1 -0
  84. package/dist/react/components/index.d.ts +1 -0
  85. package/dist/react/components/index.js +3 -1
  86. package/dist/react/index.cjs +1 -1
  87. package/dist/react/index.js +7 -6
  88. package/dist/react/style.css +1 -0
  89. package/dist/react/styles/date-picker.css +7 -0
  90. package/dist/taro/date-picker.d.ts +20 -0
  91. package/dist/taro/index.d.ts +1 -0
  92. package/dist/taro/index.js +1155 -990
  93. package/dist/uni/DatePicker.vue +225 -0
  94. package/dist/uni/DatePicker.vue.d.ts +36 -0
  95. package/dist/uni/MonthCalendar.vue +2 -0
  96. package/dist/uni/MonthCalendar.vue.d.ts +2 -0
  97. package/dist/uni/index.d.ts +1 -0
  98. package/dist/uni/index.js +1 -0
  99. package/dist/uni/manifest.d.ts +7 -0
  100. package/dist/uni/manifest.js +8 -0
  101. package/dist/vue/components/DatePicker/DatePicker.vue.d.ts +36 -0
  102. package/dist/vue/components/DatePicker/DatePicker.vue.js +7 -0
  103. package/dist/vue/components/DatePicker/DatePicker.vue.js.map +1 -0
  104. package/dist/vue/components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +380 -0
  105. package/dist/vue/components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
  106. package/dist/vue/components/DatePicker/index.d.ts +2 -0
  107. package/dist/vue/components/DatePicker/index.js +2 -0
  108. package/dist/vue/components/DatePicker/types.d.ts +26 -0
  109. package/dist/vue/components/MonthCalendar/MonthCalendar.vue.d.ts +1 -1
  110. package/dist/vue/global.d.ts +108 -0
  111. package/dist/vue/groups/forms-pickers.d.ts +1 -0
  112. package/dist/vue/groups/forms-pickers.js +5 -2
  113. package/dist/vue/groups/forms-pickers.js.map +1 -1
  114. package/dist/vue/index.js +95 -94
  115. package/dist/weapp/controls.js +259 -76
  116. package/dist/weapp/date-picker/index.js +1 -0
  117. package/dist/weapp/date-picker/index.json +1 -0
  118. package/dist/weapp/date-picker/index.wxml +1 -0
  119. package/dist/weapp/date-picker/index.wxss +1 -0
  120. package/dist/weapp/types.d.ts +19 -0
  121. package/dist/web-components/cdn/minerva.js +461 -335
  122. package/dist/web-components/cdn/minerva.js.map +1 -1
  123. package/dist/web-components/components/date-picker/date-picker.d.ts +110 -0
  124. package/dist/web-components/components/date-picker/date-picker.js +378 -0
  125. package/dist/web-components/components/date-picker/date-picker.js.map +1 -0
  126. package/dist/web-components/elements/date-picker.d.ts +1 -0
  127. package/dist/web-components/elements/date-picker.js +8 -0
  128. package/dist/web-components/elements/date-picker.js.map +1 -0
  129. package/dist/web-components/html-custom-data.json +85 -0
  130. package/dist/web-components/index.d.ts +1 -0
  131. package/dist/web-components/index.js +8 -6
  132. package/dist/web-components/styles/DatePicker/datePicker.css.js +6 -0
  133. package/dist/web-components/styles/DatePicker/datePicker.css.js.map +1 -0
  134. package/dist/web-components/types/react.d.ts +12 -0
  135. package/dist/web-components/types/solid.d.ts +9 -0
  136. package/dist/web-components/types/svelte.d.ts +9 -0
  137. package/dist/web-components/types/vue.d.ts +10 -0
  138. package/package.json +9 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.cjs","names":["Platform","useFormControlProps","useTheme","useMachine","createSwitchMachine","useState","Animated","duration","Easing","colorRole","controlHeight","weight","Pressable","hitSlopFor","part","placementStyle","_Fragment","View","Text","shadowStyle","ActivityIndicator","ToggleLabel","bindFormControl","require_MinervaProvider","require_parts","require_styles","require_useMachine","require_FormControlContext","require_toggleControl","require_formControl","react","react_native","_minerva_core","react_jsx_runtime","nativeDriver","Switch","rest","props","t","inactive","disabled","loading","state","send","onChange","on","progress","trackWidth","setTrackWidth","ms","to","animation","role","color","height","size","thumb","hasTexts","onLabel","offLabel","baseWidth","width","travel","radius","shape","thumbRadius","textStyle","fonts","trackText","accessibilityState","hitSlop","labelPlacement","style","event","trackStyle","pressed","thumbStyle","labelStyle","label"],"sources":["../../../../../native/src/components/Switch/Switch.tsx"],"sourcesContent":["import { useFormControlProps } from \"../../internal/FormControlContext\";\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport {\n ActivityIndicator,\n Animated,\n Easing,\n Platform,\n Pressable,\n Text,\n View,\n type PressableProps,\n type StyleProp,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\nimport { createSwitchMachine } from \"@minerva/core\";\nimport { useTheme } from \"../../theme/MinervaProvider\";\nimport { bindFormControl } from \"../../internal/formControl\";\nimport { part } from \"../../internal/parts\";\nimport {\n colorRole,\n controlHeight,\n duration,\n hitSlopFor,\n shadowStyle,\n weight,\n type NativeSize,\n type SemanticColor,\n} from \"../../internal/styles\";\nimport {\n ToggleLabel,\n placementStyle,\n type LabelPlacement,\n} from \"../../internal/toggleControl\";\nimport { useMachine } from \"../../internal/useMachine\";\n\nexport type SwitchSize = NativeSize;\nexport type SwitchColor = SemanticColor;\nexport type SwitchShape = \"round\" | \"square\";\nexport type SwitchLabelPlacement = LabelPlacement;\n\nexport interface SwitchProps extends Omit<\n PressableProps,\n \"children\" | \"style\" | \"disabled\" | \"onPress\"\n> {\n /** Whether the switch is on (controlled) */\n checked?: boolean;\n /**\n * Initial state (uncontrolled)\n * @default false\n */\n defaultChecked?: boolean;\n /** Called with the requested state */\n onChange?: (checked: boolean) => void;\n /**\n * Disables the switch\n * @default false\n */\n disabled?: boolean;\n /**\n * Shows a spinner in the thumb and blocks interaction\n * (`accessibilityState.busy`)\n * @default false\n */\n loading?: boolean;\n /**\n * Switch size (track height from the control-height tokens)\n * @default \"medium\"\n */\n size?: SwitchSize;\n /**\n * Semantic color of the \"on\" track\n * @default \"primary\"\n */\n color?: SwitchColor;\n /**\n * Shape of the track and thumb\n * @default \"round\"\n */\n shape?: SwitchShape;\n /** Label displayed next to the switch (a string also names it) */\n label?: ReactNode;\n /**\n * Position of the label relative to the switch\n * @default \"end\"\n */\n labelPlacement?: SwitchLabelPlacement;\n /** Text shown inside the track while on (e.g. \"ON\") */\n onLabel?: ReactNode;\n /** Text shown inside the track while off (e.g. \"OFF\") */\n offLabel?: ReactNode;\n /** Value of the switch (reported by forms) */\n value?: string;\n /** Style of the pressable root */\n style?: StyleProp<ViewStyle>;\n /** Style of the track */\n trackStyle?: StyleProp<ViewStyle>;\n /** Style of the thumb */\n thumbStyle?: StyleProp<ViewStyle>;\n /** Style of the label text */\n labelStyle?: StyleProp<TextStyle>;\n}\n\nconst nativeDriver = Platform.OS !== \"web\";\n\n/**\n * An on / off switch on the switch machine of @minerva/core, drawn with\n * views (themed by the tokens, unlike RN's platform Switch): animated\n * thumb (token duration, instant with reduced motion), on / off texts in\n * the track, loading state, semantic colors, three sizes.\n */\nexport function Switch(props: SwitchProps) {\n const {\n checked,\n defaultChecked = false,\n onChange,\n disabled = false,\n loading = false,\n size = \"medium\",\n color = \"primary\",\n shape = \"round\",\n label,\n labelPlacement = \"end\",\n onLabel,\n offLabel,\n value,\n style,\n trackStyle,\n thumbStyle,\n labelStyle,\n accessibilityState,\n hitSlop,\n ...rest\n } = useFormControlProps(props);\n const { tokens: t, fonts } = useTheme();\n const inactive = disabled || loading;\n const [state, send] = useMachine(createSwitchMachine, {\n checked,\n defaultChecked,\n disabled: inactive,\n onCheckedChange: onChange,\n });\n const on = state.checked;\n const [progress] = useState(() => new Animated.Value(on ? 1 : 0));\n const [trackWidth, setTrackWidth] = useState<number | null>(null);\n const ms = duration(t, \"fast\");\n\n useEffect(() => {\n const to = on ? 1 : 0;\n if (ms <= 0) {\n progress.setValue(to);\n return;\n }\n const animation = Animated.timing(progress, {\n toValue: to,\n duration: ms,\n easing: Easing.out(Easing.quad),\n useNativeDriver: nativeDriver,\n });\n animation.start();\n return () => animation.stop();\n }, [on, ms, progress]);\n\n const role = colorRole(t, color);\n const height = Math.round(controlHeight(t, size) * 0.64);\n const pad = 2;\n const thumb = height - pad * 2;\n const hasTexts = onLabel !== undefined || offLabel !== undefined;\n const baseWidth = Math.round(height * 1.75);\n const width = Math.max(baseWidth, trackWidth ?? 0);\n const travel = width - thumb - pad * 2;\n const radius = shape === \"round\" ? height / 2 : t.radius.sm;\n const thumbRadius =\n shape === \"round\" ? thumb / 2 : Math.max(2, t.radius.sm - pad);\n const textStyle: TextStyle = {\n color: on ? role.onSolid : t.colors[\"text-secondary-color\"],\n fontSize: size === \"large\" ? t.fontSize.sm : t.fontSize.xs,\n fontWeight: weight(t, \"medium\"),\n ...(fonts.sans ? { fontFamily: fonts.sans } : null),\n };\n const trackText = on ? onLabel : offLabel;\n\n return (\n <Pressable\n accessibilityRole=\"switch\"\n accessibilityState={{\n ...accessibilityState,\n checked: on,\n disabled: inactive,\n busy: loading,\n }}\n aria-checked={on}\n aria-disabled={inactive}\n aria-busy={loading}\n disabled={inactive}\n onPress={() => send({ type: \"TOGGLE\" })}\n hitSlop={hitSlop ?? hitSlopFor(t, height, width)}\n {...part(\"switch\", \"root\", {\n checked: on,\n disabled,\n loading,\n size,\n color,\n shape,\n value,\n })}\n {...rest}\n style={[\n placementStyle(labelPlacement),\n { gap: t.space[\"2-5\"], opacity: disabled ? 0.5 : 1 },\n style,\n ]}\n >\n {({ pressed }) => (\n <>\n <View\n onLayout={\n hasTexts\n ? (event) => setTrackWidth(event.nativeEvent.layout.width)\n : undefined\n }\n style={[\n {\n minWidth: baseWidth,\n height,\n borderRadius: radius,\n backgroundColor: t.colors[\"border-strong-color\"],\n overflow: \"hidden\",\n justifyContent: \"center\",\n paddingLeft: on ? t.space[\"2\"] : thumb + pad + t.space[\"1\"],\n paddingRight: on ? thumb + pad + t.space[\"1\"] : t.space[\"2\"],\n },\n trackStyle,\n ]}\n {...part(\"switch\", \"track\", { checked: on })}\n >\n <Animated.View\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: pressed ? role.pressed : role.solid,\n opacity: progress,\n }}\n {...part(\"switch\", \"fill\")}\n />\n {hasTexts ? (\n <View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n accessibilityElementsHidden\n {...part(\"switch\", \"track-label\")}\n >\n {typeof trackText === \"string\" ||\n typeof trackText === \"number\" ? (\n <Text numberOfLines={1} style={textStyle}>\n {trackText}\n </Text>\n ) : (\n trackText\n )}\n </View>\n ) : null}\n <Animated.View\n style={[\n {\n position: \"absolute\",\n top: pad,\n left: pad,\n width: thumb,\n height: thumb,\n borderRadius: thumbRadius,\n backgroundColor: t.colors[\"surface-elevated-color\"],\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: [\n {\n translateX: progress.interpolate({\n inputRange: [0, 1],\n outputRange: [0, travel],\n }),\n },\n ],\n ...shadowStyle(t.shadows.sm),\n },\n thumbStyle,\n ]}\n {...part(\"switch\", \"thumb\")}\n >\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={on ? role.solid : t.colors[\"text-muted-color\"]}\n style={{ transform: [{ scale: thumb / 24 }] }}\n {...part(\"switch\", \"spinner\")}\n />\n ) : null}\n </Animated.View>\n </View>\n <ToggleLabel\n t={t}\n component=\"switch\"\n size={size}\n disabled={disabled}\n fontFamily={fonts.sans}\n style={labelStyle}\n >\n {label}\n </ToggleLabel>\n </>\n )}\n </Pressable>\n );\n}\n\nbindFormControl(Switch, {\n valuePropName: \"checked\",\n emptyValue: false,\n commitOnChange: true,\n invalidPropName: null,\n requiredKey: \"validation.checkMissing\",\n});\n"],"mappings":"6aAuGA,IAAMkC,EAAelC,EAAAA,SAAS,KAAO,MAQrC,SAAgBmC,EAAO,EAAoB,CACzC,GAAM,CACJ,UACA,iBAAiB,GACjB,WACA,WAAW,GACX,UAAU,GACV,OAAO,SACP,QAAQ,UACR,QAAQ,QACR,QACA,iBAAiB,MACjB,UACA,WACA,QACA,QACA,aACA,aACA,aACA,qBACA,UACA,GAAGC,GACDnC,EAAAA,oBAAoBoC,CAAK,EACvB,CAAE,OAAQC,EAAG,SAAUpC,EAAAA,SAAS,EAChCqC,EAAWC,GAAYC,EACvB,CAACC,EAAOC,GAAQxC,EAAAA,WAAWC,EAAAA,oBAAqB,CACpD,UACA,iBACA,SAAUmC,EACV,gBAAiBK,CACnB,CAAC,EACKC,EAAKH,EAAM,QACX,CAACI,IAAA,EAAYzC,EAAAA,SAAAA,KAAe,IAAIC,EAAAA,SAAS,MAAM,IAAU,CAAC,EAC1D,CAACyC,EAAYC,IAAA,EAAiB3C,EAAAA,SAAAA,CAAwB,IAAI,EAC1D4C,EAAK1C,EAAAA,SAAS+B,EAAG,MAAM,GAE7B,EAAAR,EAAA,UAAA,KAAgB,CACd,IAAMoB,EAAK,KACX,GAAID,GAAM,EAAG,CACXH,EAAS,SAASI,CAAE,EACpB,MACF,CACA,IAAMC,EAAY7C,EAAAA,SAAS,OAAOwC,EAAU,CAC1C,QAASI,EACT,SAAUD,EACV,OAAQzC,EAAAA,OAAO,IAAIA,EAAAA,OAAO,IAAI,EAC9B,gBAAiB0B,CACnB,CAAC,EAED,OADAiB,EAAU,MAAM,MACHA,EAAU,KAAK,CAC9B,EAAG,CAACN,EAAII,EAAIH,CAAQ,CAAC,EAErB,IAAMM,EAAO3C,EAAAA,UAAU6B,EAAGe,CAAK,EACzBC,EAAS,KAAK,MAAM5C,EAAAA,cAAc4B,EAAGiB,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gB,CAAM,CACzB,CAAC,CACH,CACF,EACA,GAAG3C,EAAAA,YAAYmB,EAAE,QAAQ,EAAE,CAC7B,EACAsC,CACF,EACA,GAAI9D,EAAAA,KAAK,SAAU,OAAO,EAEzB,SAAA2B,GACC,EAAAR,EAAA,IAAA,CAACb,EAAAA,kBAAD,CACE,KAAK,QACL,MAAOyB,EAAKO,EAAK,MAAQd,EAAE,OAAO,oBAClC,MAAO,CAAE,UAAW,CAAC,CAAE,MAAOkB,EAAQ,EAAG,CAAC,CAAE,EAC5C,GAAI1C,EAAAA,KAAK,SAAU,SAAS,CAC7B,CAAA,EACC,IACS,CAAA,CACX,CACN,CAAA,GAAA,EAAAmB,EAAA,IAAA,CAACZ,EAAAA,YAAD,CACK,IACH,UAAU,SACJ,OACI,WACV,WAAY8C,EAAM,KAClB,MAAOU,EAEN,SAAAC,CACU,CAAA,CACb,CAAA,CAAA,CAEK,CAAA,CAEf,CAEAxD,EAAAA,gBAAgBa,EAAQ,CACtB,cAAe,UACf,WAAY,GACZ,eAAgB,GAChB,gBAAiB,KACjB,YAAa,yBACf,CAAC"}
1
+ {"version":3,"file":"Switch.cjs","names":["Platform","useFormControlProps","useTheme","useMachine","createSwitchMachine","useState","Animated","duration","Easing","colorRole","controlHeight","weight","Pressable","hitSlopFor","part","placementStyle","_Fragment","View","Text","shadowStyle","ActivityIndicator","ToggleLabel","bindFormControl","require_MinervaProvider","require_parts","require_styles","require_useMachine","require_FormControlContext","require_formControl","require_toggleControl","react","react_native","_minerva_core","react_jsx_runtime","nativeDriver","Switch","rest","props","t","inactive","disabled","loading","state","send","onChange","on","progress","trackWidth","setTrackWidth","ms","to","animation","role","color","height","size","thumb","hasTexts","onLabel","offLabel","baseWidth","width","travel","radius","shape","thumbRadius","textStyle","fonts","trackText","accessibilityState","hitSlop","labelPlacement","style","event","trackStyle","pressed","thumbStyle","labelStyle","label"],"sources":["../../../../../native/src/components/Switch/Switch.tsx"],"sourcesContent":["import { useFormControlProps } from \"../../internal/FormControlContext\";\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport {\n ActivityIndicator,\n Animated,\n Easing,\n Platform,\n Pressable,\n Text,\n View,\n type PressableProps,\n type StyleProp,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\nimport { createSwitchMachine } from \"@minerva/core\";\nimport { useTheme } from \"../../theme/MinervaProvider\";\nimport { bindFormControl } from \"../../internal/formControl\";\nimport { part } from \"../../internal/parts\";\nimport {\n colorRole,\n controlHeight,\n duration,\n hitSlopFor,\n shadowStyle,\n weight,\n type NativeSize,\n type SemanticColor,\n} from \"../../internal/styles\";\nimport {\n ToggleLabel,\n placementStyle,\n type LabelPlacement,\n} from \"../../internal/toggleControl\";\nimport { useMachine } from \"../../internal/useMachine\";\n\nexport type SwitchSize = NativeSize;\nexport type SwitchColor = SemanticColor;\nexport type SwitchShape = \"round\" | \"square\";\nexport type SwitchLabelPlacement = LabelPlacement;\n\nexport interface SwitchProps extends Omit<\n PressableProps,\n \"children\" | \"style\" | \"disabled\" | \"onPress\"\n> {\n /** Whether the switch is on (controlled) */\n checked?: boolean;\n /**\n * Initial state (uncontrolled)\n * @default false\n */\n defaultChecked?: boolean;\n /** Called with the requested state */\n onChange?: (checked: boolean) => void;\n /**\n * Disables the switch\n * @default false\n */\n disabled?: boolean;\n /**\n * Shows a spinner in the thumb and blocks interaction\n * (`accessibilityState.busy`)\n * @default false\n */\n loading?: boolean;\n /**\n * Switch size (track height from the control-height tokens)\n * @default \"medium\"\n */\n size?: SwitchSize;\n /**\n * Semantic color of the \"on\" track\n * @default \"primary\"\n */\n color?: SwitchColor;\n /**\n * Shape of the track and thumb\n * @default \"round\"\n */\n shape?: SwitchShape;\n /** Label displayed next to the switch (a string also names it) */\n label?: ReactNode;\n /**\n * Position of the label relative to the switch\n * @default \"end\"\n */\n labelPlacement?: SwitchLabelPlacement;\n /** Text shown inside the track while on (e.g. \"ON\") */\n onLabel?: ReactNode;\n /** Text shown inside the track while off (e.g. \"OFF\") */\n offLabel?: ReactNode;\n /** Value of the switch (reported by forms) */\n value?: string;\n /** Style of the pressable root */\n style?: StyleProp<ViewStyle>;\n /** Style of the track */\n trackStyle?: StyleProp<ViewStyle>;\n /** Style of the thumb */\n thumbStyle?: StyleProp<ViewStyle>;\n /** Style of the label text */\n labelStyle?: StyleProp<TextStyle>;\n}\n\nconst nativeDriver = Platform.OS !== \"web\";\n\n/**\n * An on / off switch on the switch machine of @minerva/core, drawn with\n * views (themed by the tokens, unlike RN's platform Switch): animated\n * thumb (token duration, instant with reduced motion), on / off texts in\n * the track, loading state, semantic colors, three sizes.\n */\nexport function Switch(props: SwitchProps) {\n const {\n checked,\n defaultChecked = false,\n onChange,\n disabled = false,\n loading = false,\n size = \"medium\",\n color = \"primary\",\n shape = \"round\",\n label,\n labelPlacement = \"end\",\n onLabel,\n offLabel,\n value,\n style,\n trackStyle,\n thumbStyle,\n labelStyle,\n accessibilityState,\n hitSlop,\n ...rest\n } = useFormControlProps(props);\n const { tokens: t, fonts } = useTheme();\n const inactive = disabled || loading;\n const [state, send] = useMachine(createSwitchMachine, {\n checked,\n defaultChecked,\n disabled: inactive,\n onCheckedChange: onChange,\n });\n const on = state.checked;\n const [progress] = useState(() => new Animated.Value(on ? 1 : 0));\n const [trackWidth, setTrackWidth] = useState<number | null>(null);\n const ms = duration(t, \"fast\");\n\n useEffect(() => {\n const to = on ? 1 : 0;\n if (ms <= 0) {\n progress.setValue(to);\n return;\n }\n const animation = Animated.timing(progress, {\n toValue: to,\n duration: ms,\n easing: Easing.out(Easing.quad),\n useNativeDriver: nativeDriver,\n });\n animation.start();\n return () => animation.stop();\n }, [on, ms, progress]);\n\n const role = colorRole(t, color);\n const height = Math.round(controlHeight(t, size) * 0.64);\n const pad = 2;\n const thumb = height - pad * 2;\n const hasTexts = onLabel !== undefined || offLabel !== undefined;\n const baseWidth = Math.round(height * 1.75);\n const width = Math.max(baseWidth, trackWidth ?? 0);\n const travel = width - thumb - pad * 2;\n const radius = shape === \"round\" ? height / 2 : t.radius.sm;\n const thumbRadius =\n shape === \"round\" ? thumb / 2 : Math.max(2, t.radius.sm - pad);\n const textStyle: TextStyle = {\n color: on ? role.onSolid : t.colors[\"text-secondary-color\"],\n fontSize: size === \"large\" ? t.fontSize.sm : t.fontSize.xs,\n fontWeight: weight(t, \"medium\"),\n ...(fonts.sans ? { fontFamily: fonts.sans } : null),\n };\n const trackText = on ? onLabel : offLabel;\n\n return (\n <Pressable\n accessibilityRole=\"switch\"\n accessibilityState={{\n ...accessibilityState,\n checked: on,\n disabled: inactive,\n busy: loading,\n }}\n aria-checked={on}\n aria-disabled={inactive}\n aria-busy={loading}\n disabled={inactive}\n onPress={() => send({ type: \"TOGGLE\" })}\n hitSlop={hitSlop ?? hitSlopFor(t, height, width)}\n {...part(\"switch\", \"root\", {\n checked: on,\n disabled,\n loading,\n size,\n color,\n shape,\n value,\n })}\n {...rest}\n style={[\n placementStyle(labelPlacement),\n { gap: t.space[\"2-5\"], opacity: disabled ? 0.5 : 1 },\n style,\n ]}\n >\n {({ pressed }) => (\n <>\n <View\n onLayout={\n hasTexts\n ? (event) => setTrackWidth(event.nativeEvent.layout.width)\n : undefined\n }\n style={[\n {\n minWidth: baseWidth,\n height,\n borderRadius: radius,\n backgroundColor: t.colors[\"border-strong-color\"],\n overflow: \"hidden\",\n justifyContent: \"center\",\n paddingLeft: on ? t.space[\"2\"] : thumb + pad + t.space[\"1\"],\n paddingRight: on ? thumb + pad + t.space[\"1\"] : t.space[\"2\"],\n },\n trackStyle,\n ]}\n {...part(\"switch\", \"track\", { checked: on })}\n >\n <Animated.View\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: pressed ? role.pressed : role.solid,\n opacity: progress,\n }}\n {...part(\"switch\", \"fill\")}\n />\n {hasTexts ? (\n <View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n accessibilityElementsHidden\n {...part(\"switch\", \"track-label\")}\n >\n {typeof trackText === \"string\" ||\n typeof trackText === \"number\" ? (\n <Text numberOfLines={1} style={textStyle}>\n {trackText}\n </Text>\n ) : (\n trackText\n )}\n </View>\n ) : null}\n <Animated.View\n style={[\n {\n position: \"absolute\",\n top: pad,\n left: pad,\n width: thumb,\n height: thumb,\n borderRadius: thumbRadius,\n backgroundColor: t.colors[\"surface-elevated-color\"],\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: [\n {\n translateX: progress.interpolate({\n inputRange: [0, 1],\n outputRange: [0, travel],\n }),\n },\n ],\n ...shadowStyle(t.shadows.sm),\n },\n thumbStyle,\n ]}\n {...part(\"switch\", \"thumb\")}\n >\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={on ? role.solid : t.colors[\"text-muted-color\"]}\n style={{ transform: [{ scale: thumb / 24 }] }}\n {...part(\"switch\", \"spinner\")}\n />\n ) : null}\n </Animated.View>\n </View>\n <ToggleLabel\n t={t}\n component=\"switch\"\n size={size}\n disabled={disabled}\n fontFamily={fonts.sans}\n style={labelStyle}\n >\n {label}\n </ToggleLabel>\n </>\n )}\n </Pressable>\n );\n}\n\nbindFormControl(Switch, {\n valuePropName: \"checked\",\n emptyValue: false,\n commitOnChange: true,\n invalidPropName: null,\n requiredKey: \"validation.checkMissing\",\n});\n"],"mappings":"6aAuGA,IAAMkC,EAAelC,EAAAA,SAAS,KAAO,MAQrC,SAAgBmC,EAAO,EAAoB,CACzC,GAAM,CACJ,UACA,iBAAiB,GACjB,WACA,WAAW,GACX,UAAU,GACV,OAAO,SACP,QAAQ,UACR,QAAQ,QACR,QACA,iBAAiB,MACjB,UACA,WACA,QACA,QACA,aACA,aACA,aACA,qBACA,UACA,GAAGC,GACDnC,EAAAA,oBAAoBoC,CAAK,EACvB,CAAE,OAAQC,EAAG,SAAUpC,EAAAA,SAAS,EAChCqC,EAAWC,GAAYC,EACvB,CAACC,EAAOC,GAAQxC,EAAAA,WAAWC,EAAAA,oBAAqB,CACpD,UACA,iBACA,SAAUmC,EACV,gBAAiBK,CACnB,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A,CAEK,CAAA,CAEf,CAEAxD,EAAAA,gBAAgBa,EAAQ,CACtB,cAAe,UACf,WAAY,GACZ,eAAgB,GAChB,gBAAiB,KACjB,YAAa,yBACf,CAAC"}
@@ -3,31 +3,31 @@ import { part as t } from "../../internal/parts.js";
3
3
  import { colorRole as ee, controlHeight as n, duration as te, hitSlopFor as ne, shadowStyle as re, weight as ie } from "../../internal/styles.js";
4
4
  import { useMachine as r } from "../../internal/useMachine.js";
5
5
  import { useFormControlProps as i } from "../../internal/FormControlContext.js";
6
- import { ToggleLabel as a, placementStyle as o } from "../../internal/toggleControl.js";
7
- import { bindFormControl as s } from "../../internal/formControl.js";
8
- import { useEffect as c, useState as l } from "react";
9
- import { ActivityIndicator as ae, Animated as u, Easing as d, Platform as f, Pressable as oe, Text as p, View as m } from "react-native";
10
- import { createSwitchMachine as se } from "../../../core/index.js";
6
+ import { bindFormControl as a } from "../../internal/formControl.js";
7
+ import { ToggleLabel as o, placementStyle as ae } from "../../internal/toggleControl.js";
8
+ import { useEffect as s, useState as c } from "react";
9
+ import { ActivityIndicator as oe, Animated as l, Easing as u, Platform as d, Pressable as se, Text as f, View as p } from "react-native";
10
+ import { createSwitchMachine as m } from "../../../core/index.js";
11
11
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
12
12
  //#region src/components/Switch/Switch.tsx
13
- var v = f.OS !== "web";
14
- function y(s) {
15
- let { checked: f, defaultChecked: y = !1, onChange: ce, disabled: b = !1, loading: x = !1, size: S = "medium", color: C = "primary", shape: w = "round", label: T, labelPlacement: E = "end", onLabel: D, offLabel: O, value: k, style: A, trackStyle: j, thumbStyle: M, labelStyle: N, accessibilityState: P, hitSlop: F, ...I } = i(s), { tokens: L, fonts: R } = e(), z = b || x, [B, V] = r(se, {
16
- checked: f,
13
+ var v = d.OS !== "web";
14
+ function y(a) {
15
+ let { checked: d, defaultChecked: y = !1, onChange: ce, disabled: b = !1, loading: x = !1, size: S = "medium", color: C = "primary", shape: w = "round", label: T, labelPlacement: E = "end", onLabel: D, offLabel: O, value: k, style: A, trackStyle: j, thumbStyle: M, labelStyle: N, accessibilityState: P, hitSlop: F, ...I } = i(a), { tokens: L, fonts: R } = e(), z = b || x, [B, V] = r(m, {
16
+ checked: d,
17
17
  defaultChecked: y,
18
18
  disabled: z,
19
19
  onCheckedChange: ce
20
- }), H = B.checked, [U] = l(() => new u.Value(+!!H)), [W, G] = l(null), K = te(L, "fast");
21
- c(() => {
20
+ }), H = B.checked, [U] = c(() => new l.Value(+!!H)), [W, G] = c(null), K = te(L, "fast");
21
+ s(() => {
22
22
  let e = +!!H;
23
23
  if (K <= 0) {
24
24
  U.setValue(e);
25
25
  return;
26
26
  }
27
- let t = u.timing(U, {
27
+ let t = l.timing(U, {
28
28
  toValue: e,
29
29
  duration: K,
30
- easing: d.out(d.quad),
30
+ easing: u.out(u.quad),
31
31
  useNativeDriver: v
32
32
  });
33
33
  return t.start(), () => t.stop();
@@ -42,7 +42,7 @@ function y(s) {
42
42
  fontWeight: ie(L, "medium"),
43
43
  ...R.sans ? { fontFamily: R.sans } : null
44
44
  }, $ = H ? D : O;
45
- return /* @__PURE__ */ g(oe, {
45
+ return /* @__PURE__ */ g(se, {
46
46
  accessibilityRole: "switch",
47
47
  accessibilityState: {
48
48
  ...P,
@@ -67,14 +67,14 @@ function y(s) {
67
67
  }),
68
68
  ...I,
69
69
  style: [
70
- o(E),
70
+ ae(E),
71
71
  {
72
72
  gap: L.space["2-5"],
73
73
  opacity: b ? .5 : 1
74
74
  },
75
75
  A
76
76
  ],
77
- children: ({ pressed: e }) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(m, {
77
+ children: ({ pressed: e }) => /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(p, {
78
78
  onLayout: X ? (e) => G(e.nativeEvent.layout.width) : void 0,
79
79
  style: [{
80
80
  minWidth: Z,
@@ -88,7 +88,7 @@ function y(s) {
88
88
  }, j],
89
89
  ...t("switch", "track", { checked: H }),
90
90
  children: [
91
- /* @__PURE__ */ g(u.View, {
91
+ /* @__PURE__ */ g(l.View, {
92
92
  style: {
93
93
  position: "absolute",
94
94
  top: 0,
@@ -100,18 +100,18 @@ function y(s) {
100
100
  },
101
101
  ...t("switch", "fill")
102
102
  }),
103
- X ? /* @__PURE__ */ g(m, {
103
+ X ? /* @__PURE__ */ g(p, {
104
104
  accessible: !1,
105
105
  importantForAccessibility: "no-hide-descendants",
106
106
  accessibilityElementsHidden: !0,
107
107
  ...t("switch", "track-label"),
108
- children: typeof $ == "string" || typeof $ == "number" ? /* @__PURE__ */ g(p, {
108
+ children: typeof $ == "string" || typeof $ == "number" ? /* @__PURE__ */ g(f, {
109
109
  numberOfLines: 1,
110
110
  style: fe,
111
111
  children: $
112
112
  }) : $
113
113
  }) : null,
114
- /* @__PURE__ */ g(u.View, {
114
+ /* @__PURE__ */ g(l.View, {
115
115
  style: [{
116
116
  position: "absolute",
117
117
  top: 2,
@@ -129,7 +129,7 @@ function y(s) {
129
129
  ...re(L.shadows.sm)
130
130
  }, M],
131
131
  ...t("switch", "thumb"),
132
- children: x ? /* @__PURE__ */ g(ae, {
132
+ children: x ? /* @__PURE__ */ g(oe, {
133
133
  size: "small",
134
134
  color: H ? q.solid : L.colors["text-muted-color"],
135
135
  style: { transform: [{ scale: Y / 24 }] },
@@ -137,7 +137,7 @@ function y(s) {
137
137
  }) : null
138
138
  })
139
139
  ]
140
- }), /* @__PURE__ */ g(a, {
140
+ }), /* @__PURE__ */ g(o, {
141
141
  t: L,
142
142
  component: "switch",
143
143
  size: S,
@@ -148,7 +148,7 @@ function y(s) {
148
148
  })] })
149
149
  });
150
150
  }
151
- s(y, {
151
+ a(y, {
152
152
  valuePropName: "checked",
153
153
  emptyValue: !1,
154
154
  commitOnChange: !0,
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","names":["_Fragment","Fragment$1","nativeDriver","Platform","Switch","rest","useFormControlProps","props","t","useTheme","inactive","disabled","loading","state","send","useMachine","createSwitchMachine","onChange","on","progress","useState","Animated","trackWidth","setTrackWidth","ms","duration","to","animation","Easing","role","colorRole","color","height","controlHeight","size","thumb","hasTexts","onLabel","offLabel","baseWidth","width","travel","radius","shape","thumbRadius","textStyle","weight","fonts","trackText","Pressable","accessibilityState","hitSlop","hitSlopFor","part","placementStyle","labelPlacement","style","View","event","trackStyle","pressed","Text","shadowStyle","thumbStyle","ActivityIndicator","ToggleLabel","labelStyle","label","bindFormControl"],"sources":["../../../../../native/src/components/Switch/Switch.tsx"],"sourcesContent":["import { useFormControlProps } from \"../../internal/FormControlContext\";\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport {\n ActivityIndicator,\n Animated,\n Easing,\n Platform,\n Pressable,\n Text,\n View,\n type PressableProps,\n type StyleProp,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\nimport { createSwitchMachine } from \"@minerva/core\";\nimport { useTheme } from \"../../theme/MinervaProvider\";\nimport { bindFormControl } from \"../../internal/formControl\";\nimport { part } from \"../../internal/parts\";\nimport {\n colorRole,\n controlHeight,\n duration,\n hitSlopFor,\n shadowStyle,\n weight,\n type NativeSize,\n type SemanticColor,\n} from \"../../internal/styles\";\nimport {\n ToggleLabel,\n placementStyle,\n type LabelPlacement,\n} from \"../../internal/toggleControl\";\nimport { useMachine } from \"../../internal/useMachine\";\n\nexport type SwitchSize = NativeSize;\nexport type SwitchColor = SemanticColor;\nexport type SwitchShape = \"round\" | \"square\";\nexport type SwitchLabelPlacement = LabelPlacement;\n\nexport interface SwitchProps extends Omit<\n PressableProps,\n \"children\" | \"style\" | \"disabled\" | \"onPress\"\n> {\n /** Whether the switch is on (controlled) */\n checked?: boolean;\n /**\n * Initial state (uncontrolled)\n * @default false\n */\n defaultChecked?: boolean;\n /** Called with the requested state */\n onChange?: (checked: boolean) => void;\n /**\n * Disables the switch\n * @default false\n */\n disabled?: boolean;\n /**\n * Shows a spinner in the thumb and blocks interaction\n * (`accessibilityState.busy`)\n * @default false\n */\n loading?: boolean;\n /**\n * Switch size (track height from the control-height tokens)\n * @default \"medium\"\n */\n size?: SwitchSize;\n /**\n * Semantic color of the \"on\" track\n * @default \"primary\"\n */\n color?: SwitchColor;\n /**\n * Shape of the track and thumb\n * @default \"round\"\n */\n shape?: SwitchShape;\n /** Label displayed next to the switch (a string also names it) */\n label?: ReactNode;\n /**\n * Position of the label relative to the switch\n * @default \"end\"\n */\n labelPlacement?: SwitchLabelPlacement;\n /** Text shown inside the track while on (e.g. \"ON\") */\n onLabel?: ReactNode;\n /** Text shown inside the track while off (e.g. \"OFF\") */\n offLabel?: ReactNode;\n /** Value of the switch (reported by forms) */\n value?: string;\n /** Style of the pressable root */\n style?: StyleProp<ViewStyle>;\n /** Style of the track */\n trackStyle?: StyleProp<ViewStyle>;\n /** Style of the thumb */\n thumbStyle?: StyleProp<ViewStyle>;\n /** Style of the label text */\n labelStyle?: StyleProp<TextStyle>;\n}\n\nconst nativeDriver = Platform.OS !== \"web\";\n\n/**\n * An on / off switch on the switch machine of @minerva/core, drawn with\n * views (themed by the tokens, unlike RN's platform Switch): animated\n * thumb (token duration, instant with reduced motion), on / off texts in\n * the track, loading state, semantic colors, three sizes.\n */\nexport function Switch(props: SwitchProps) {\n const {\n checked,\n defaultChecked = false,\n onChange,\n disabled = false,\n loading = false,\n size = \"medium\",\n color = \"primary\",\n shape = \"round\",\n label,\n labelPlacement = \"end\",\n onLabel,\n offLabel,\n value,\n style,\n trackStyle,\n thumbStyle,\n labelStyle,\n accessibilityState,\n hitSlop,\n ...rest\n } = useFormControlProps(props);\n const { tokens: t, fonts } = useTheme();\n const inactive = disabled || loading;\n const [state, send] = useMachine(createSwitchMachine, {\n checked,\n defaultChecked,\n disabled: inactive,\n onCheckedChange: onChange,\n });\n const on = state.checked;\n const [progress] = useState(() => new Animated.Value(on ? 1 : 0));\n const [trackWidth, setTrackWidth] = useState<number | null>(null);\n const ms = duration(t, \"fast\");\n\n useEffect(() => {\n const to = on ? 1 : 0;\n if (ms <= 0) {\n progress.setValue(to);\n return;\n }\n const animation = Animated.timing(progress, {\n toValue: to,\n duration: ms,\n easing: Easing.out(Easing.quad),\n useNativeDriver: nativeDriver,\n });\n animation.start();\n return () => animation.stop();\n }, [on, ms, progress]);\n\n const role = colorRole(t, color);\n const height = Math.round(controlHeight(t, size) * 0.64);\n const pad = 2;\n const thumb = height - pad * 2;\n const hasTexts = onLabel !== undefined || offLabel !== undefined;\n const baseWidth = Math.round(height * 1.75);\n const width = Math.max(baseWidth, trackWidth ?? 0);\n const travel = width - thumb - pad * 2;\n const radius = shape === \"round\" ? height / 2 : t.radius.sm;\n const thumbRadius =\n shape === \"round\" ? thumb / 2 : Math.max(2, t.radius.sm - pad);\n const textStyle: TextStyle = {\n color: on ? role.onSolid : t.colors[\"text-secondary-color\"],\n fontSize: size === \"large\" ? t.fontSize.sm : t.fontSize.xs,\n fontWeight: weight(t, \"medium\"),\n ...(fonts.sans ? { fontFamily: fonts.sans } : null),\n };\n const trackText = on ? onLabel : offLabel;\n\n return (\n <Pressable\n accessibilityRole=\"switch\"\n accessibilityState={{\n ...accessibilityState,\n checked: on,\n disabled: inactive,\n busy: loading,\n }}\n aria-checked={on}\n aria-disabled={inactive}\n aria-busy={loading}\n disabled={inactive}\n onPress={() => send({ type: \"TOGGLE\" })}\n hitSlop={hitSlop ?? hitSlopFor(t, height, width)}\n {...part(\"switch\", \"root\", {\n checked: on,\n disabled,\n loading,\n size,\n color,\n shape,\n value,\n })}\n {...rest}\n style={[\n placementStyle(labelPlacement),\n { gap: t.space[\"2-5\"], opacity: disabled ? 0.5 : 1 },\n style,\n ]}\n >\n {({ pressed }) => (\n <>\n <View\n onLayout={\n hasTexts\n ? (event) => setTrackWidth(event.nativeEvent.layout.width)\n : undefined\n }\n style={[\n {\n minWidth: baseWidth,\n height,\n borderRadius: radius,\n backgroundColor: t.colors[\"border-strong-color\"],\n overflow: \"hidden\",\n justifyContent: \"center\",\n paddingLeft: on ? t.space[\"2\"] : thumb + pad + t.space[\"1\"],\n paddingRight: on ? thumb + pad + t.space[\"1\"] : t.space[\"2\"],\n },\n trackStyle,\n ]}\n {...part(\"switch\", \"track\", { checked: on })}\n >\n <Animated.View\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: pressed ? role.pressed : role.solid,\n opacity: progress,\n }}\n {...part(\"switch\", \"fill\")}\n />\n {hasTexts ? (\n <View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n accessibilityElementsHidden\n {...part(\"switch\", \"track-label\")}\n >\n {typeof trackText === \"string\" ||\n typeof trackText === \"number\" ? (\n <Text numberOfLines={1} style={textStyle}>\n {trackText}\n </Text>\n ) : (\n trackText\n )}\n </View>\n ) : null}\n <Animated.View\n style={[\n {\n position: \"absolute\",\n top: pad,\n left: pad,\n width: thumb,\n height: thumb,\n borderRadius: thumbRadius,\n backgroundColor: t.colors[\"surface-elevated-color\"],\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: [\n {\n translateX: progress.interpolate({\n inputRange: [0, 1],\n outputRange: [0, travel],\n }),\n },\n ],\n ...shadowStyle(t.shadows.sm),\n },\n thumbStyle,\n ]}\n {...part(\"switch\", \"thumb\")}\n >\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={on ? role.solid : t.colors[\"text-muted-color\"]}\n style={{ transform: [{ scale: thumb / 24 }] }}\n {...part(\"switch\", \"spinner\")}\n />\n ) : null}\n </Animated.View>\n </View>\n <ToggleLabel\n t={t}\n component=\"switch\"\n size={size}\n disabled={disabled}\n fontFamily={fonts.sans}\n style={labelStyle}\n >\n {label}\n </ToggleLabel>\n </>\n )}\n </Pressable>\n );\n}\n\nbindFormControl(Switch, {\n valuePropName: \"checked\",\n emptyValue: false,\n commitOnChange: true,\n invalidPropName: null,\n requiredKey: \"validation.checkMissing\",\n});\n"],"mappings":";;;;;;;;;;;;AAuGA,IAAME,IAAeC,EAAS,OAAO;AAQrC,SAAgBC,EAAO,GAAoB;CACzC,IAAM,EACJ,YACA,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version":3,"file":"Switch.js","names":["_Fragment","Fragment$1","nativeDriver","Platform","Switch","rest","useFormControlProps","props","t","useTheme","inactive","disabled","loading","state","send","useMachine","createSwitchMachine","onChange","on","progress","useState","Animated","trackWidth","setTrackWidth","ms","duration","to","animation","Easing","role","colorRole","color","height","controlHeight","size","thumb","hasTexts","onLabel","offLabel","baseWidth","width","travel","radius","shape","thumbRadius","textStyle","weight","fonts","trackText","Pressable","accessibilityState","hitSlop","hitSlopFor","part","placementStyle","labelPlacement","style","View","event","trackStyle","pressed","Text","shadowStyle","thumbStyle","ActivityIndicator","ToggleLabel","labelStyle","label","bindFormControl"],"sources":["../../../../../native/src/components/Switch/Switch.tsx"],"sourcesContent":["import { useFormControlProps } from \"../../internal/FormControlContext\";\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport {\n ActivityIndicator,\n Animated,\n Easing,\n Platform,\n Pressable,\n Text,\n View,\n type PressableProps,\n type StyleProp,\n type TextStyle,\n type ViewStyle,\n} from \"react-native\";\nimport { createSwitchMachine } from \"@minerva/core\";\nimport { useTheme } from \"../../theme/MinervaProvider\";\nimport { bindFormControl } from \"../../internal/formControl\";\nimport { part } from \"../../internal/parts\";\nimport {\n colorRole,\n controlHeight,\n duration,\n hitSlopFor,\n shadowStyle,\n weight,\n type NativeSize,\n type SemanticColor,\n} from \"../../internal/styles\";\nimport {\n ToggleLabel,\n placementStyle,\n type LabelPlacement,\n} from \"../../internal/toggleControl\";\nimport { useMachine } from \"../../internal/useMachine\";\n\nexport type SwitchSize = NativeSize;\nexport type SwitchColor = SemanticColor;\nexport type SwitchShape = \"round\" | \"square\";\nexport type SwitchLabelPlacement = LabelPlacement;\n\nexport interface SwitchProps extends Omit<\n PressableProps,\n \"children\" | \"style\" | \"disabled\" | \"onPress\"\n> {\n /** Whether the switch is on (controlled) */\n checked?: boolean;\n /**\n * Initial state (uncontrolled)\n * @default false\n */\n defaultChecked?: boolean;\n /** Called with the requested state */\n onChange?: (checked: boolean) => void;\n /**\n * Disables the switch\n * @default false\n */\n disabled?: boolean;\n /**\n * Shows a spinner in the thumb and blocks interaction\n * (`accessibilityState.busy`)\n * @default false\n */\n loading?: boolean;\n /**\n * Switch size (track height from the control-height tokens)\n * @default \"medium\"\n */\n size?: SwitchSize;\n /**\n * Semantic color of the \"on\" track\n * @default \"primary\"\n */\n color?: SwitchColor;\n /**\n * Shape of the track and thumb\n * @default \"round\"\n */\n shape?: SwitchShape;\n /** Label displayed next to the switch (a string also names it) */\n label?: ReactNode;\n /**\n * Position of the label relative to the switch\n * @default \"end\"\n */\n labelPlacement?: SwitchLabelPlacement;\n /** Text shown inside the track while on (e.g. \"ON\") */\n onLabel?: ReactNode;\n /** Text shown inside the track while off (e.g. \"OFF\") */\n offLabel?: ReactNode;\n /** Value of the switch (reported by forms) */\n value?: string;\n /** Style of the pressable root */\n style?: StyleProp<ViewStyle>;\n /** Style of the track */\n trackStyle?: StyleProp<ViewStyle>;\n /** Style of the thumb */\n thumbStyle?: StyleProp<ViewStyle>;\n /** Style of the label text */\n labelStyle?: StyleProp<TextStyle>;\n}\n\nconst nativeDriver = Platform.OS !== \"web\";\n\n/**\n * An on / off switch on the switch machine of @minerva/core, drawn with\n * views (themed by the tokens, unlike RN's platform Switch): animated\n * thumb (token duration, instant with reduced motion), on / off texts in\n * the track, loading state, semantic colors, three sizes.\n */\nexport function Switch(props: SwitchProps) {\n const {\n checked,\n defaultChecked = false,\n onChange,\n disabled = false,\n loading = false,\n size = \"medium\",\n color = \"primary\",\n shape = \"round\",\n label,\n labelPlacement = \"end\",\n onLabel,\n offLabel,\n value,\n style,\n trackStyle,\n thumbStyle,\n labelStyle,\n accessibilityState,\n hitSlop,\n ...rest\n } = useFormControlProps(props);\n const { tokens: t, fonts } = useTheme();\n const inactive = disabled || loading;\n const [state, send] = useMachine(createSwitchMachine, {\n checked,\n defaultChecked,\n disabled: inactive,\n onCheckedChange: onChange,\n });\n const on = state.checked;\n const [progress] = useState(() => new Animated.Value(on ? 1 : 0));\n const [trackWidth, setTrackWidth] = useState<number | null>(null);\n const ms = duration(t, \"fast\");\n\n useEffect(() => {\n const to = on ? 1 : 0;\n if (ms <= 0) {\n progress.setValue(to);\n return;\n }\n const animation = Animated.timing(progress, {\n toValue: to,\n duration: ms,\n easing: Easing.out(Easing.quad),\n useNativeDriver: nativeDriver,\n });\n animation.start();\n return () => animation.stop();\n }, [on, ms, progress]);\n\n const role = colorRole(t, color);\n const height = Math.round(controlHeight(t, size) * 0.64);\n const pad = 2;\n const thumb = height - pad * 2;\n const hasTexts = onLabel !== undefined || offLabel !== undefined;\n const baseWidth = Math.round(height * 1.75);\n const width = Math.max(baseWidth, trackWidth ?? 0);\n const travel = width - thumb - pad * 2;\n const radius = shape === \"round\" ? height / 2 : t.radius.sm;\n const thumbRadius =\n shape === \"round\" ? thumb / 2 : Math.max(2, t.radius.sm - pad);\n const textStyle: TextStyle = {\n color: on ? role.onSolid : t.colors[\"text-secondary-color\"],\n fontSize: size === \"large\" ? t.fontSize.sm : t.fontSize.xs,\n fontWeight: weight(t, \"medium\"),\n ...(fonts.sans ? { fontFamily: fonts.sans } : null),\n };\n const trackText = on ? onLabel : offLabel;\n\n return (\n <Pressable\n accessibilityRole=\"switch\"\n accessibilityState={{\n ...accessibilityState,\n checked: on,\n disabled: inactive,\n busy: loading,\n }}\n aria-checked={on}\n aria-disabled={inactive}\n aria-busy={loading}\n disabled={inactive}\n onPress={() => send({ type: \"TOGGLE\" })}\n hitSlop={hitSlop ?? hitSlopFor(t, height, width)}\n {...part(\"switch\", \"root\", {\n checked: on,\n disabled,\n loading,\n size,\n color,\n shape,\n value,\n })}\n {...rest}\n style={[\n placementStyle(labelPlacement),\n { gap: t.space[\"2-5\"], opacity: disabled ? 0.5 : 1 },\n style,\n ]}\n >\n {({ pressed }) => (\n <>\n <View\n onLayout={\n hasTexts\n ? (event) => setTrackWidth(event.nativeEvent.layout.width)\n : undefined\n }\n style={[\n {\n minWidth: baseWidth,\n height,\n borderRadius: radius,\n backgroundColor: t.colors[\"border-strong-color\"],\n overflow: \"hidden\",\n justifyContent: \"center\",\n paddingLeft: on ? t.space[\"2\"] : thumb + pad + t.space[\"1\"],\n paddingRight: on ? thumb + pad + t.space[\"1\"] : t.space[\"2\"],\n },\n trackStyle,\n ]}\n {...part(\"switch\", \"track\", { checked: on })}\n >\n <Animated.View\n style={{\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n backgroundColor: pressed ? role.pressed : role.solid,\n opacity: progress,\n }}\n {...part(\"switch\", \"fill\")}\n />\n {hasTexts ? (\n <View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n accessibilityElementsHidden\n {...part(\"switch\", \"track-label\")}\n >\n {typeof trackText === \"string\" ||\n typeof trackText === \"number\" ? (\n <Text numberOfLines={1} style={textStyle}>\n {trackText}\n </Text>\n ) : (\n trackText\n )}\n </View>\n ) : null}\n <Animated.View\n style={[\n {\n position: \"absolute\",\n top: pad,\n left: pad,\n width: thumb,\n height: thumb,\n borderRadius: thumbRadius,\n backgroundColor: t.colors[\"surface-elevated-color\"],\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: [\n {\n translateX: progress.interpolate({\n inputRange: [0, 1],\n outputRange: [0, travel],\n }),\n },\n ],\n ...shadowStyle(t.shadows.sm),\n },\n thumbStyle,\n ]}\n {...part(\"switch\", \"thumb\")}\n >\n {loading ? (\n <ActivityIndicator\n size=\"small\"\n color={on ? role.solid : t.colors[\"text-muted-color\"]}\n style={{ transform: [{ scale: thumb / 24 }] }}\n {...part(\"switch\", \"spinner\")}\n />\n ) : null}\n </Animated.View>\n </View>\n <ToggleLabel\n t={t}\n component=\"switch\"\n size={size}\n disabled={disabled}\n fontFamily={fonts.sans}\n style={labelStyle}\n >\n {label}\n </ToggleLabel>\n </>\n )}\n </Pressable>\n );\n}\n\nbindFormControl(Switch, {\n valuePropName: \"checked\",\n emptyValue: false,\n commitOnChange: true,\n invalidPropName: null,\n requiredKey: \"validation.checkMissing\",\n});\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AAEAC,EAAgBhE,GAAQ;CACtB,eAAe;CACf,YAAY;CACZ,gBAAgB;CAChB,iBAAiB;CACjB,aAAa;AACf,CAAC"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./theme/MinervaProvider.cjs"),t=require("./components/Button/Button.cjs");require("./components/Button/index.cjs");const n=require("./components/Dialog/Dialog.cjs");require("./components/Dialog/index.cjs");const r=require("./components/Tabs/Tabs.cjs");require("./components/Tabs/index.cjs");const i=require("./components/Cell/Cell.cjs");require("./components/Cell/index.cjs");const ee=require("./components/Card/Card.cjs");require("./components/Card/index.cjs");const te=require("./components/Badge/Badge.cjs");require("./components/Badge/index.cjs");const a=require("./components/Tag/Tag.cjs");require("./components/Tag/index.cjs");const o=require("./components/Avatar/Avatar.cjs");require("./components/Avatar/index.cjs");const s=require("./components/Divider/Divider.cjs");require("./components/Divider/index.cjs");const c=require("./components/Steps/Steps.cjs");require("./components/Steps/index.cjs");const l=require("./components/Pagination/Pagination.cjs");require("./components/Pagination/index.cjs");const u=require("./components/IconButton/IconButton.cjs");require("./components/IconButton/index.cjs");const d=require("./components/ThemeToggle/ThemeToggle.cjs");require("./components/ThemeToggle/index.cjs");const ne=require("./components/NavBar/NavBar.cjs");require("./components/NavBar/index.cjs");const f=require("./components/TabBar/TabBar.cjs");require("./components/TabBar/index.cjs");const p=require("./components/PullRefresh/PullRefresh.cjs");require("./components/PullRefresh/index.cjs");const re=require("./components/SwipeCell/SwipeCell.cjs");require("./components/SwipeCell/index.cjs");const m=require("./components/Calendar/Calendar.cjs");require("./components/Calendar/index.cjs");const h=require("./components/Collapse/Collapse.cjs");require("./components/Collapse/index.cjs");const g=require("./components/Grid/Grid.cjs");require("./components/Grid/index.cjs");const ie=require("./components/ImagePreview/ImagePreview.cjs");require("./components/ImagePreview/index.cjs");const _=require("./components/Alert/Alert.cjs");require("./components/Alert/index.cjs");const ae=require("./components/ActionSheet/ActionSheet.cjs");require("./components/ActionSheet/index.cjs");const v=require("./components/Picker/Picker.cjs"),y=require("./components/DatetimePicker/DatetimePicker.cjs");require("./components/DatetimePicker/index.cjs");const b=require("./components/Empty/Empty.cjs");require("./components/Empty/index.cjs");const x=require("./components/Loading/Loading.cjs");require("./components/Loading/index.cjs"),require("./components/Picker/index.cjs");const S=require("./components/Popup/Popup.cjs");require("./components/Popup/index.cjs");const C=require("./components/Progress/Progress.cjs");require("./components/Progress/index.cjs");const w=require("./internal/FormControlContext.cjs"),oe=require("./components/Radio/Radio.cjs"),se=require("./components/Radio/RadioGroup.cjs");require("./components/Radio/index.cjs");const T=require("./components/Select/SelectParts.cjs"),E=require("./components/Select/Select.cjs");require("./components/Select/index.cjs");const D=require("./components/Skeleton/Skeleton.cjs");require("./components/Skeleton/index.cjs");const O=require("./components/Toast/Toast.cjs");require("./components/Toast/index.cjs");const k=require("./components/Input/Input.cjs");require("./components/Input/index.cjs");const A=require("./components/Textarea/Textarea.cjs");require("./components/Textarea/index.cjs");const j=require("./components/NumberInput/NumberInput.cjs");require("./components/NumberInput/index.cjs");const M=require("./components/Checkbox/Checkbox.cjs"),N=require("./components/Checkbox/CheckboxGroup.cjs");require("./components/Checkbox/index.cjs");const P=require("./components/Switch/Switch.cjs");require("./components/Switch/index.cjs");const F=require("./components/Rating/Rating.cjs");require("./components/Rating/index.cjs");const I=require("./components/SearchBar/SearchBar.cjs");require("./components/SearchBar/index.cjs");const L=require("./components/Form/Form.cjs"),R=require("./components/Form/FormField.cjs");require("./components/Form/index.cjs");const z=require("./components/Table/index.cjs"),B=require("./components/VirtualList/index.cjs"),ce=require("./components/Upload/index.cjs"),V=require("./components/AutoComplete/index.cjs"),H=require("./components/Cascader/index.cjs"),U=require("./components/Command/index.cjs"),W=require("./components/Menu/index.cjs"),G=require("./components/Popover/index.cjs"),K=require("./components/Tooltip/index.cjs"),q=require("./components/Layout/index.cjs"),J=require("./components/Display/index.cjs"),Y=require("./components/Editors/index.cjs"),le=require("./components/NavTree/index.cjs"),ue=require("./components/AppShell/index.cjs"),X=require("./components/PageTabs/index.cjs"),Z=require("./components/FormControl/index.cjs"),Q=require("./components/Confirm/index.cjs"),de=require("./components/TimePicker/index.cjs"),$=require("./components/Parts/index.cjs"),fe=require("./components/HtmlPreview/index.cjs");exports.ActionSheet=ae.ActionSheet,exports.Alert=_.Alert,exports.AppShell=ue.AppShell,exports.AutoComplete=V.AutoComplete,exports.Avatar=o.Avatar,exports.AvatarGroup=o.AvatarGroup,exports.Badge=te.Badge,exports.BottomSheet=S.BottomSheet,exports.Box=q.Box,exports.Button=t.Button,exports.Calendar=m.Calendar,exports.Card=ee.Card,exports.CardContent=$.CardContent,exports.CardDescription=$.CardDescription,exports.CardFooter=$.CardFooter,exports.CardHeader=$.CardHeader,exports.CardTitle=$.CardTitle,exports.Cascader=H.Cascader,exports.Cell=i.Cell,exports.CellGroup=i.CellGroup,exports.Checkbox=M.Checkbox,exports.CheckboxGroup=N.CheckboxGroup,exports.CodeBlock=Y.CodeBlock,exports.CodeEditor=Y.CodeEditor,exports.Collapse=h.Collapse,exports.CollapseItem=h.CollapseItem,exports.CommandDialog=U.CommandDialog,exports.ConfigProvider=e.ConfigProvider,exports.ConfirmDialog=Q.ConfirmDialog,exports.ConfirmProvider=Q.ConfirmProvider,exports.ContextMenu=W.ContextMenu,exports.DataTable=z.DataTable,exports.DatetimePicker=y.DatetimePicker,exports.DescriptionList=J.DescriptionList,exports.Dialog=n.Dialog,exports.Divider=s.Divider,exports.Drawer=S.Popup,exports.DrawerBody=$.DrawerBody,exports.DrawerClose=$.DrawerClose,exports.DrawerContent=$.DrawerContent,exports.DrawerFooter=$.DrawerFooter,exports.DrawerHeader=$.DrawerHeader,exports.DrawerRoot=$.DrawerRoot,exports.DrawerTrigger=$.DrawerTrigger,exports.Empty=b.Empty,exports.Form=L.Form,exports.FormControl=Z.FormControl,exports.FormErrorMessage=Z.FormErrorMessage,exports.FormField=R.FormField,exports.FormHelperText=Z.FormHelperText,exports.FormLabel=Z.FormLabel,exports.FormLayout=q.FormLayout,exports.Grid=g.Grid,exports.GridItem=g.GridItem,exports.HStack=q.HStack,exports.HtmlPreview=fe.HtmlPreview,exports.IconButton=u.IconButton,exports.ImagePreview=ie.ImagePreview,exports.Input=k.Input,exports.JsonField=Y.JsonField,exports.KeyValueEditor=Y.KeyValueEditor,exports.List=J.List,exports.ListItem=J.ListItem,exports.Loading=x.Loading,exports.LoadingState=x.Loading,exports.Menu=W.Menu,exports.MinervaProvider=e.MinervaProvider,exports.Modal=n.Modal,exports.ModalBody=$.ModalBody,exports.ModalClose=$.ModalClose,exports.ModalContent=$.ModalContent,exports.ModalFooter=$.ModalFooter,exports.ModalHeader=$.ModalHeader,exports.ModalRoot=$.ModalRoot,exports.ModalTrigger=$.ModalTrigger,exports.MonthCalendar=m.Calendar,exports.NavBar=ne.NavBar,exports.NavTree=le.NavTree,exports.NumberInput=j.NumberInput,exports.Page=q.Page,exports.PageHeader=q.PageHeader,exports.PageSection=q.PageSection,exports.PageTab=X.PageTab,exports.PageTabs=X.PageTabs,exports.Pagination=l.Pagination,exports.PaletteToggle=d.PaletteToggle,exports.Picker=v.Picker,exports.PickerView=v.PickerView,exports.Popover=G.Popover,exports.PopoverAnchor=G.PopoverAnchor,exports.PopoverClose=G.PopoverClose,exports.PopoverContent=G.PopoverContent,exports.PopoverTrigger=G.PopoverTrigger,exports.Popup=S.Popup,exports.PresetToggle=d.PresetToggle,exports.Progress=C.Progress,exports.ProgressIndicator=C.Progress,exports.Prose=J.Prose,exports.PullRefresh=p.PullRefresh,exports.Radio=oe.Radio,exports.RadioGroup=se.RadioGroup,exports.Rating=F.Rating,exports.RatingScale=$.RatingScale,exports.ResponsiveGrid=q.ResponsiveGrid,exports.SearchBar=I.SearchBar,exports.Select=E.Select,exports.SelectGroup=T.SelectGroup,exports.SelectItem=T.SelectItem,exports.SelectLabel=T.SelectLabel,exports.SelectSeparator=T.SelectSeparator,exports.Skeleton=D.Skeleton,exports.SkeletonText=$.SkeletonText,exports.Spinner=x.Spinner,exports.SplitLayout=q.SplitLayout,exports.Stack=q.Stack,exports.StatCard=q.StatCard,exports.Stepper=j.Stepper,exports.Steps=c.Steps,exports.SwipeCell=re.SwipeCell,exports.Switch=P.Switch,exports.Tab=r.Tab,exports.TabBar=f.TabBar,exports.TabBarItem=f.TabBarItem,exports.TabList=r.TabList,exports.TabPanel=r.TabPanel,exports.Table=z.Table,exports.TableBody=z.TableBody,exports.TableCell=z.TableCell,exports.TableCellContent=$.TableCellContent,exports.TableHead=z.TableHead,exports.TableHeader=z.TableHeader,exports.TableRoot=z.TableRoot,exports.TableRow=z.TableRow,exports.Tabs=r.Tabs,exports.Tag=a.Tag,exports.TagInput=Y.TagInput,exports.TextLink=J.TextLink,exports.Textarea=A.Textarea,exports.ThemeProvider=e.MinervaProvider,exports.ThemeToggle=d.ThemeToggle,exports.TimePicker=de.TimePicker,exports.ToastProvider=O.ToastProvider,exports.Toolbar=q.Toolbar,exports.Tooltip=K.Tooltip,exports.TooltipProvider=K.TooltipProvider,exports.Upload=ce.Upload,exports.VStack=q.VStack,exports.VirtualList=B.VirtualList,exports.collectSelectOptions=T.collectSelectOptions,exports.confirm=Q.confirm,exports.createToastApi=O.createToastApi,exports.daysInMonth=y.daysInMonth,exports.getAvatarColor=o.getAvatarColor,exports.getAvatarInitials=o.getAvatarInitials,exports.toast=O.toast,exports.toastQueue=O.toastQueue,exports.useConfirm=Q.useConfirm,exports.useForm=L.useForm,exports.useFormContext=L.useFormContext,exports.useFormControlContext=w.useFormControlContext,exports.useFormControlProps=w.useFormControlProps,exports.useI18n=e.useI18n,exports.useInsets=e.useInsets,exports.usePullRefresh=p.usePullRefresh,exports.useTheme=e.useTheme,exports.useToast=O.useToast,exports.useTokens=e.useTokens;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./theme/MinervaProvider.cjs"),t=require("./components/Button/Button.cjs");require("./components/Button/index.cjs");const n=require("./components/Dialog/Dialog.cjs");require("./components/Dialog/index.cjs");const r=require("./components/Tabs/Tabs.cjs");require("./components/Tabs/index.cjs");const i=require("./components/Cell/Cell.cjs");require("./components/Cell/index.cjs");const ee=require("./components/Card/Card.cjs");require("./components/Card/index.cjs");const te=require("./components/Badge/Badge.cjs");require("./components/Badge/index.cjs");const ne=require("./components/Tag/Tag.cjs");require("./components/Tag/index.cjs");const a=require("./components/Avatar/Avatar.cjs");require("./components/Avatar/index.cjs");const o=require("./components/Divider/Divider.cjs");require("./components/Divider/index.cjs");const s=require("./components/Steps/Steps.cjs");require("./components/Steps/index.cjs");const c=require("./components/Pagination/Pagination.cjs");require("./components/Pagination/index.cjs");const re=require("./components/IconButton/IconButton.cjs");require("./components/IconButton/index.cjs");const l=require("./components/ThemeToggle/ThemeToggle.cjs");require("./components/ThemeToggle/index.cjs");const ie=require("./components/NavBar/NavBar.cjs");require("./components/NavBar/index.cjs");const u=require("./components/TabBar/TabBar.cjs");require("./components/TabBar/index.cjs");const d=require("./components/PullRefresh/PullRefresh.cjs");require("./components/PullRefresh/index.cjs");const ae=require("./components/SwipeCell/SwipeCell.cjs");require("./components/SwipeCell/index.cjs");const f=require("./components/Calendar/Calendar.cjs");require("./components/Calendar/index.cjs");const p=require("./components/Collapse/Collapse.cjs");require("./components/Collapse/index.cjs");const m=require("./components/Grid/Grid.cjs");require("./components/Grid/index.cjs");const oe=require("./components/ImagePreview/ImagePreview.cjs");require("./components/ImagePreview/index.cjs");const h=require("./components/Alert/Alert.cjs");require("./components/Alert/index.cjs");const g=require("./components/ActionSheet/ActionSheet.cjs");require("./components/ActionSheet/index.cjs");const _=require("./components/Picker/Picker.cjs"),v=require("./components/DatetimePicker/DatetimePicker.cjs");require("./components/DatetimePicker/index.cjs");const y=require("./internal/FormControlContext.cjs"),b=require("./components/DatePicker/DatePicker.cjs");require("./components/DatePicker/index.cjs");const se=require("./components/Empty/Empty.cjs");require("./components/Empty/index.cjs");const x=require("./components/Loading/Loading.cjs");require("./components/Loading/index.cjs"),require("./components/Picker/index.cjs");const S=require("./components/Popup/Popup.cjs");require("./components/Popup/index.cjs");const C=require("./components/Progress/Progress.cjs");require("./components/Progress/index.cjs");const ce=require("./components/Radio/Radio.cjs"),w=require("./components/Radio/RadioGroup.cjs");require("./components/Radio/index.cjs");const T=require("./components/Select/SelectParts.cjs"),E=require("./components/Select/Select.cjs");require("./components/Select/index.cjs");const D=require("./components/Skeleton/Skeleton.cjs");require("./components/Skeleton/index.cjs");const O=require("./components/Toast/Toast.cjs");require("./components/Toast/index.cjs");const k=require("./components/Input/Input.cjs");require("./components/Input/index.cjs");const A=require("./components/Textarea/Textarea.cjs");require("./components/Textarea/index.cjs");const j=require("./components/NumberInput/NumberInput.cjs");require("./components/NumberInput/index.cjs");const M=require("./components/Checkbox/Checkbox.cjs"),N=require("./components/Checkbox/CheckboxGroup.cjs");require("./components/Checkbox/index.cjs");const P=require("./components/Switch/Switch.cjs");require("./components/Switch/index.cjs");const F=require("./components/Rating/Rating.cjs");require("./components/Rating/index.cjs");const I=require("./components/SearchBar/SearchBar.cjs");require("./components/SearchBar/index.cjs");const L=require("./components/Form/Form.cjs"),R=require("./components/Form/FormField.cjs");require("./components/Form/index.cjs");const z=require("./components/Table/index.cjs"),le=require("./components/VirtualList/index.cjs"),B=require("./components/Upload/index.cjs"),V=require("./components/AutoComplete/index.cjs"),H=require("./components/Cascader/index.cjs"),U=require("./components/Command/index.cjs"),W=require("./components/Menu/index.cjs"),G=require("./components/Popover/index.cjs"),K=require("./components/Tooltip/index.cjs"),q=require("./components/Layout/index.cjs"),J=require("./components/Display/index.cjs"),Y=require("./components/Editors/index.cjs"),ue=require("./components/NavTree/index.cjs"),de=require("./components/AppShell/index.cjs"),X=require("./components/PageTabs/index.cjs"),Z=require("./components/FormControl/index.cjs"),Q=require("./components/Confirm/index.cjs"),fe=require("./components/TimePicker/index.cjs"),$=require("./components/Parts/index.cjs"),pe=require("./components/HtmlPreview/index.cjs");exports.ActionSheet=g.ActionSheet,exports.Alert=h.Alert,exports.AppShell=de.AppShell,exports.AutoComplete=V.AutoComplete,exports.Avatar=a.Avatar,exports.AvatarGroup=a.AvatarGroup,exports.Badge=te.Badge,exports.BottomSheet=S.BottomSheet,exports.Box=q.Box,exports.Button=t.Button,exports.Calendar=f.Calendar,exports.Card=ee.Card,exports.CardContent=$.CardContent,exports.CardDescription=$.CardDescription,exports.CardFooter=$.CardFooter,exports.CardHeader=$.CardHeader,exports.CardTitle=$.CardTitle,exports.Cascader=H.Cascader,exports.Cell=i.Cell,exports.CellGroup=i.CellGroup,exports.Checkbox=M.Checkbox,exports.CheckboxGroup=N.CheckboxGroup,exports.CodeBlock=Y.CodeBlock,exports.CodeEditor=Y.CodeEditor,exports.Collapse=p.Collapse,exports.CollapseItem=p.CollapseItem,exports.CommandDialog=U.CommandDialog,exports.ConfigProvider=e.ConfigProvider,exports.ConfirmDialog=Q.ConfirmDialog,exports.ConfirmProvider=Q.ConfirmProvider,exports.ContextMenu=W.ContextMenu,exports.DataTable=z.DataTable,exports.DatePicker=b.DatePicker,exports.DatetimePicker=v.DatetimePicker,exports.DescriptionList=J.DescriptionList,exports.Dialog=n.Dialog,exports.Divider=o.Divider,exports.Drawer=S.Popup,exports.DrawerBody=$.DrawerBody,exports.DrawerClose=$.DrawerClose,exports.DrawerContent=$.DrawerContent,exports.DrawerFooter=$.DrawerFooter,exports.DrawerHeader=$.DrawerHeader,exports.DrawerRoot=$.DrawerRoot,exports.DrawerTrigger=$.DrawerTrigger,exports.Empty=se.Empty,exports.Form=L.Form,exports.FormControl=Z.FormControl,exports.FormErrorMessage=Z.FormErrorMessage,exports.FormField=R.FormField,exports.FormHelperText=Z.FormHelperText,exports.FormLabel=Z.FormLabel,exports.FormLayout=q.FormLayout,exports.Grid=m.Grid,exports.GridItem=m.GridItem,exports.HStack=q.HStack,exports.HtmlPreview=pe.HtmlPreview,exports.IconButton=re.IconButton,exports.ImagePreview=oe.ImagePreview,exports.Input=k.Input,exports.JsonField=Y.JsonField,exports.KeyValueEditor=Y.KeyValueEditor,exports.List=J.List,exports.ListItem=J.ListItem,exports.Loading=x.Loading,exports.LoadingState=x.Loading,exports.Menu=W.Menu,exports.MinervaProvider=e.MinervaProvider,exports.Modal=n.Modal,exports.ModalBody=$.ModalBody,exports.ModalClose=$.ModalClose,exports.ModalContent=$.ModalContent,exports.ModalFooter=$.ModalFooter,exports.ModalHeader=$.ModalHeader,exports.ModalRoot=$.ModalRoot,exports.ModalTrigger=$.ModalTrigger,exports.MonthCalendar=f.Calendar,exports.NavBar=ie.NavBar,exports.NavTree=ue.NavTree,exports.NumberInput=j.NumberInput,exports.Page=q.Page,exports.PageHeader=q.PageHeader,exports.PageSection=q.PageSection,exports.PageTab=X.PageTab,exports.PageTabs=X.PageTabs,exports.Pagination=c.Pagination,exports.PaletteToggle=l.PaletteToggle,exports.Picker=_.Picker,exports.PickerView=_.PickerView,exports.Popover=G.Popover,exports.PopoverAnchor=G.PopoverAnchor,exports.PopoverClose=G.PopoverClose,exports.PopoverContent=G.PopoverContent,exports.PopoverTrigger=G.PopoverTrigger,exports.Popup=S.Popup,exports.PresetToggle=l.PresetToggle,exports.Progress=C.Progress,exports.ProgressIndicator=C.Progress,exports.Prose=J.Prose,exports.PullRefresh=d.PullRefresh,exports.Radio=ce.Radio,exports.RadioGroup=w.RadioGroup,exports.Rating=F.Rating,exports.RatingScale=$.RatingScale,exports.ResponsiveGrid=q.ResponsiveGrid,exports.SearchBar=I.SearchBar,exports.Select=E.Select,exports.SelectGroup=T.SelectGroup,exports.SelectItem=T.SelectItem,exports.SelectLabel=T.SelectLabel,exports.SelectSeparator=T.SelectSeparator,exports.Skeleton=D.Skeleton,exports.SkeletonText=$.SkeletonText,exports.Spinner=x.Spinner,exports.SplitLayout=q.SplitLayout,exports.Stack=q.Stack,exports.StatCard=q.StatCard,exports.Stepper=j.Stepper,exports.Steps=s.Steps,exports.SwipeCell=ae.SwipeCell,exports.Switch=P.Switch,exports.Tab=r.Tab,exports.TabBar=u.TabBar,exports.TabBarItem=u.TabBarItem,exports.TabList=r.TabList,exports.TabPanel=r.TabPanel,exports.Table=z.Table,exports.TableBody=z.TableBody,exports.TableCell=z.TableCell,exports.TableCellContent=$.TableCellContent,exports.TableHead=z.TableHead,exports.TableHeader=z.TableHeader,exports.TableRoot=z.TableRoot,exports.TableRow=z.TableRow,exports.Tabs=r.Tabs,exports.Tag=ne.Tag,exports.TagInput=Y.TagInput,exports.TextLink=J.TextLink,exports.Textarea=A.Textarea,exports.ThemeProvider=e.MinervaProvider,exports.ThemeToggle=l.ThemeToggle,exports.TimePicker=fe.TimePicker,exports.ToastProvider=O.ToastProvider,exports.Toolbar=q.Toolbar,exports.Tooltip=K.Tooltip,exports.TooltipProvider=K.TooltipProvider,exports.Upload=B.Upload,exports.VStack=q.VStack,exports.VirtualList=le.VirtualList,exports.collectSelectOptions=T.collectSelectOptions,exports.confirm=Q.confirm,exports.createToastApi=O.createToastApi,exports.daysInMonth=v.daysInMonth,exports.getAvatarColor=a.getAvatarColor,exports.getAvatarInitials=a.getAvatarInitials,exports.toast=O.toast,exports.toastQueue=O.toastQueue,exports.useConfirm=Q.useConfirm,exports.useForm=L.useForm,exports.useFormContext=L.useFormContext,exports.useFormControlContext=y.useFormControlContext,exports.useFormControlProps=y.useFormControlProps,exports.useI18n=e.useI18n,exports.useInsets=e.useInsets,exports.usePullRefresh=d.usePullRefresh,exports.useTheme=e.useTheme,exports.useToast=O.useToast,exports.useTokens=e.useTokens;
@@ -24,6 +24,7 @@ export * from './components/ImagePreview/index.cjs';
24
24
  export * from './components/Alert/index.cjs';
25
25
  export * from './components/ActionSheet/index.cjs';
26
26
  export * from './components/DatetimePicker/index.cjs';
27
+ export * from './components/DatePicker/index.cjs';
27
28
  export * from './components/Empty/index.cjs';
28
29
  export * from './components/Loading/index.cjs';
29
30
  export * from './components/Picker/index.cjs';
@@ -24,6 +24,7 @@ export * from './components/ImagePreview/index.js';
24
24
  export * from './components/Alert/index.js';
25
25
  export * from './components/ActionSheet/index.js';
26
26
  export * from './components/DatetimePicker/index.js';
27
+ export * from './components/DatePicker/index.js';
27
28
  export * from './components/Empty/index.js';
28
29
  export * from './components/Loading/index.js';
29
30
  export * from './components/Picker/index.js';
@@ -1,109 +1,111 @@
1
- import { ConfigProvider as ee, MinervaProvider as e, useI18n as t, useInsets as n, useTheme as r, useTokens as i } from "./theme/MinervaProvider.js";
2
- import { Button as te } from "./components/Button/Button.js";
1
+ import { ConfigProvider as ee, MinervaProvider as e, useI18n as t, useInsets as n, useTheme as r, useTokens as te } from "./theme/MinervaProvider.js";
2
+ import { Button as ne } from "./components/Button/Button.js";
3
3
  import "./components/Button/index.js";
4
- import { Dialog as a, Modal as o } from "./components/Dialog/Dialog.js";
4
+ import { Dialog as i, Modal as a } from "./components/Dialog/Dialog.js";
5
5
  import "./components/Dialog/index.js";
6
- import { Tab as s, TabList as c, TabPanel as l, Tabs as u } from "./components/Tabs/Tabs.js";
6
+ import { Tab as o, TabList as s, TabPanel as c, Tabs as l } from "./components/Tabs/Tabs.js";
7
7
  import "./components/Tabs/index.js";
8
- import { Cell as d, CellGroup as f } from "./components/Cell/Cell.js";
8
+ import { Cell as u, CellGroup as d } from "./components/Cell/Cell.js";
9
9
  import "./components/Cell/index.js";
10
- import { Card as p } from "./components/Card/Card.js";
10
+ import { Card as f } from "./components/Card/Card.js";
11
11
  import "./components/Card/index.js";
12
- import { Badge as m } from "./components/Badge/Badge.js";
12
+ import { Badge as p } from "./components/Badge/Badge.js";
13
13
  import "./components/Badge/index.js";
14
- import { Tag as h } from "./components/Tag/Tag.js";
14
+ import { Tag as m } from "./components/Tag/Tag.js";
15
15
  import "./components/Tag/index.js";
16
- import { Avatar as g, AvatarGroup as _, getAvatarColor as v, getAvatarInitials as y } from "./components/Avatar/Avatar.js";
16
+ import { Avatar as h, AvatarGroup as g, getAvatarColor as _, getAvatarInitials as v } from "./components/Avatar/Avatar.js";
17
17
  import "./components/Avatar/index.js";
18
- import { Divider as b } from "./components/Divider/Divider.js";
18
+ import { Divider as y } from "./components/Divider/Divider.js";
19
19
  import "./components/Divider/index.js";
20
- import { Steps as x } from "./components/Steps/Steps.js";
20
+ import { Steps as b } from "./components/Steps/Steps.js";
21
21
  import "./components/Steps/index.js";
22
- import { Pagination as S } from "./components/Pagination/Pagination.js";
22
+ import { Pagination as x } from "./components/Pagination/Pagination.js";
23
23
  import "./components/Pagination/index.js";
24
- import { IconButton as C } from "./components/IconButton/IconButton.js";
24
+ import { IconButton as S } from "./components/IconButton/IconButton.js";
25
25
  import "./components/IconButton/index.js";
26
- import { PaletteToggle as w, PresetToggle as T, ThemeToggle as E } from "./components/ThemeToggle/ThemeToggle.js";
26
+ import { PaletteToggle as C, PresetToggle as w, ThemeToggle as T } from "./components/ThemeToggle/ThemeToggle.js";
27
27
  import "./components/ThemeToggle/index.js";
28
- import { NavBar as D } from "./components/NavBar/NavBar.js";
28
+ import { NavBar as E } from "./components/NavBar/NavBar.js";
29
29
  import "./components/NavBar/index.js";
30
- import { TabBar as O, TabBarItem as k } from "./components/TabBar/TabBar.js";
30
+ import { TabBar as D, TabBarItem as O } from "./components/TabBar/TabBar.js";
31
31
  import "./components/TabBar/index.js";
32
- import { PullRefresh as A, usePullRefresh as j } from "./components/PullRefresh/PullRefresh.js";
32
+ import { PullRefresh as k, usePullRefresh as A } from "./components/PullRefresh/PullRefresh.js";
33
33
  import "./components/PullRefresh/index.js";
34
- import { SwipeCell as M } from "./components/SwipeCell/SwipeCell.js";
34
+ import { SwipeCell as j } from "./components/SwipeCell/SwipeCell.js";
35
35
  import "./components/SwipeCell/index.js";
36
- import { Calendar as N } from "./components/Calendar/Calendar.js";
36
+ import { Calendar as M } from "./components/Calendar/Calendar.js";
37
37
  import "./components/Calendar/index.js";
38
- import { Collapse as P, CollapseItem as F } from "./components/Collapse/Collapse.js";
38
+ import { Collapse as N, CollapseItem as P } from "./components/Collapse/Collapse.js";
39
39
  import "./components/Collapse/index.js";
40
- import { Grid as I, GridItem as L } from "./components/Grid/Grid.js";
40
+ import { Grid as F, GridItem as I } from "./components/Grid/Grid.js";
41
41
  import "./components/Grid/index.js";
42
- import { ImagePreview as R } from "./components/ImagePreview/ImagePreview.js";
42
+ import { ImagePreview as L } from "./components/ImagePreview/ImagePreview.js";
43
43
  import "./components/ImagePreview/index.js";
44
- import { Alert as z } from "./components/Alert/Alert.js";
44
+ import { Alert as R } from "./components/Alert/Alert.js";
45
45
  import "./components/Alert/index.js";
46
- import { ActionSheet as B } from "./components/ActionSheet/ActionSheet.js";
46
+ import { ActionSheet as z } from "./components/ActionSheet/ActionSheet.js";
47
47
  import "./components/ActionSheet/index.js";
48
- import { Picker as V, PickerView as H } from "./components/Picker/Picker.js";
49
- import { DatetimePicker as U, daysInMonth as W } from "./components/DatetimePicker/DatetimePicker.js";
48
+ import { Picker as B, PickerView as V } from "./components/Picker/Picker.js";
49
+ import { DatetimePicker as H, daysInMonth as U } from "./components/DatetimePicker/DatetimePicker.js";
50
50
  import "./components/DatetimePicker/index.js";
51
- import { Empty as G } from "./components/Empty/Empty.js";
51
+ import { useFormControlContext as W, useFormControlProps as G } from "./internal/FormControlContext.js";
52
+ import { DatePicker as K } from "./components/DatePicker/DatePicker.js";
53
+ import "./components/DatePicker/index.js";
54
+ import { Empty as q } from "./components/Empty/Empty.js";
52
55
  import "./components/Empty/index.js";
53
- import { Loading as K, Spinner as q } from "./components/Loading/Loading.js";
56
+ import { Loading as J, Spinner as Y } from "./components/Loading/Loading.js";
54
57
  import "./components/Loading/index.js";
55
58
  import "./components/Picker/index.js";
56
- import { BottomSheet as J, Popup as Y } from "./components/Popup/Popup.js";
59
+ import { BottomSheet as X, Popup as Z } from "./components/Popup/Popup.js";
57
60
  import "./components/Popup/index.js";
58
- import { Progress as X } from "./components/Progress/Progress.js";
61
+ import { Progress as Q } from "./components/Progress/Progress.js";
59
62
  import "./components/Progress/index.js";
60
- import { useFormControlContext as Z, useFormControlProps as Q } from "./internal/FormControlContext.js";
61
- import { Radio as ne } from "./components/Radio/Radio.js";
62
- import { RadioGroup as re } from "./components/Radio/RadioGroup.js";
63
+ import { Radio as re } from "./components/Radio/Radio.js";
64
+ import { RadioGroup as ie } from "./components/Radio/RadioGroup.js";
63
65
  import "./components/Radio/index.js";
64
- import { SelectGroup as ie, SelectItem as ae, SelectLabel as oe, SelectSeparator as se, collectSelectOptions as ce } from "./components/Select/SelectParts.js";
65
- import { Select as le } from "./components/Select/Select.js";
66
+ import { SelectGroup as ae, SelectItem as oe, SelectLabel as se, SelectSeparator as ce, collectSelectOptions as le } from "./components/Select/SelectParts.js";
67
+ import { Select as ue } from "./components/Select/Select.js";
66
68
  import "./components/Select/index.js";
67
- import { Skeleton as ue } from "./components/Skeleton/Skeleton.js";
69
+ import { Skeleton as de } from "./components/Skeleton/Skeleton.js";
68
70
  import "./components/Skeleton/index.js";
69
- import { ToastProvider as de, createToastApi as fe, toast as pe, toastQueue as me, useToast as he } from "./components/Toast/Toast.js";
71
+ import { ToastProvider as fe, createToastApi as pe, toast as me, toastQueue as he, useToast as ge } from "./components/Toast/Toast.js";
70
72
  import "./components/Toast/index.js";
71
- import { Input as ge } from "./components/Input/Input.js";
73
+ import { Input as _e } from "./components/Input/Input.js";
72
74
  import "./components/Input/index.js";
73
- import { Textarea as _e } from "./components/Textarea/Textarea.js";
75
+ import { Textarea as ve } from "./components/Textarea/Textarea.js";
74
76
  import "./components/Textarea/index.js";
75
- import { NumberInput as ve, Stepper as ye } from "./components/NumberInput/NumberInput.js";
77
+ import { NumberInput as ye, Stepper as be } from "./components/NumberInput/NumberInput.js";
76
78
  import "./components/NumberInput/index.js";
77
- import { Checkbox as be } from "./components/Checkbox/Checkbox.js";
78
- import { CheckboxGroup as xe } from "./components/Checkbox/CheckboxGroup.js";
79
+ import { Checkbox as xe } from "./components/Checkbox/Checkbox.js";
80
+ import { CheckboxGroup as Se } from "./components/Checkbox/CheckboxGroup.js";
79
81
  import "./components/Checkbox/index.js";
80
- import { Switch as Se } from "./components/Switch/Switch.js";
82
+ import { Switch as Ce } from "./components/Switch/Switch.js";
81
83
  import "./components/Switch/index.js";
82
- import { Rating as Ce } from "./components/Rating/Rating.js";
84
+ import { Rating as we } from "./components/Rating/Rating.js";
83
85
  import "./components/Rating/index.js";
84
- import { SearchBar as we } from "./components/SearchBar/SearchBar.js";
86
+ import { SearchBar as Te } from "./components/SearchBar/SearchBar.js";
85
87
  import "./components/SearchBar/index.js";
86
- import { Form as Te, useForm as Ee, useFormContext as De } from "./components/Form/Form.js";
87
- import { FormField as Oe } from "./components/Form/FormField.js";
88
+ import { Form as Ee, useForm as De, useFormContext as Oe } from "./components/Form/Form.js";
89
+ import { FormField as ke } from "./components/Form/FormField.js";
88
90
  import "./components/Form/index.js";
89
- import { DataTable as ke, Table as Ae, TableBody as je, TableCell as Me, TableHead as Ne, TableHeader as Pe, TableRoot as $, TableRow as Fe } from "./components/Table/index.js";
90
- import { VirtualList as Ie } from "./components/VirtualList/index.js";
91
- import { Upload as Le } from "./components/Upload/index.js";
92
- import { AutoComplete as Re } from "./components/AutoComplete/index.js";
93
- import { Cascader as ze } from "./components/Cascader/index.js";
94
- import { CommandDialog as Be } from "./components/Command/index.js";
95
- import { ContextMenu as Ve, Menu as He } from "./components/Menu/index.js";
96
- import { Popover as Ue, PopoverAnchor as We, PopoverClose as Ge, PopoverContent as Ke, PopoverTrigger as qe } from "./components/Popover/index.js";
97
- import { Tooltip as Je, TooltipProvider as Ye } from "./components/Tooltip/index.js";
98
- import { Box as Xe, FormLayout as Ze, HStack as Qe, Page as $e, PageHeader as et, PageSection as tt, ResponsiveGrid as nt, SplitLayout as rt, Stack as it, StatCard as at, Toolbar as ot, VStack as st } from "./components/Layout/index.js";
99
- import { DescriptionList as ct, List as lt, ListItem as ut, Prose as dt, TextLink as ft } from "./components/Display/index.js";
100
- import { CodeBlock as pt, CodeEditor as mt, JsonField as ht, KeyValueEditor as gt, TagInput as _t } from "./components/Editors/index.js";
101
- import { NavTree as vt } from "./components/NavTree/index.js";
102
- import { AppShell as yt } from "./components/AppShell/index.js";
103
- import { PageTab as bt, PageTabs as xt } from "./components/PageTabs/index.js";
104
- import { FormControl as St, FormErrorMessage as Ct, FormHelperText as wt, FormLabel as Tt } from "./components/FormControl/index.js";
105
- import { ConfirmDialog as Et, ConfirmProvider as Dt, confirm as Ot, useConfirm as kt } from "./components/Confirm/index.js";
106
- import { TimePicker as At } from "./components/TimePicker/index.js";
107
- import { CardContent as jt, CardDescription as Mt, CardFooter as Nt, CardHeader as Pt, CardTitle as Ft, DrawerBody as It, DrawerClose as Lt, DrawerContent as Rt, DrawerFooter as zt, DrawerHeader as Bt, DrawerRoot as Vt, DrawerTrigger as Ht, ModalBody as Ut, ModalClose as Wt, ModalContent as Gt, ModalFooter as Kt, ModalHeader as qt, ModalRoot as Jt, ModalTrigger as Yt, RatingScale as Xt, SkeletonText as Zt, TableCellContent as Qt } from "./components/Parts/index.js";
108
- import { HtmlPreview as $t } from "./components/HtmlPreview/index.js";
109
- export { B as ActionSheet, z as Alert, yt as AppShell, Re as AutoComplete, g as Avatar, _ as AvatarGroup, m as Badge, J as BottomSheet, Xe as Box, te as Button, N as Calendar, p as Card, jt as CardContent, Mt as CardDescription, Nt as CardFooter, Pt as CardHeader, Ft as CardTitle, ze as Cascader, d as Cell, f as CellGroup, be as Checkbox, xe as CheckboxGroup, pt as CodeBlock, mt as CodeEditor, P as Collapse, F as CollapseItem, Be as CommandDialog, ee as ConfigProvider, Et as ConfirmDialog, Dt as ConfirmProvider, Ve as ContextMenu, ke as DataTable, U as DatetimePicker, ct as DescriptionList, a as Dialog, b as Divider, Y as Drawer, It as DrawerBody, Lt as DrawerClose, Rt as DrawerContent, zt as DrawerFooter, Bt as DrawerHeader, Vt as DrawerRoot, Ht as DrawerTrigger, G as Empty, Te as Form, St as FormControl, Ct as FormErrorMessage, Oe as FormField, wt as FormHelperText, Tt as FormLabel, Ze as FormLayout, I as Grid, L as GridItem, Qe as HStack, $t as HtmlPreview, C as IconButton, R as ImagePreview, ge as Input, ht as JsonField, gt as KeyValueEditor, lt as List, ut as ListItem, K as Loading, K as LoadingState, He as Menu, e as MinervaProvider, o as Modal, Ut as ModalBody, Wt as ModalClose, Gt as ModalContent, Kt as ModalFooter, qt as ModalHeader, Jt as ModalRoot, Yt as ModalTrigger, N as MonthCalendar, D as NavBar, vt as NavTree, ve as NumberInput, $e as Page, et as PageHeader, tt as PageSection, bt as PageTab, xt as PageTabs, S as Pagination, w as PaletteToggle, V as Picker, H as PickerView, Ue as Popover, We as PopoverAnchor, Ge as PopoverClose, Ke as PopoverContent, qe as PopoverTrigger, Y as Popup, T as PresetToggle, X as Progress, X as ProgressIndicator, dt as Prose, A as PullRefresh, ne as Radio, re as RadioGroup, Ce as Rating, Xt as RatingScale, nt as ResponsiveGrid, we as SearchBar, le as Select, ie as SelectGroup, ae as SelectItem, oe as SelectLabel, se as SelectSeparator, ue as Skeleton, Zt as SkeletonText, q as Spinner, rt as SplitLayout, it as Stack, at as StatCard, ye as Stepper, x as Steps, M as SwipeCell, Se as Switch, s as Tab, O as TabBar, k as TabBarItem, c as TabList, l as TabPanel, Ae as Table, je as TableBody, Me as TableCell, Qt as TableCellContent, Ne as TableHead, Pe as TableHeader, $ as TableRoot, Fe as TableRow, u as Tabs, h as Tag, _t as TagInput, ft as TextLink, _e as Textarea, e as ThemeProvider, E as ThemeToggle, At as TimePicker, de as ToastProvider, ot as Toolbar, Je as Tooltip, Ye as TooltipProvider, Le as Upload, st as VStack, Ie as VirtualList, ce as collectSelectOptions, Ot as confirm, fe as createToastApi, W as daysInMonth, v as getAvatarColor, y as getAvatarInitials, pe as toast, me as toastQueue, kt as useConfirm, Ee as useForm, De as useFormContext, Z as useFormControlContext, Q as useFormControlProps, t as useI18n, n as useInsets, j as usePullRefresh, r as useTheme, he as useToast, i as useTokens };
91
+ import { DataTable as Ae, Table as je, TableBody as Me, TableCell as Ne, TableHead as Pe, TableHeader as $, TableRoot as Fe, TableRow as Ie } from "./components/Table/index.js";
92
+ import { VirtualList as Le } from "./components/VirtualList/index.js";
93
+ import { Upload as Re } from "./components/Upload/index.js";
94
+ import { AutoComplete as ze } from "./components/AutoComplete/index.js";
95
+ import { Cascader as Be } from "./components/Cascader/index.js";
96
+ import { CommandDialog as Ve } from "./components/Command/index.js";
97
+ import { ContextMenu as He, Menu as Ue } from "./components/Menu/index.js";
98
+ import { Popover as We, PopoverAnchor as Ge, PopoverClose as Ke, PopoverContent as qe, PopoverTrigger as Je } from "./components/Popover/index.js";
99
+ import { Tooltip as Ye, TooltipProvider as Xe } from "./components/Tooltip/index.js";
100
+ import { Box as Ze, FormLayout as Qe, HStack as $e, Page as et, PageHeader as tt, PageSection as nt, ResponsiveGrid as rt, SplitLayout as it, Stack as at, StatCard as ot, Toolbar as st, VStack as ct } from "./components/Layout/index.js";
101
+ import { DescriptionList as lt, List as ut, ListItem as dt, Prose as ft, TextLink as pt } from "./components/Display/index.js";
102
+ import { CodeBlock as mt, CodeEditor as ht, JsonField as gt, KeyValueEditor as _t, TagInput as vt } from "./components/Editors/index.js";
103
+ import { NavTree as yt } from "./components/NavTree/index.js";
104
+ import { AppShell as bt } from "./components/AppShell/index.js";
105
+ import { PageTab as xt, PageTabs as St } from "./components/PageTabs/index.js";
106
+ import { FormControl as Ct, FormErrorMessage as wt, FormHelperText as Tt, FormLabel as Et } from "./components/FormControl/index.js";
107
+ import { ConfirmDialog as Dt, ConfirmProvider as Ot, confirm as kt, useConfirm as At } from "./components/Confirm/index.js";
108
+ import { TimePicker as jt } from "./components/TimePicker/index.js";
109
+ import { CardContent as Mt, CardDescription as Nt, CardFooter as Pt, CardHeader as Ft, CardTitle as It, DrawerBody as Lt, DrawerClose as Rt, DrawerContent as zt, DrawerFooter as Bt, DrawerHeader as Vt, DrawerRoot as Ht, DrawerTrigger as Ut, ModalBody as Wt, ModalClose as Gt, ModalContent as Kt, ModalFooter as qt, ModalHeader as Jt, ModalRoot as Yt, ModalTrigger as Xt, RatingScale as Zt, SkeletonText as Qt, TableCellContent as $t } from "./components/Parts/index.js";
110
+ import { HtmlPreview as en } from "./components/HtmlPreview/index.js";
111
+ export { z as ActionSheet, R as Alert, bt as AppShell, ze as AutoComplete, h as Avatar, g as AvatarGroup, p as Badge, X as BottomSheet, Ze as Box, ne as Button, M as Calendar, f as Card, Mt as CardContent, Nt as CardDescription, Pt as CardFooter, Ft as CardHeader, It as CardTitle, Be as Cascader, u as Cell, d as CellGroup, xe as Checkbox, Se as CheckboxGroup, mt as CodeBlock, ht as CodeEditor, N as Collapse, P as CollapseItem, Ve as CommandDialog, ee as ConfigProvider, Dt as ConfirmDialog, Ot as ConfirmProvider, He as ContextMenu, Ae as DataTable, K as DatePicker, H as DatetimePicker, lt as DescriptionList, i as Dialog, y as Divider, Z as Drawer, Lt as DrawerBody, Rt as DrawerClose, zt as DrawerContent, Bt as DrawerFooter, Vt as DrawerHeader, Ht as DrawerRoot, Ut as DrawerTrigger, q as Empty, Ee as Form, Ct as FormControl, wt as FormErrorMessage, ke as FormField, Tt as FormHelperText, Et as FormLabel, Qe as FormLayout, F as Grid, I as GridItem, $e as HStack, en as HtmlPreview, S as IconButton, L as ImagePreview, _e as Input, gt as JsonField, _t as KeyValueEditor, ut as List, dt as ListItem, J as Loading, J as LoadingState, Ue as Menu, e as MinervaProvider, a as Modal, Wt as ModalBody, Gt as ModalClose, Kt as ModalContent, qt as ModalFooter, Jt as ModalHeader, Yt as ModalRoot, Xt as ModalTrigger, M as MonthCalendar, E as NavBar, yt as NavTree, ye as NumberInput, et as Page, tt as PageHeader, nt as PageSection, xt as PageTab, St as PageTabs, x as Pagination, C as PaletteToggle, B as Picker, V as PickerView, We as Popover, Ge as PopoverAnchor, Ke as PopoverClose, qe as PopoverContent, Je as PopoverTrigger, Z as Popup, w as PresetToggle, Q as Progress, Q as ProgressIndicator, ft as Prose, k as PullRefresh, re as Radio, ie as RadioGroup, we as Rating, Zt as RatingScale, rt as ResponsiveGrid, Te as SearchBar, ue as Select, ae as SelectGroup, oe as SelectItem, se as SelectLabel, ce as SelectSeparator, de as Skeleton, Qt as SkeletonText, Y as Spinner, it as SplitLayout, at as Stack, ot as StatCard, be as Stepper, b as Steps, j as SwipeCell, Ce as Switch, o as Tab, D as TabBar, O as TabBarItem, s as TabList, c as TabPanel, je as Table, Me as TableBody, Ne as TableCell, $t as TableCellContent, Pe as TableHead, $ as TableHeader, Fe as TableRoot, Ie as TableRow, l as Tabs, m as Tag, vt as TagInput, pt as TextLink, ve as Textarea, e as ThemeProvider, T as ThemeToggle, jt as TimePicker, fe as ToastProvider, st as Toolbar, Ye as Tooltip, Xe as TooltipProvider, Re as Upload, ct as VStack, Le as VirtualList, le as collectSelectOptions, kt as confirm, pe as createToastApi, U as daysInMonth, _ as getAvatarColor, v as getAvatarInitials, me as toast, he as toastQueue, At as useConfirm, De as useForm, Oe as useFormContext, W as useFormControlContext, G as useFormControlProps, t as useI18n, n as useInsets, A as usePullRefresh, r as useTheme, ge as useToast, te as useTokens };