@lmb-it/kitsconcerto-native 0.1.277 → 0.1.284
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.
- package/components/Avatar/index.cjs +1 -0
- package/components/Avatar/index.cjs.map +1 -1
- package/components/Avatar/index.js +1 -0
- package/components/Avatar/index.js.map +1 -1
- package/components/Banner/banner.cjs +1 -0
- package/components/Banner/banner.cjs.map +1 -1
- package/components/Banner/banner.js +1 -0
- package/components/Banner/banner.js.map +1 -1
- package/components/BottomTabBar/index.cjs +1 -0
- package/components/BottomTabBar/index.cjs.map +1 -1
- package/components/BottomTabBar/index.js +1 -0
- package/components/BottomTabBar/index.js.map +1 -1
- package/components/BreadCrumb/index.cjs.map +1 -1
- package/components/BreadCrumb/index.js.map +1 -1
- package/components/Button/Button.cjs +1 -0
- package/components/Button/Button.cjs.map +1 -1
- package/components/Button/Button.js +1 -0
- package/components/Button/Button.js.map +1 -1
- package/components/Carousel/index.cjs +1 -0
- package/components/Carousel/index.cjs.map +1 -1
- package/components/Carousel/index.js +1 -0
- package/components/Carousel/index.js.map +1 -1
- package/components/ChatBubble/index.cjs +1 -0
- package/components/ChatBubble/index.cjs.map +1 -1
- package/components/ChatBubble/index.js +1 -0
- package/components/ChatBubble/index.js.map +1 -1
- package/components/Chip/index.cjs +1 -0
- package/components/Chip/index.cjs.map +1 -1
- package/components/Chip/index.js +1 -0
- package/components/Chip/index.js.map +1 -1
- package/components/DateSeparator/index.cjs +1 -0
- package/components/DateSeparator/index.cjs.map +1 -1
- package/components/DateSeparator/index.js +1 -0
- package/components/DateSeparator/index.js.map +1 -1
- package/components/DetailsList/index.cjs +1 -0
- package/components/DetailsList/index.cjs.map +1 -1
- package/components/DetailsList/index.js +1 -0
- package/components/DetailsList/index.js.map +1 -1
- package/components/EmptyState/index.cjs +1 -0
- package/components/EmptyState/index.cjs.map +1 -1
- package/components/EmptyState/index.js +1 -0
- package/components/EmptyState/index.js.map +1 -1
- package/components/Gallery/index.cjs +1 -0
- package/components/Gallery/index.cjs.map +1 -1
- package/components/Gallery/index.js +1 -0
- package/components/Gallery/index.js.map +1 -1
- package/components/MessageComposer/index.cjs +1 -0
- package/components/MessageComposer/index.cjs.map +1 -1
- package/components/MessageComposer/index.js +1 -0
- package/components/MessageComposer/index.js.map +1 -1
- package/components/MessageReceipt/index.cjs +1 -0
- package/components/MessageReceipt/index.cjs.map +1 -1
- package/components/MessageReceipt/index.js +1 -0
- package/components/MessageReceipt/index.js.map +1 -1
- package/components/ProgressBar/index.cjs +1 -0
- package/components/ProgressBar/index.cjs.map +1 -1
- package/components/ProgressBar/index.js +1 -0
- package/components/ProgressBar/index.js.map +1 -1
- package/components/SegmentedControl/index.cjs +1 -0
- package/components/SegmentedControl/index.cjs.map +1 -1
- package/components/SegmentedControl/index.js +1 -0
- package/components/SegmentedControl/index.js.map +1 -1
- package/components/StatCard/index.cjs +1 -0
- package/components/StatCard/index.cjs.map +1 -1
- package/components/StatCard/index.js +1 -0
- package/components/StatCard/index.js.map +1 -1
- package/components/Stepper/index.cjs +1 -0
- package/components/Stepper/index.cjs.map +1 -1
- package/components/Stepper/index.js +1 -0
- package/components/Stepper/index.js.map +1 -1
- package/components/Tabs/index.cjs +1 -0
- package/components/Tabs/index.cjs.map +1 -1
- package/components/Tabs/index.js +1 -0
- package/components/Tabs/index.js.map +1 -1
- package/components/Timeline/index.cjs +1 -0
- package/components/Timeline/index.cjs.map +1 -1
- package/components/Timeline/index.js +1 -0
- package/components/Timeline/index.js.map +1 -1
- package/components/Translate/index.cjs +1 -0
- package/components/Translate/index.cjs.map +1 -1
- package/components/Translate/index.js +1 -0
- package/components/Translate/index.js.map +1 -1
- package/components/TypingIndicator/index.cjs +1 -0
- package/components/TypingIndicator/index.cjs.map +1 -1
- package/components/TypingIndicator/index.js +1 -0
- package/components/TypingIndicator/index.js.map +1 -1
- package/components/overlay/ConfirmDialog/index.cjs +1 -0
- package/components/overlay/ConfirmDialog/index.cjs.map +1 -1
- package/components/overlay/ConfirmDialog/index.js +1 -0
- package/components/overlay/ConfirmDialog/index.js.map +1 -1
- package/components/overlay/Dialog/index.cjs +1 -0
- package/components/overlay/Dialog/index.cjs.map +1 -1
- package/components/overlay/Dialog/index.js +1 -0
- package/components/overlay/Dialog/index.js.map +1 -1
- package/contexts/BreadcrumbContext.cjs +33 -0
- package/contexts/BreadcrumbContext.cjs.map +1 -0
- package/contexts/BreadcrumbContext.js +28 -0
- package/contexts/BreadcrumbContext.js.map +1 -0
- package/form/controls/Checkbox/index.cjs +1 -0
- package/form/controls/Checkbox/index.cjs.map +1 -1
- package/form/controls/Checkbox/index.js +1 -0
- package/form/controls/Checkbox/index.js.map +1 -1
- package/form/controls/RadioButton/radio.cjs +1 -0
- package/form/controls/RadioButton/radio.cjs.map +1 -1
- package/form/controls/RadioButton/radio.js +1 -0
- package/form/controls/RadioButton/radio.js.map +1 -1
- package/form/controls/TriStateCheckbox/index.cjs +1 -0
- package/form/controls/TriStateCheckbox/index.cjs.map +1 -1
- package/form/controls/TriStateCheckbox/index.js +1 -0
- package/form/controls/TriStateCheckbox/index.js.map +1 -1
- package/form/file-pickers/index.cjs +1 -0
- package/form/file-pickers/index.cjs.map +1 -1
- package/form/file-pickers/index.js +1 -0
- package/form/file-pickers/index.js.map +1 -1
- package/form/helpers/FormContainer/index.cjs +1 -0
- package/form/helpers/FormContainer/index.cjs.map +1 -1
- package/form/helpers/FormContainer/index.js +1 -0
- package/form/helpers/FormContainer/index.js.map +1 -1
- package/form/inputs/ColorPicker/index.cjs +1 -0
- package/form/inputs/ColorPicker/index.cjs.map +1 -1
- package/form/inputs/ColorPicker/index.js +1 -0
- package/form/inputs/ColorPicker/index.js.map +1 -1
- package/form/inputs/Datepicker/index.cjs +1 -0
- package/form/inputs/Datepicker/index.cjs.map +1 -1
- package/form/inputs/Datepicker/index.js +1 -0
- package/form/inputs/Datepicker/index.js.map +1 -1
- package/form/inputs/InputLocation/index.cjs +1 -0
- package/form/inputs/InputLocation/index.cjs.map +1 -1
- package/form/inputs/InputLocation/index.js +1 -0
- package/form/inputs/InputLocation/index.js.map +1 -1
- package/form/inputs/InputMask/index.cjs +1 -0
- package/form/inputs/InputMask/index.cjs.map +1 -1
- package/form/inputs/InputMask/index.js +1 -0
- package/form/inputs/InputMask/index.js.map +1 -1
- package/form/inputs/InputNumber/index.cjs +1 -0
- package/form/inputs/InputNumber/index.cjs.map +1 -1
- package/form/inputs/InputNumber/index.js +1 -0
- package/form/inputs/InputNumber/index.js.map +1 -1
- package/form/inputs/InputPassword/index.cjs +1 -0
- package/form/inputs/InputPassword/index.cjs.map +1 -1
- package/form/inputs/InputPassword/index.js +1 -0
- package/form/inputs/InputPassword/index.js.map +1 -1
- package/form/inputs/InputSwitch/index.cjs +1 -0
- package/form/inputs/InputSwitch/index.cjs.map +1 -1
- package/form/inputs/InputSwitch/index.js +1 -0
- package/form/inputs/InputSwitch/index.js.map +1 -1
- package/form/inputs/InputText/index.cjs +1 -0
- package/form/inputs/InputText/index.cjs.map +1 -1
- package/form/inputs/InputText/index.js +1 -0
- package/form/inputs/InputText/index.js.map +1 -1
- package/form/inputs/InputTextarea/index.cjs +1 -0
- package/form/inputs/InputTextarea/index.cjs.map +1 -1
- package/form/inputs/InputTextarea/index.js +1 -0
- package/form/inputs/InputTextarea/index.js.map +1 -1
- package/form/inputs/PhoneInput/index.cjs +1 -0
- package/form/inputs/PhoneInput/index.cjs.map +1 -1
- package/form/inputs/PhoneInput/index.js +1 -0
- package/form/inputs/PhoneInput/index.js.map +1 -1
- package/form/selects/AutoComplete/index.cjs +1 -0
- package/form/selects/AutoComplete/index.cjs.map +1 -1
- package/form/selects/AutoComplete/index.js +1 -0
- package/form/selects/AutoComplete/index.js.map +1 -1
- package/form/selects/CascadeSelect/index.cjs +1 -0
- package/form/selects/CascadeSelect/index.cjs.map +1 -1
- package/form/selects/CascadeSelect/index.js +1 -0
- package/form/selects/CascadeSelect/index.js.map +1 -1
- package/form/selects/Dropdown/index.cjs +1 -0
- package/form/selects/Dropdown/index.cjs.map +1 -1
- package/form/selects/Dropdown/index.js +1 -0
- package/form/selects/Dropdown/index.js.map +1 -1
- package/form/selects/ListBox/index.cjs +1 -0
- package/form/selects/ListBox/index.cjs.map +1 -1
- package/form/selects/ListBox/index.js +1 -0
- package/form/selects/ListBox/index.js.map +1 -1
- package/form/selects/MultiSelect/index.cjs +1 -0
- package/form/selects/MultiSelect/index.cjs.map +1 -1
- package/form/selects/MultiSelect/index.js +1 -0
- package/form/selects/MultiSelect/index.js.map +1 -1
- package/form/selects/TreeSelect/index.cjs +1 -0
- package/form/selects/TreeSelect/index.cjs.map +1 -1
- package/form/selects/TreeSelect/index.js +1 -0
- package/form/selects/TreeSelect/index.js.map +1 -1
- package/form/selects/helpers/SelectPopupOverlay.cjs +1 -0
- package/form/selects/helpers/SelectPopupOverlay.cjs.map +1 -1
- package/form/selects/helpers/SelectPopupOverlay.js +1 -0
- package/form/selects/helpers/SelectPopupOverlay.js.map +1 -1
- package/form-renderer/components/fields/FileUploader/index.cjs +1 -0
- package/form-renderer/components/fields/FileUploader/index.cjs.map +1 -1
- package/form-renderer/components/fields/FileUploader/index.js +1 -0
- package/form-renderer/components/fields/FileUploader/index.js.map +1 -1
- package/form-renderer/components/fields/Group/index.cjs +1 -0
- package/form-renderer/components/fields/Group/index.cjs.map +1 -1
- package/form-renderer/components/fields/Group/index.js +1 -0
- package/form-renderer/components/fields/Group/index.js.map +1 -1
- package/form-renderer/components/fields/Radios/index.cjs +1 -0
- package/form-renderer/components/fields/Radios/index.cjs.map +1 -1
- package/form-renderer/components/fields/Radios/index.js +1 -0
- package/form-renderer/components/fields/Radios/index.js.map +1 -1
- package/form-renderer/components/fields/Select/index.cjs +1 -0
- package/form-renderer/components/fields/Select/index.cjs.map +1 -1
- package/form-renderer/components/fields/Select/index.js +1 -0
- package/form-renderer/components/fields/Select/index.js.map +1 -1
- package/hooks/main.cjs +1 -0
- package/hooks/main.cjs.map +1 -1
- package/hooks/main.js +1 -0
- package/hooks/main.js.map +1 -1
- package/hooks/useBreadcrumbTrail.cjs +21 -0
- package/hooks/useBreadcrumbTrail.cjs.map +1 -0
- package/hooks/useBreadcrumbTrail.js +16 -0
- package/hooks/useBreadcrumbTrail.js.map +1 -0
- package/index.cjs +5 -0
- package/index.cjs.map +1 -1
- package/index.d.ts +144 -5
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/primitives/Card/index.cjs +1 -0
- package/primitives/Card/index.cjs.map +1 -1
- package/primitives/Card/index.js +1 -0
- package/primitives/Card/index.js.map +1 -1
|
@@ -10,6 +10,7 @@ var reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
|
10
10
|
var useSeverityColors = require('../../../hooks/useSeverityColors.cjs');
|
|
11
11
|
require('../../../contexts/DialogContext.cjs');
|
|
12
12
|
require('../../../contexts/PermissionsContext.cjs');
|
|
13
|
+
require('../../../contexts/BreadcrumbContext.cjs');
|
|
13
14
|
var useResolvedStyle = require('../../../hooks/useResolvedStyle.cjs');
|
|
14
15
|
var index = require('../../../animations/index.cjs');
|
|
15
16
|
var sheetMotion_native = require('../sheetMotion.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\n/* ⛔ `ReduceMotion` IS GONE FROM THIS FILE, AND THAT IS A STATEMENT, NOT A\n TIDY-UP. The sheet used to carry `.reduceMotion(ReduceMotion.Never)` — an\n instruction to keep moving when the device asks for less motion — and it is\n on record that the modifier does not hold: the sheet was skipped anyway, in\n this library's own Storybook as well as in the App. It was a claim the code\n could not deliver, so it is removed rather than left to be believed.\n ⚠️ A CUSTOM entering/exiting is outside Reanimated's reduce-motion handling\n altogether, so the sheet now genuinely keeps its motion — which is what the\n modifier was asking for and never achieved. `anim.sheet.keepMotionWhenReduced`\n is left in the presets: ConfirmDialog is a separate unit and no preset should\n change under it. */\nimport Animated, {Easing, FadeIn, FadeOut, runOnJS, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim, scrimExitDuration} from \"../../../animations\";\nimport {sheetEnter, sheetExit} from \"../sheetMotion\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\n/**\n * The scrim: it fades AND it is the thing you tap to dismiss, in one element.\n *\n * ⛔ THIS IS THE ACTIONSHEET'S SHAPE, NOT A THIRD PATTERN (§5). Two components in\n * this library already keep the backdrop a sibling of the panel:\n * `apps/mobile/src/ui/actionsheet/index.tsx:53` declares `Backdrop:\n * AnimatedPressable` — an animated, tappable element in its own right — and\n * `apps/mobile/src/ui/bottomsheet/index.tsx:124` passes `backdropComponent` to\n * `@gorhom/bottom-sheet`. The gorhom one is a prop-injection API belonging to a\n * sheet container that owns its own presentation; this Dialog owns its own RN\n * `Modal`, so there is nothing to inject into. The actionsheet's shape is the one\n * that fits, and it also collapses the separate `absoluteFill` Pressable this\n * component used to need into the scrim itself.\n *\n * ⚠️ BUILT WITH REANIMATED, NOT WITH THE ACTIONSHEET'S `createMotionAnimatedComponent`.\n * That helper wraps a different animation engine; this file's entering/exiting are\n * reanimated layout animations throughout, and mixing two engines in one overlay\n * would be inventing the third pattern §5 forbids.\n */\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <View style={styles.root}>\n {/*\n ⛔ THE SCRIM IS A SIBLING OF THE PANEL, NOT ITS PARENT.\n It used to be the panel's parent, and opacity composes down a\n view tree — so the scrim's FadeIn/FadeOut multiplied the panel's\n opacity for the whole of both animations and the panel faded as\n well as travelled. `SlideInDown` animates `originY` only and\n never touched opacity; the fade was entirely inherited. Fixed\n 29 September 2026 — the structure is the fix, and no duration\n was tuned to make it look better (§12.5).\n\n ⚠️ IT IS ALSO THE DISMISS TARGET. The component used to draw a\n separate `absoluteFill` Pressable inside the scrim; scrim and\n target are one element now, which is the actionsheet's shape.\n */}\n <AnimatedPressable\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(scrimExitDuration(isSheet ? anim.sheet.exitDuration : anim.dialog.exitDuration))}\n style={[StyleSheet.absoluteFill, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n onPress={dismissableMask ? hide : undefined}\n />\n {/*\n ⚠️ `pointerEvents=\"box-none\"` IS LOAD-BEARING. This view spans the\n screen so it can place the panel — centred, or pinned to the\n bottom — and it sits ON TOP of the scrim. Without `box-none` it\n would swallow every tap meant for the scrim and tap-to-dismiss\n would stop working. With it, the empty area passes taps through\n to the scrim beneath while the panel still receives its own.\n */}\n <View\n style={isSheet ? styles.sheetArrange : styles.centerArrange}\n pointerEvents=\"box-none\"\n >\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? sheetEnter(anim.sheet.enter)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={isSheet\n ? sheetExit(anim.sheet.exitDuration, handleExitFinished)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n .withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </View>\n </View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n /**\n * The container. ⛔ IT IS NEVER ANIMATED AND CARRIES NO OPACITY — that is the\n * whole point of the change. It only exists to give the scrim and the panel a\n * shared parent so they can be siblings.\n */\n root: {\n flex: 1,\n },\n /**\n * Places the panel. ⚠️ The 24 padding moved here from the old `overlay` style,\n * and it had to: `position: absolute` resolves against a parent's PADDING box\n * in React Native, so a scrim absolutely filling a padded parent would have\n * stopped 24 short of every screen edge and left an undimmed frame. The scrim\n * now fills `root`, which has no padding, and the inset belongs to the layer\n * that positions the panel.\n */\n centerArrange: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetArrange: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["Pressable","useKitsTheme","useSeverityColors","useSafeAreaInsets","useResolvedStyle","useWindowDimensions","Modal","jsxs","View","jsx","FadeIn","anim","FadeOut","scrimExitDuration","StyleSheet","sheetEnter","ZoomIn","sheetExit","ZoomOut","Easing","runOnJS","Fragment","Icon","Text","ScrollView"],"mappings":";;;;;;;;;;;;;;;;;;;AAiCA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,KAAK,CAAA;AAAA,EAC7C,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,EAAC,SAAS,kBAAA,EAAkB;AACvC;AAqBA,MAAM,iBAAA,GAAoB,QAAA,CAAS,uBAAA,CAAwBA,qBAAS,CAAA;AAEpE,SAAwB,oBAAA,CAAqB,EAAC,KAAA,EAAO,MAAA,EAAM,EAA0B;AACjF,EAAA,MAAM;AAAA,IACF,QAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,OAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA,GAAW,QAAA;AAAA,IACX,UAAA,GAAa,IAAA;AAAA,IACb,UAAA;A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YAAA,EAAc,EAAC,KAAA,EAAO,CAAA,EAAG,QAAQ,CAAA,EAAC;AAAA,IAClC,aAAA,EAAe,IAAA;AAAA,IACf,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB;AAAA,GACvB;AAAA,EACA,IAAA,EAAM;AAAA,IACF,SAAA,EAAW;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\n/* ⛔ `ReduceMotion` IS GONE FROM THIS FILE, AND THAT IS A STATEMENT, NOT A\n TIDY-UP. The sheet used to carry `.reduceMotion(ReduceMotion.Never)` — an\n instruction to keep moving when the device asks for less motion — and it is\n on record that the modifier does not hold: the sheet was skipped anyway, in\n this library's own Storybook as well as in the App. It was a claim the code\n could not deliver, so it is removed rather than left to be believed.\n ⚠️ A CUSTOM entering/exiting is outside Reanimated's reduce-motion handling\n altogether, so the sheet now genuinely keeps its motion — which is what the\n modifier was asking for and never achieved. `anim.sheet.keepMotionWhenReduced`\n is left in the presets: ConfirmDialog is a separate unit and no preset should\n change under it. */\nimport Animated, {Easing, FadeIn, FadeOut, runOnJS, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim, scrimExitDuration} from \"../../../animations\";\nimport {sheetEnter, sheetExit} from \"../sheetMotion\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\n/**\n * The scrim: it fades AND it is the thing you tap to dismiss, in one element.\n *\n * ⛔ THIS IS THE ACTIONSHEET'S SHAPE, NOT A THIRD PATTERN (§5). Two components in\n * this library already keep the backdrop a sibling of the panel:\n * `apps/mobile/src/ui/actionsheet/index.tsx:53` declares `Backdrop:\n * AnimatedPressable` — an animated, tappable element in its own right — and\n * `apps/mobile/src/ui/bottomsheet/index.tsx:124` passes `backdropComponent` to\n * `@gorhom/bottom-sheet`. The gorhom one is a prop-injection API belonging to a\n * sheet container that owns its own presentation; this Dialog owns its own RN\n * `Modal`, so there is nothing to inject into. The actionsheet's shape is the one\n * that fits, and it also collapses the separate `absoluteFill` Pressable this\n * component used to need into the scrim itself.\n *\n * ⚠️ BUILT WITH REANIMATED, NOT WITH THE ACTIONSHEET'S `createMotionAnimatedComponent`.\n * That helper wraps a different animation engine; this file's entering/exiting are\n * reanimated layout animations throughout, and mixing two engines in one overlay\n * would be inventing the third pattern §5 forbids.\n */\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <View style={styles.root}>\n {/*\n ⛔ THE SCRIM IS A SIBLING OF THE PANEL, NOT ITS PARENT.\n It used to be the panel's parent, and opacity composes down a\n view tree — so the scrim's FadeIn/FadeOut multiplied the panel's\n opacity for the whole of both animations and the panel faded as\n well as travelled. `SlideInDown` animates `originY` only and\n never touched opacity; the fade was entirely inherited. Fixed\n 29 September 2026 — the structure is the fix, and no duration\n was tuned to make it look better (§12.5).\n\n ⚠️ IT IS ALSO THE DISMISS TARGET. The component used to draw a\n separate `absoluteFill` Pressable inside the scrim; scrim and\n target are one element now, which is the actionsheet's shape.\n */}\n <AnimatedPressable\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(scrimExitDuration(isSheet ? anim.sheet.exitDuration : anim.dialog.exitDuration))}\n style={[StyleSheet.absoluteFill, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n onPress={dismissableMask ? hide : undefined}\n />\n {/*\n ⚠️ `pointerEvents=\"box-none\"` IS LOAD-BEARING. This view spans the\n screen so it can place the panel — centred, or pinned to the\n bottom — and it sits ON TOP of the scrim. Without `box-none` it\n would swallow every tap meant for the scrim and tap-to-dismiss\n would stop working. With it, the empty area passes taps through\n to the scrim beneath while the panel still receives its own.\n */}\n <View\n style={isSheet ? styles.sheetArrange : styles.centerArrange}\n pointerEvents=\"box-none\"\n >\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? sheetEnter(anim.sheet.enter)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={isSheet\n ? sheetExit(anim.sheet.exitDuration, handleExitFinished)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n .withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </View>\n </View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n /**\n * The container. ⛔ IT IS NEVER ANIMATED AND CARRIES NO OPACITY — that is the\n * whole point of the change. It only exists to give the scrim and the panel a\n * shared parent so they can be siblings.\n */\n root: {\n flex: 1,\n },\n /**\n * Places the panel. ⚠️ The 24 padding moved here from the old `overlay` style,\n * and it had to: `position: absolute` resolves against a parent's PADDING box\n * in React Native, so a scrim absolutely filling a padded parent would have\n * stopped 24 short of every screen edge and left an undimmed frame. The scrim\n * now fills `root`, which has no padding, and the inset belongs to the layer\n * that positions the panel.\n */\n centerArrange: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetArrange: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["Pressable","useKitsTheme","useSeverityColors","useSafeAreaInsets","useResolvedStyle","useWindowDimensions","Modal","jsxs","View","jsx","FadeIn","anim","FadeOut","scrimExitDuration","StyleSheet","sheetEnter","ZoomIn","sheetExit","ZoomOut","Easing","runOnJS","Fragment","Icon","Text","ScrollView"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,KAAK,CAAA;AAAA,EAC7C,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,EAAC,SAAS,kBAAA,EAAkB;AACvC;AAqBA,MAAM,iBAAA,GAAoB,QAAA,CAAS,uBAAA,CAAwBA,qBAAS,CAAA;AAEpE,SAAwB,oBAAA,CAAqB,EAAC,KAAA,EAAO,MAAA,EAAM,EAA0B;AACjF,EAAA,MAAM;AAAA,IACF,QAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,OAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA,GAAW,QAAA;AAAA,IACX,UAAA,GAAa,IAAA;AAAA,IACb,UAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,SA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EAAe,IAAA;AAAA,IACf,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB;AAAA,GACvB;AAAA,EACA,IAAA,EAAM;AAAA,IACF,SAAA,EAAW;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
@@ -6,6 +6,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
6
6
|
import { useSeverityColors } from '../../../hooks/useSeverityColors.js';
|
|
7
7
|
import '../../../contexts/DialogContext.js';
|
|
8
8
|
import '../../../contexts/PermissionsContext.js';
|
|
9
|
+
import '../../../contexts/BreadcrumbContext.js';
|
|
9
10
|
import useResolvedStyle from '../../../hooks/useResolvedStyle.js';
|
|
10
11
|
import { scrimExitDuration, overlayAnimations } from '../../../animations/index.js';
|
|
11
12
|
import { sheetExit, sheetEnter } from '../sheetMotion.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\n/* ⛔ `ReduceMotion` IS GONE FROM THIS FILE, AND THAT IS A STATEMENT, NOT A\n TIDY-UP. The sheet used to carry `.reduceMotion(ReduceMotion.Never)` — an\n instruction to keep moving when the device asks for less motion — and it is\n on record that the modifier does not hold: the sheet was skipped anyway, in\n this library's own Storybook as well as in the App. It was a claim the code\n could not deliver, so it is removed rather than left to be believed.\n ⚠️ A CUSTOM entering/exiting is outside Reanimated's reduce-motion handling\n altogether, so the sheet now genuinely keeps its motion — which is what the\n modifier was asking for and never achieved. `anim.sheet.keepMotionWhenReduced`\n is left in the presets: ConfirmDialog is a separate unit and no preset should\n change under it. */\nimport Animated, {Easing, FadeIn, FadeOut, runOnJS, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim, scrimExitDuration} from \"../../../animations\";\nimport {sheetEnter, sheetExit} from \"../sheetMotion\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\n/**\n * The scrim: it fades AND it is the thing you tap to dismiss, in one element.\n *\n * ⛔ THIS IS THE ACTIONSHEET'S SHAPE, NOT A THIRD PATTERN (§5). Two components in\n * this library already keep the backdrop a sibling of the panel:\n * `apps/mobile/src/ui/actionsheet/index.tsx:53` declares `Backdrop:\n * AnimatedPressable` — an animated, tappable element in its own right — and\n * `apps/mobile/src/ui/bottomsheet/index.tsx:124` passes `backdropComponent` to\n * `@gorhom/bottom-sheet`. The gorhom one is a prop-injection API belonging to a\n * sheet container that owns its own presentation; this Dialog owns its own RN\n * `Modal`, so there is nothing to inject into. The actionsheet's shape is the one\n * that fits, and it also collapses the separate `absoluteFill` Pressable this\n * component used to need into the scrim itself.\n *\n * ⚠️ BUILT WITH REANIMATED, NOT WITH THE ACTIONSHEET'S `createMotionAnimatedComponent`.\n * That helper wraps a different animation engine; this file's entering/exiting are\n * reanimated layout animations throughout, and mixing two engines in one overlay\n * would be inventing the third pattern §5 forbids.\n */\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <View style={styles.root}>\n {/*\n ⛔ THE SCRIM IS A SIBLING OF THE PANEL, NOT ITS PARENT.\n It used to be the panel's parent, and opacity composes down a\n view tree — so the scrim's FadeIn/FadeOut multiplied the panel's\n opacity for the whole of both animations and the panel faded as\n well as travelled. `SlideInDown` animates `originY` only and\n never touched opacity; the fade was entirely inherited. Fixed\n 29 September 2026 — the structure is the fix, and no duration\n was tuned to make it look better (§12.5).\n\n ⚠️ IT IS ALSO THE DISMISS TARGET. The component used to draw a\n separate `absoluteFill` Pressable inside the scrim; scrim and\n target are one element now, which is the actionsheet's shape.\n */}\n <AnimatedPressable\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(scrimExitDuration(isSheet ? anim.sheet.exitDuration : anim.dialog.exitDuration))}\n style={[StyleSheet.absoluteFill, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n onPress={dismissableMask ? hide : undefined}\n />\n {/*\n ⚠️ `pointerEvents=\"box-none\"` IS LOAD-BEARING. This view spans the\n screen so it can place the panel — centred, or pinned to the\n bottom — and it sits ON TOP of the scrim. Without `box-none` it\n would swallow every tap meant for the scrim and tap-to-dismiss\n would stop working. With it, the empty area passes taps through\n to the scrim beneath while the panel still receives its own.\n */}\n <View\n style={isSheet ? styles.sheetArrange : styles.centerArrange}\n pointerEvents=\"box-none\"\n >\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? sheetEnter(anim.sheet.enter)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={isSheet\n ? sheetExit(anim.sheet.exitDuration, handleExitFinished)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n .withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </View>\n </View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n /**\n * The container. ⛔ IT IS NEVER ANIMATED AND CARRIES NO OPACITY — that is the\n * whole point of the change. It only exists to give the scrim and the panel a\n * shared parent so they can be siblings.\n */\n root: {\n flex: 1,\n },\n /**\n * Places the panel. ⚠️ The 24 padding moved here from the old `overlay` style,\n * and it had to: `position: absolute` resolves against a parent's PADDING box\n * in React Native, so a scrim absolutely filling a padded parent would have\n * stopped 24 short of every screen edge and left an undimmed frame. The scrim\n * now fills `root`, which has no padding, and the inset belongs to the layer\n * that positions the panel.\n */\n centerArrange: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetArrange: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["anim"],"mappings":";;;;;;;;;;;;;;;AAiCA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,KAAA,CAAM,SAAS,OAAO,CAAA;AACpD,EAAA,MAAM,UAAA,GAAa,KAAA,CAAM,MAAA,CAAO,OAAO,CAAA;AACvC,EAAA,KAAA,CAAM,UAAU,MAAM;AAClB,IAAA,UAAA,CAAW,OAAA,GAAU,OAAA;AACrB,IAAA,IAAI,OAAA,aAAoB,IAAI,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AAEZ,EAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,WAAA,CAAY,MAAM;AAC/C,IAAA,IAAI,CAAC,UAAA,CAAW,OAAA,EAAS,UAAA,CAAW,KAAK,CAAA;AAAA,EAC7C,CAAA,EAAG,EAAE,CAAA;AACL,EAAA,OAAO,EAAC,SAAS,kBAAA,EAAkB;AACvC;AAqBA,MAAM,iBAAA,GAAoB,QAAA,CAAS,uBAAA,CAAwB,SAAS,CAAA;AAEpE,SAAwB,oBAAA,CAAqB,EAAC,KAAA,EAAO,MAAA,EAAM,EAA0B;AACjF,EAAA,MAAM;AAAA,IACF,QAAA;AAAA,IACA,OAAA,EAAS,WAAA;AAAA,IACT,OAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA,GAAW,QAAA;AAAA,IACX,U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AG,QAAQ,CAAA,EAAC;AAAA,IAClC,aAAA,EAAe,IAAA;AAAA,IACf,YAAA,EAAc;AAAA,GAClB;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,iBAAA,EAAmB;AAAA,GACvB;AAAA,EACA,IAAA,EAAM;AAAA,IACF,SAAA,EAAW;AAAA,GACf;AAAA,EACA,WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/overlay/Dialog/index.native.tsx"],"sourcesContent":["import React from \"react\";\nimport {Modal, Pressable, ScrollView, StyleSheet, View, useWindowDimensions} from \"react-native\";\n/* ⛔ `ReduceMotion` IS GONE FROM THIS FILE, AND THAT IS A STATEMENT, NOT A\n TIDY-UP. The sheet used to carry `.reduceMotion(ReduceMotion.Never)` — an\n instruction to keep moving when the device asks for less motion — and it is\n on record that the modifier does not hold: the sheet was skipped anyway, in\n this library's own Storybook as well as in the App. It was a claim the code\n could not deliver, so it is removed rather than left to be believed.\n ⚠️ A CUSTOM entering/exiting is outside Reanimated's reduce-motion handling\n altogether, so the sheet now genuinely keeps its motion — which is what the\n modifier was asking for and never achieved. `anim.sheet.keepMotionWhenReduced`\n is left in the presets: ConfirmDialog is a separate unit and no preset should\n change under it. */\nimport Animated, {Easing, FadeIn, FadeOut, runOnJS, ZoomIn, ZoomOut} from \"react-native-reanimated\";\nimport {useSafeAreaInsets} from \"react-native-safe-area-context\";\nimport {Icon, Text} from \"../../../_compat\";\nimport type {IKitsDialogControlled} from \"@lmb-it/kitsconcerto-types\";\nimport {useKitsTheme} from \"../../../contexts/Theme\";\nimport {useSeverityColors} from \"../../../hooks/useSeverityColors\";\nimport {useResolvedStyle} from \"../../../hooks\";\nimport {overlayAnimations as anim, scrimExitDuration} from \"../../../animations\";\nimport {sheetEnter, sheetExit} from \"../sheetMotion\";\n\n/**\n * Keeps the RN Modal mounted through the exit animation. `visible` drives the\n * inner scrim + panel entering/exiting; the Modal itself stays mounted until\n * the panel's exit animation reports finished, then unmounts.\n *\n * Re-entrancy: a new `visible=true` during an exit re-renders the inner (which\n * re-enters), and the still-pending exit callback is ignored because\n * `visibleRef` is already back to `true` — so the Modal is never torn down\n * mid-reopen.\n */\nfunction useOverlayPresence(visible: boolean) {\n const [mounted, setMounted] = React.useState(visible);\n const visibleRef = React.useRef(visible);\n React.useEffect(() => {\n visibleRef.current = visible;\n if (visible) setMounted(true);\n }, [visible]);\n // Runs on the JS thread (dispatched via runOnJS from the exit worklet).\n const handleExitFinished = React.useCallback(() => {\n if (!visibleRef.current) setMounted(false);\n }, []);\n return {mounted, handleExitFinished};\n}\n\n/**\n * The scrim: it fades AND it is the thing you tap to dismiss, in one element.\n *\n * ⛔ THIS IS THE ACTIONSHEET'S SHAPE, NOT A THIRD PATTERN (§5). Two components in\n * this library already keep the backdrop a sibling of the panel:\n * `apps/mobile/src/ui/actionsheet/index.tsx:53` declares `Backdrop:\n * AnimatedPressable` — an animated, tappable element in its own right — and\n * `apps/mobile/src/ui/bottomsheet/index.tsx:124` passes `backdropComponent` to\n * `@gorhom/bottom-sheet`. The gorhom one is a prop-injection API belonging to a\n * sheet container that owns its own presentation; this Dialog owns its own RN\n * `Modal`, so there is nothing to inject into. The actionsheet's shape is the one\n * that fits, and it also collapses the separate `absoluteFill` Pressable this\n * component used to need into the scrim itself.\n *\n * ⚠️ BUILT WITH REANIMATED, NOT WITH THE ACTIONSHEET'S `createMotionAnimatedComponent`.\n * That helper wraps a different animation engine; this file's entering/exiting are\n * reanimated layout animations throughout, and mixing two engines in one overlay\n * would be inventing the third pattern §5 forbids.\n */\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nexport default function KitsDialogControlled({state, onHide}: IKitsDialogControlled) {\n const {\n children,\n content: contentProp,\n onClose,\n asyncClose,\n type,\n icon,\n style,\n contentStyle,\n headerStyle,\n maskStyle,\n position = 'center',\n responsive = true,\n hideHeader,\n headerRender,\n footerRender,\n footerStyle,\n canClose,\n bodyStyle,\n closeIcon,\n // Native default true preserves historical tap-to-dismiss; web's\n // PrimeReact default is false — pass explicitly in shared code.\n dismissableMask = true,\n breakpoints,\n ...rest\n } = state;\n const {resolveToken, theme} = useKitsTheme();\n const severityColors = useSeverityColors(type || 'secondary');\n const colors = type ? severityColors : null;\n const insets = useSafeAreaInsets();\n const isSheet = position === 'bottom';\n\n const surfaceColor = resolveToken('surface-card');\n const textColor = resolveToken('text');\n const borderColor = colors?.border ?? resolveToken('border');\n const subtextColor = resolveToken('gray.500');\n const grabberColor = resolveToken('gray.300');\n // Scrim via the literal alpha overlay token → rgba(0,0,0,0.4) in both modes.\n const scrimColor = resolveToken('black-alpha-40');\n const brandLogo = type === 'brand' ? theme.config.logo : null;\n\n const resolvedStyle = useResolvedStyle(style || {});\n const resolvedContentStyle = useResolvedStyle(contentStyle || {});\n const resolvedHeaderStyle = useResolvedStyle(headerStyle || {});\n const resolvedMaskStyle = useResolvedStyle(maskStyle || {});\n const resolvedFooterStyle = useResolvedStyle(footerStyle || {});\n const resolvedBodyStyle = useResolvedStyle(bodyStyle || {});\n\n const {width: screenWidth} = useWindowDimensions();\n // Consumer `breakpoints` ({'960px': '75vw'}) mirrors the web prop: the\n // smallest max-width threshold >= the screen width wins; vw/% both map\n // to a percentage of the window width. Falls back to the responsive\n // default (50% tablets/desktop, 95% phones <=641px).\n const breakpointWidth = (() => {\n if (!breakpoints) return null;\n const matches = Object.entries(breakpoints)\n .map(([k, v]) => [parseFloat(k), v] as const)\n .filter(([px]) => !Number.isNaN(px) && screenWidth <= px)\n .sort(([a], [b]) => a - b);\n const value = matches[0]?.[1];\n if (value == null) return null;\n const num = parseFloat(value);\n return Number.isNaN(num) ? null : `${num}%`;\n })();\n const responsiveWidth = breakpointWidth ?? (screenWidth > 641 ? '50%' : '95%');\n const hasExplicitWidth = (resolvedStyle as any).width != null;\n\n const hide = async () => {\n // canClose gate — intercepts every close path (backdrop Pressable,\n // built-in X Pressable, RN Modal onRequestClose). When blocked,\n // onClose is suppressed and the dialog stays open.\n if (canClose === false || (typeof canClose === 'function' && !canClose())) {\n return;\n }\n if (asyncClose && typeof onClose === \"function\") {\n await onClose();\n } else {\n onClose?.();\n }\n onHide();\n };\n\n const {mounted, handleExitFinished} = useOverlayPresence(!!state.visible);\n if (!mounted) return null;\n\n const content = typeof children === \"function\" ? children(hide) : children;\n // Content-mode override (mirrors web): consumer node replaces the whole\n // header / body / footer template inside the panel.\n const contentMode = contentProp != null\n ? (typeof contentProp === \"function\" ? contentProp({hide}) : contentProp)\n : null;\n\n return (\n <Modal visible transparent animationType=\"none\" onRequestClose={hide}>\n {state.visible && (\n <View style={styles.root}>\n {/*\n ⛔ THE SCRIM IS A SIBLING OF THE PANEL, NOT ITS PARENT.\n It used to be the panel's parent, and opacity composes down a\n view tree — so the scrim's FadeIn/FadeOut multiplied the panel's\n opacity for the whole of both animations and the panel faded as\n well as travelled. `SlideInDown` animates `originY` only and\n never touched opacity; the fade was entirely inherited. Fixed\n 29 September 2026 — the structure is the fix, and no duration\n was tuned to make it look better (§12.5).\n\n ⚠️ IT IS ALSO THE DISMISS TARGET. The component used to draw a\n separate `absoluteFill` Pressable inside the scrim; scrim and\n target are one element now, which is the actionsheet's shape.\n */}\n <AnimatedPressable\n entering={FadeIn.duration(anim.scrim.enterDuration)}\n exiting={FadeOut.duration(scrimExitDuration(isSheet ? anim.sheet.exitDuration : anim.dialog.exitDuration))}\n style={[StyleSheet.absoluteFill, {backgroundColor: scrimColor}, resolvedMaskStyle as any]}\n onPress={dismissableMask ? hide : undefined}\n />\n {/*\n ⚠️ `pointerEvents=\"box-none\"` IS LOAD-BEARING. This view spans the\n screen so it can place the panel — centred, or pinned to the\n bottom — and it sits ON TOP of the scrim. Without `box-none` it\n would swallow every tap meant for the scrim and tap-to-dismiss\n would stop working. With it, the empty area passes taps through\n to the scrim beneath while the panel still receives its own.\n */}\n <View\n style={isSheet ? styles.sheetArrange : styles.centerArrange}\n pointerEvents=\"box-none\"\n >\n <Animated.View\n /* The sheet asks Reanimated to keep moving under iOS\n \"Reduce Motion\" — see `overlayAnimations.sheet`. Without\n it the panel appears in one frame and the only motion\n left is the scrim, which reads as a fade. The centred\n dialog keeps the system default. */\n entering={isSheet\n ? sheetEnter(anim.sheet.enter)\n : ZoomIn.springify().damping(anim.dialog.enter.damping).stiffness(anim.dialog.enter.stiffness).mass(anim.dialog.enter.mass ?? 1)}\n exiting={isSheet\n ? sheetExit(anim.sheet.exitDuration, handleExitFinished)\n : ZoomOut.duration(anim.dialog.exitDuration).easing(Easing.in(Easing.ease))\n .withCallback((finished) => {\n 'worklet';\n if (finished) runOnJS(handleExitFinished)();\n })}\n style={[\n styles.panel,\n isSheet && styles.sheetPanel,\n {backgroundColor: surfaceColor, borderColor},\n // Explicit `breakpoints` win even when responsive=false (web parity)\n !isSheet && !hasExplicitWidth && (breakpoints != null || responsive) ? {width: responsiveWidth} : null,\n resolvedStyle as any,\n resolvedContentStyle as any,\n ]}\n >\n {contentMode != null ? contentMode : <>\n {/* Grabber (bottom-sheet) */}\n {isSheet && <View style={[styles.grabber, {backgroundColor: grabberColor}]}/>}\n\n {/* Severity accent strip */}\n {colors && !isSheet && (\n <View style={{height: 4, backgroundColor: colors.solid, borderTopLeftRadius: 20, borderTopRightRadius: 20}}/>\n )}\n\n {/* Custom header (headerRender) — fully replaces the built-in header\n View when provided. Wins over the default header even if `header`\n is also set. */}\n {!hideHeader && headerRender != null && headerRender({close: () => { void hide(); }})}\n\n {/* Header (default) — rendered when no headerRender and `header` is set. */}\n {!hideHeader && headerRender == null && rest.header != null && (\n <View style={[styles.header, {borderBottomColor: borderColor}, resolvedHeaderStyle as any]}>\n {/* Inline severity icon */}\n {(icon || brandLogo) && colors && (\n <View style={{\n width: 36,\n height: 36,\n borderRadius: 18,\n backgroundColor: colors.iconBg,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 12,\n }}>\n {brandLogo ? brandLogo : typeof icon === 'string' ? (\n <Icon name={icon as never} size={'lg'} color={colors.iconFg}/>\n ) : icon}\n </View>\n )}\n <Text style={{fontSize: 18, fontWeight: \"700\", color: textColor, flex: 1}}>\n {rest.header as React.ReactNode}\n </Text>\n <Pressable onPress={hide} hitSlop={8}>\n {closeIcon ?? <Text style={{fontSize: 18, color: subtextColor}}>✕</Text>}\n </Pressable>\n </View>\n )}\n\n {/* Body — bodyStyle is applied AFTER the built-in maxHeight: 400,\n so consumers can lift the cap (`maxHeight: 600`) or unlock flex\n sizing (`minHeight: 0`) without losing the default behavior when\n bodyStyle is unset. */}\n <ScrollView\n style={[styles.body, resolvedBodyStyle as any]}\n contentContainerStyle={styles.bodyContent}\n showsVerticalScrollIndicator={false}\n >\n {content}\n </ScrollView>\n\n {/* Footer — footerRender takes precedence over `footer`. footerStyle\n is merged AFTER the built-in flex defaults so consumers can override\n alignment (e.g. justifyContent: 'space-between' for left-delete /\n right-actions layouts) without losing the borderTop / padding. */}\n {(footerRender != null || rest.footer != null) && (\n <View style={[\n styles.footer,\n {borderTopColor: borderColor},\n isSheet && {paddingBottom: 12 + insets.bottom},\n resolvedFooterStyle as any,\n ]}>\n {footerRender\n ? footerRender({close: () => { void hide(); }})\n : (rest.footer as React.ReactNode)}\n </View>\n )}\n </>}\n </Animated.View>\n </View>\n </View>\n )}\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n /**\n * The container. ⛔ IT IS NEVER ANIMATED AND CARRIES NO OPACITY — that is the\n * whole point of the change. It only exists to give the scrim and the panel a\n * shared parent so they can be siblings.\n */\n root: {\n flex: 1,\n },\n /**\n * Places the panel. ⚠️ The 24 padding moved here from the old `overlay` style,\n * and it had to: `position: absolute` resolves against a parent's PADDING box\n * in React Native, so a scrim absolutely filling a padded parent would have\n * stopped 24 short of every screen edge and left an undimmed frame. The scrim\n * now fills `root`, which has no padding, and the inset belongs to the layer\n * that positions the panel.\n */\n centerArrange: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 24,\n },\n sheetArrange: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: \"flex-end\",\n },\n sheetPanel: {\n width: \"100%\",\n maxWidth: \"100%\",\n maxHeight: \"90%\",\n borderWidth: 0,\n borderTopLeftRadius: 24,\n borderTopRightRadius: 24,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n paddingTop: 10,\n },\n grabber: {\n width: 40,\n height: 5,\n borderRadius: 999,\n alignSelf: \"center\",\n marginBottom: 6,\n },\n panel: {\n // 20 == radii.xl (no numeric radii resolver on native — see report).\n borderRadius: 20,\n borderWidth: 1,\n minWidth: 250,\n maxWidth: \"90%\",\n maxHeight: \"80%\",\n overflow: \"hidden\",\n // Subtle elevation: low opacity, wide blur, minimal offset.\n elevation: 6,\n shadowColor: \"#000\",\n shadowOffset: {width: 0, height: 2},\n shadowOpacity: 0.15,\n shadowRadius: 20,\n },\n header: {\n flexDirection: \"row\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n paddingVertical: 16,\n borderBottomWidth: 1,\n },\n body: {\n maxHeight: 400,\n },\n bodyContent: {\n padding: 20,\n },\n footer: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n paddingHorizontal: 20,\n paddingVertical: 12,\n borderTopWidth: 1,\n gap: 8,\n },\n});\n"],"names":["anim"],"mappings":";;;;;;;;;;;;;;;;AAiCA,SAAS,mBAAmB,OAAA,EAAkB;AAC1C,EAAA,MAAM,CAAC,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WAAA,EAAa;AAAA,IACT,OAAA,EAAS;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACJ,aAAA,EAAe,KAAA;AAAA,IACf,cAAA,EAAgB,UAAA;AAAA,IAChB,iBAAA,EAAmB,EAAA;AAAA,IACnB,eAAA,EAAiB,EAAA;AAAA,IACjB,cAAA,EAAgB,CAAA;AAAA,IAChB,GAAA,EAAK;AAAA;AAEb,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
|
|
8
|
+
const BreadcrumbContext = React.createContext({
|
|
9
|
+
/* ⚠️ A REAL NO-OP DEFAULT, NOT `{}`. These are read unconditionally by the
|
|
10
|
+
breadcrumb and called unconditionally by any page that sets a trail, and
|
|
11
|
+
a component used outside the provider — in a test, in Storybook, in a
|
|
12
|
+
consumer that renders its own shell — must render rather than throw on a
|
|
13
|
+
missing function. */
|
|
14
|
+
trailingCrumbs: [],
|
|
15
|
+
setTrailingCrumbs: () => void 0
|
|
16
|
+
});
|
|
17
|
+
const BreadcrumbProvider = ({ children }) => {
|
|
18
|
+
const [trailingCrumbs, setCrumbs] = React.useState([]);
|
|
19
|
+
const setTrailingCrumbs = React.useCallback(
|
|
20
|
+
(crumbs) => setCrumbs(crumbs && crumbs.length > 0 ? crumbs : []),
|
|
21
|
+
[]
|
|
22
|
+
);
|
|
23
|
+
const value = React.useMemo(
|
|
24
|
+
() => ({ trailingCrumbs, setTrailingCrumbs }),
|
|
25
|
+
[trailingCrumbs, setTrailingCrumbs]
|
|
26
|
+
);
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbContext.Provider, { value, children });
|
|
28
|
+
};
|
|
29
|
+
const useBreadcrumb = () => React.useContext(BreadcrumbContext);
|
|
30
|
+
|
|
31
|
+
exports.default = BreadcrumbProvider;
|
|
32
|
+
exports.useBreadcrumb = useBreadcrumb;
|
|
33
|
+
//# sourceMappingURL=BreadcrumbContext.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadcrumbContext.cjs","sources":["../../../src/contexts/BreadcrumbContext.tsx"],"sourcesContent":["import React, {\n createContext,\n type FC,\n type PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\nimport type {IBreadcrumbCrumb} from '@lmb-it/kitsconcerto-types';\n\n/**\n * WHAT THE URL CANNOT SAY.\n *\n * The app breadcrumb builds its trail from the URL, which is the right default\n * and is also blind to two things a person reading the screen needs:\n *\n * 1. The NAME of the record that is open. A URL carries its reference —\n * `/config/document-types/DOC-ELEC-VIC` — and nobody recognises a\n * reference. Only the page that fetched the record knows it is the\n * \"Electrical Licence (VIC)\".\n * 2. That a record is open AT ALL, on a page that swaps views in local state\n * without navigating. The URL is identical before and after, so a trail\n * derived from it cannot show the person they have gone one level in.\n *\n * So the page tells the breadcrumb, through this context, and the breadcrumb\n * keeps deciding everything it can decide by itself.\n *\n * ⛔ A PAGE MUST CLEAR WHAT IT SET. The provider lives above the routed\n * content, so a label left behind outlives the page that set it and then\n * describes the wrong screen — the one failure this context can cause that\n * nothing else would catch. `useBreadcrumbTrail` does the clearing for you and\n * is what a page should reach for.\n */\ntype IBreadcrumbContextValues = {\n /** Crumbs the current page has contributed. Empty when none has. */\n trailingCrumbs: IBreadcrumbCrumb[];\n /** Replace them. An empty array or null clears. */\n setTrailingCrumbs: (crumbs: IBreadcrumbCrumb[] | null) => void;\n};\n\nconst BreadcrumbContext = createContext<IBreadcrumbContextValues>({\n /* ⚠️ A REAL NO-OP DEFAULT, NOT `{}`. These are read unconditionally by the\n breadcrumb and called unconditionally by any page that sets a trail, and\n a component used outside the provider — in a test, in Storybook, in a\n consumer that renders its own shell — must render rather than throw on a\n missing function. */\n trailingCrumbs: [],\n setTrailingCrumbs: () => undefined,\n});\n\nconst BreadcrumbProvider: FC<PropsWithChildren> = ({children}) => {\n const [trailingCrumbs, setCrumbs] = useState<IBreadcrumbCrumb[]>([]);\n\n const setTrailingCrumbs = useCallback<IBreadcrumbContextValues['setTrailingCrumbs']>(\n (crumbs) => setCrumbs(crumbs && crumbs.length > 0 ? crumbs : []),\n [],\n );\n\n const value = useMemo(\n () => ({trailingCrumbs, setTrailingCrumbs}),\n [trailingCrumbs, setTrailingCrumbs],\n );\n\n return (\n <BreadcrumbContext.Provider value={value}>\n {children}\n </BreadcrumbContext.Provider>\n );\n};\n\nexport default BreadcrumbProvider;\n\nexport const useBreadcrumb = () => useContext(BreadcrumbContext);\n"],"names":["createContext","useState","useCallback","useMemo","jsx","useContext"],"mappings":";;;;;;;AAyCA,MAAM,oBAAoBA,mBAAA,CAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9D,gBAAgB,EAAC;AAAA,EACjB,mBAAmB,MAAM;AAC7B,CAAC,CAAA;AAED,MAAM,kBAAA,GAA4C,CAAC,EAAC,QAAA,EAAQ,KAAM;AAC9D,EAAA,MAAM,CAAC,cAAA,EAAgB,SAAS,CAAA,GAAIC,cAAA,CAA6B,EAAE,CAAA;AAEnE,EAAA,MAAM,iBAAA,GAAoBC,iBAAA;AAAA,IACtB,CAAC,WAAW,SAAA,CAAU,MAAA,IAAU,OAAO,MAAA,GAAS,CAAA,GAAI,MAAA,GAAS,EAAE,CAAA;AAAA,IAC/D;AAAC,GACL;AAEA,EAAA,MAAM,KAAA,GAAQC,aAAA;AAAA,IACV,OAAO,EAAC,cAAA,EAAgB,iBAAA,EAAiB,CAAA;AAAA,IACzC,CAAC,gBAAgB,iBAAiB;AAAA,GACtC;AAEA,EAAA,uBACIC,cAAA,CAAC,iBAAA,CAAkB,QAAA,EAAlB,EAA2B,OACvB,QAAA,EACL,CAAA;AAER;AAIO,MAAM,aAAA,GAAgB,MAAMC,gBAAA,CAAW,iBAAiB;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useState, useCallback, useMemo, useContext } from 'react';
|
|
3
|
+
|
|
4
|
+
const BreadcrumbContext = createContext({
|
|
5
|
+
/* ⚠️ A REAL NO-OP DEFAULT, NOT `{}`. These are read unconditionally by the
|
|
6
|
+
breadcrumb and called unconditionally by any page that sets a trail, and
|
|
7
|
+
a component used outside the provider — in a test, in Storybook, in a
|
|
8
|
+
consumer that renders its own shell — must render rather than throw on a
|
|
9
|
+
missing function. */
|
|
10
|
+
trailingCrumbs: [],
|
|
11
|
+
setTrailingCrumbs: () => void 0
|
|
12
|
+
});
|
|
13
|
+
const BreadcrumbProvider = ({ children }) => {
|
|
14
|
+
const [trailingCrumbs, setCrumbs] = useState([]);
|
|
15
|
+
const setTrailingCrumbs = useCallback(
|
|
16
|
+
(crumbs) => setCrumbs(crumbs && crumbs.length > 0 ? crumbs : []),
|
|
17
|
+
[]
|
|
18
|
+
);
|
|
19
|
+
const value = useMemo(
|
|
20
|
+
() => ({ trailingCrumbs, setTrailingCrumbs }),
|
|
21
|
+
[trailingCrumbs, setTrailingCrumbs]
|
|
22
|
+
);
|
|
23
|
+
return /* @__PURE__ */ jsx(BreadcrumbContext.Provider, { value, children });
|
|
24
|
+
};
|
|
25
|
+
const useBreadcrumb = () => useContext(BreadcrumbContext);
|
|
26
|
+
|
|
27
|
+
export { BreadcrumbProvider as default, useBreadcrumb };
|
|
28
|
+
//# sourceMappingURL=BreadcrumbContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreadcrumbContext.js","sources":["../../../src/contexts/BreadcrumbContext.tsx"],"sourcesContent":["import React, {\n createContext,\n type FC,\n type PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\nimport type {IBreadcrumbCrumb} from '@lmb-it/kitsconcerto-types';\n\n/**\n * WHAT THE URL CANNOT SAY.\n *\n * The app breadcrumb builds its trail from the URL, which is the right default\n * and is also blind to two things a person reading the screen needs:\n *\n * 1. The NAME of the record that is open. A URL carries its reference —\n * `/config/document-types/DOC-ELEC-VIC` — and nobody recognises a\n * reference. Only the page that fetched the record knows it is the\n * \"Electrical Licence (VIC)\".\n * 2. That a record is open AT ALL, on a page that swaps views in local state\n * without navigating. The URL is identical before and after, so a trail\n * derived from it cannot show the person they have gone one level in.\n *\n * So the page tells the breadcrumb, through this context, and the breadcrumb\n * keeps deciding everything it can decide by itself.\n *\n * ⛔ A PAGE MUST CLEAR WHAT IT SET. The provider lives above the routed\n * content, so a label left behind outlives the page that set it and then\n * describes the wrong screen — the one failure this context can cause that\n * nothing else would catch. `useBreadcrumbTrail` does the clearing for you and\n * is what a page should reach for.\n */\ntype IBreadcrumbContextValues = {\n /** Crumbs the current page has contributed. Empty when none has. */\n trailingCrumbs: IBreadcrumbCrumb[];\n /** Replace them. An empty array or null clears. */\n setTrailingCrumbs: (crumbs: IBreadcrumbCrumb[] | null) => void;\n};\n\nconst BreadcrumbContext = createContext<IBreadcrumbContextValues>({\n /* ⚠️ A REAL NO-OP DEFAULT, NOT `{}`. These are read unconditionally by the\n breadcrumb and called unconditionally by any page that sets a trail, and\n a component used outside the provider — in a test, in Storybook, in a\n consumer that renders its own shell — must render rather than throw on a\n missing function. */\n trailingCrumbs: [],\n setTrailingCrumbs: () => undefined,\n});\n\nconst BreadcrumbProvider: FC<PropsWithChildren> = ({children}) => {\n const [trailingCrumbs, setCrumbs] = useState<IBreadcrumbCrumb[]>([]);\n\n const setTrailingCrumbs = useCallback<IBreadcrumbContextValues['setTrailingCrumbs']>(\n (crumbs) => setCrumbs(crumbs && crumbs.length > 0 ? crumbs : []),\n [],\n );\n\n const value = useMemo(\n () => ({trailingCrumbs, setTrailingCrumbs}),\n [trailingCrumbs, setTrailingCrumbs],\n );\n\n return (\n <BreadcrumbContext.Provider value={value}>\n {children}\n </BreadcrumbContext.Provider>\n );\n};\n\nexport default BreadcrumbProvider;\n\nexport const useBreadcrumb = () => useContext(BreadcrumbContext);\n"],"names":[],"mappings":";;;AAyCA,MAAM,oBAAoB,aAAA,CAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9D,gBAAgB,EAAC;AAAA,EACjB,mBAAmB,MAAM;AAC7B,CAAC,CAAA;AAED,MAAM,kBAAA,GAA4C,CAAC,EAAC,QAAA,EAAQ,KAAM;AAC9D,EAAA,MAAM,CAAC,cAAA,EAAgB,SAAS,CAAA,GAAI,QAAA,CAA6B,EAAE,CAAA;AAEnE,EAAA,MAAM,iBAAA,GAAoB,WAAA;AAAA,IACtB,CAAC,WAAW,SAAA,CAAU,MAAA,IAAU,OAAO,MAAA,GAAS,CAAA,GAAI,MAAA,GAAS,EAAE,CAAA;AAAA,IAC/D;AAAC,GACL;AAEA,EAAA,MAAM,KAAA,GAAQ,OAAA;AAAA,IACV,OAAO,EAAC,cAAA,EAAgB,iBAAA,EAAiB,CAAA;AAAA,IACzC,CAAC,gBAAgB,iBAAiB;AAAA,GACtC;AAEA,EAAA,uBACI,GAAA,CAAC,iBAAA,CAAkB,QAAA,EAAlB,EAA2B,OACvB,QAAA,EACL,CAAA;AAER;AAIO,MAAM,aAAA,GAAgB,MAAM,UAAA,CAAW,iBAAiB;;;;"}
|
|
@@ -8,6 +8,7 @@ var useResolvedElementStyles = require('../../../hooks/useResolvedElementStyles.
|
|
|
8
8
|
var useSelectionController = require('../../../hooks/useSelectionController.cjs');
|
|
9
9
|
require('../../../contexts/DialogContext.cjs');
|
|
10
10
|
require('../../../contexts/PermissionsContext.cjs');
|
|
11
|
+
require('../../../contexts/BreadcrumbContext.cjs');
|
|
11
12
|
var useComponentDefaults = require('../../../hooks/useComponentDefaults.cjs');
|
|
12
13
|
var checkbox_native = require('./checkbox.cjs');
|
|
13
14
|
var index = require('../../../layout/Flex/index.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/controls/Checkbox/index.tsx"],"sourcesContent":["import React, {useMemo, useRef} from \"react\";\n\nimport type {IKitsCheckboxProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsContainer, useComponentDefaults} from \"../../../_compat\";\nimport useResolvedElementStyles from \"../../../hooks/useResolvedElementStyles\";\n\nimport {useSelectionController} from \"../../../hooks\";\nimport CheckboxButton from \"./checkbox\";\n\nconst KitsCheckbox = <T, >({\n ref,\n ...rawProps\n }: IKitsCheckboxProps<T>) => {\n\n\n // No baseGroup — Checkbox is a standalone control, not text-input chrome.\n // FormElement (label/helperText/error) is applied automatically by the hook.\n const {mergedProps: props, elementStyles} = useComponentDefaults('Checkbox', rawProps);\n const resolvedStyles = useResolvedElementStyles(elementStyles);\n\n const itemSlotStyles = useMemo(() => ({\n item: elementStyles.item,\n itemSelected: elementStyles.itemSelected,\n itemDisabled: elementStyles.itemDisabled,\n itemInvalid: elementStyles.itemInvalid,\n }), [elementStyles.item, elementStyles.itemSelected, elementStyles.itemDisabled, elementStyles.itemInvalid]);\n\n const {\n id,\n label,\n required,\n errors,\n hideError,\n isFloatedLabel,\n helperText,\n item,\n value,\n checked,\n defaultValue,\n onChange,\n limit,\n appearanceMode = \"vertical\",\n disabled,\n invalid,\n attached,\n containerStyle\n } = props\n\n const lastToggledIndex = useRef<number | null>(null);\n\n const controller = useSelectionController<T>(checked != undefined ? {\n mode: 'boolean',\n value: checked as boolean,\n defaultValue: defaultValue as unknown as boolean,\n onChange: onChange as ((checked: boolean) => void),\n } : {\n mode: \"multiple\",\n value: value as T[],\n defaultValue: defaultValue as T[],\n onChange: onChange as unknown as ((val: T[]) => void),\n });\n\n const direction = appearanceMode === \"horizontal\" ? \"row\" : \"column\";\n\n const Element = <Flex\n id={id}\n flexDirection={direction}\n flexWrap=\"wrap\"\n gap=\"1rem\"\n style={resolvedStyles.itemsContainer || undefined}\n >\n {!Array.isArray(item) && <CheckboxButton\n key={String(item.value)}\n item={item}\n selected={!!checked}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n controller.onChange(item);\n }}\n />}\n {Array.isArray(item) && item.map((it, index) => {\n return (\n <CheckboxButton\n key={String(it.value)}\n item={it}\n selected={controller.isSelected(it)}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n lastToggledIndex.current = index;\n controller.onChange(it);\n }}\n />\n );\n })}\n </Flex>;\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n helperText={helperText}\n isFloatedLabel={isFloatedLabel}\n errors={errors}\n invalid={invalid}\n label={label}\n hideError={hideError}\n required={required}\n disabled={disabled}\n bare\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n};\n\nexport default KitsCheckbox;\n"],"names":["useComponentDefaults","useResolvedElementStyles","useMemo","useRef","useSelectionController","jsxs","Flex","jsx","CheckboxButton","KitsContainer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/controls/Checkbox/index.tsx"],"sourcesContent":["import React, {useMemo, useRef} from \"react\";\n\nimport type {IKitsCheckboxProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsContainer, useComponentDefaults} from \"../../../_compat\";\nimport useResolvedElementStyles from \"../../../hooks/useResolvedElementStyles\";\n\nimport {useSelectionController} from \"../../../hooks\";\nimport CheckboxButton from \"./checkbox\";\n\nconst KitsCheckbox = <T, >({\n ref,\n ...rawProps\n }: IKitsCheckboxProps<T>) => {\n\n\n // No baseGroup — Checkbox is a standalone control, not text-input chrome.\n // FormElement (label/helperText/error) is applied automatically by the hook.\n const {mergedProps: props, elementStyles} = useComponentDefaults('Checkbox', rawProps);\n const resolvedStyles = useResolvedElementStyles(elementStyles);\n\n const itemSlotStyles = useMemo(() => ({\n item: elementStyles.item,\n itemSelected: elementStyles.itemSelected,\n itemDisabled: elementStyles.itemDisabled,\n itemInvalid: elementStyles.itemInvalid,\n }), [elementStyles.item, elementStyles.itemSelected, elementStyles.itemDisabled, elementStyles.itemInvalid]);\n\n const {\n id,\n label,\n required,\n errors,\n hideError,\n isFloatedLabel,\n helperText,\n item,\n value,\n checked,\n defaultValue,\n onChange,\n limit,\n appearanceMode = \"vertical\",\n disabled,\n invalid,\n attached,\n containerStyle\n } = props\n\n const lastToggledIndex = useRef<number | null>(null);\n\n const controller = useSelectionController<T>(checked != undefined ? {\n mode: 'boolean',\n value: checked as boolean,\n defaultValue: defaultValue as unknown as boolean,\n onChange: onChange as ((checked: boolean) => void),\n } : {\n mode: \"multiple\",\n value: value as T[],\n defaultValue: defaultValue as T[],\n onChange: onChange as unknown as ((val: T[]) => void),\n });\n\n const direction = appearanceMode === \"horizontal\" ? \"row\" : \"column\";\n\n const Element = <Flex\n id={id}\n flexDirection={direction}\n flexWrap=\"wrap\"\n gap=\"1rem\"\n style={resolvedStyles.itemsContainer || undefined}\n >\n {!Array.isArray(item) && <CheckboxButton\n key={String(item.value)}\n item={item}\n selected={!!checked}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n controller.onChange(item);\n }}\n />}\n {Array.isArray(item) && item.map((it, index) => {\n return (\n <CheckboxButton\n key={String(it.value)}\n item={it}\n selected={controller.isSelected(it)}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n lastToggledIndex.current = index;\n controller.onChange(it);\n }}\n />\n );\n })}\n </Flex>;\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n helperText={helperText}\n isFloatedLabel={isFloatedLabel}\n errors={errors}\n invalid={invalid}\n label={label}\n hideError={hideError}\n required={required}\n disabled={disabled}\n bare\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n};\n\nexport default KitsCheckbox;\n"],"names":["useComponentDefaults","useResolvedElementStyles","useMemo","useRef","useSelectionController","jsxs","Flex","jsx","CheckboxButton","KitsContainer"],"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AAA;AAAA,GACL;AAEA,EAAA,IAAI,QAAA,EAAU;AACV,IAAA,OAAO,OAAA;AAAA,EACX;AAEA,EAAA,uBACID,cAAA;AAAA,IAACE,oBAAA;AAAA,IAAA;AAAA,MACG,EAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA,EAAI,IAAA;AAAA,MACJ,cAAA;AAAA,MACA,aAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACL;AAER;;;;"}
|
|
@@ -4,6 +4,7 @@ import useResolvedElementStyles from '../../../hooks/useResolvedElementStyles.js
|
|
|
4
4
|
import useSelectionController from '../../../hooks/useSelectionController.js';
|
|
5
5
|
import '../../../contexts/DialogContext.js';
|
|
6
6
|
import '../../../contexts/PermissionsContext.js';
|
|
7
|
+
import '../../../contexts/BreadcrumbContext.js';
|
|
7
8
|
import useComponentDefaults from '../../../hooks/useComponentDefaults.js';
|
|
8
9
|
import CheckboxButton from './checkbox.js';
|
|
9
10
|
import Flex from '../../../layout/Flex/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/form/controls/Checkbox/index.tsx"],"sourcesContent":["import React, {useMemo, useRef} from \"react\";\n\nimport type {IKitsCheckboxProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsContainer, useComponentDefaults} from \"../../../_compat\";\nimport useResolvedElementStyles from \"../../../hooks/useResolvedElementStyles\";\n\nimport {useSelectionController} from \"../../../hooks\";\nimport CheckboxButton from \"./checkbox\";\n\nconst KitsCheckbox = <T, >({\n ref,\n ...rawProps\n }: IKitsCheckboxProps<T>) => {\n\n\n // No baseGroup — Checkbox is a standalone control, not text-input chrome.\n // FormElement (label/helperText/error) is applied automatically by the hook.\n const {mergedProps: props, elementStyles} = useComponentDefaults('Checkbox', rawProps);\n const resolvedStyles = useResolvedElementStyles(elementStyles);\n\n const itemSlotStyles = useMemo(() => ({\n item: elementStyles.item,\n itemSelected: elementStyles.itemSelected,\n itemDisabled: elementStyles.itemDisabled,\n itemInvalid: elementStyles.itemInvalid,\n }), [elementStyles.item, elementStyles.itemSelected, elementStyles.itemDisabled, elementStyles.itemInvalid]);\n\n const {\n id,\n label,\n required,\n errors,\n hideError,\n isFloatedLabel,\n helperText,\n item,\n value,\n checked,\n defaultValue,\n onChange,\n limit,\n appearanceMode = \"vertical\",\n disabled,\n invalid,\n attached,\n containerStyle\n } = props\n\n const lastToggledIndex = useRef<number | null>(null);\n\n const controller = useSelectionController<T>(checked != undefined ? {\n mode: 'boolean',\n value: checked as boolean,\n defaultValue: defaultValue as unknown as boolean,\n onChange: onChange as ((checked: boolean) => void),\n } : {\n mode: \"multiple\",\n value: value as T[],\n defaultValue: defaultValue as T[],\n onChange: onChange as unknown as ((val: T[]) => void),\n });\n\n const direction = appearanceMode === \"horizontal\" ? \"row\" : \"column\";\n\n const Element = <Flex\n id={id}\n flexDirection={direction}\n flexWrap=\"wrap\"\n gap=\"1rem\"\n style={resolvedStyles.itemsContainer || undefined}\n >\n {!Array.isArray(item) && <CheckboxButton\n key={String(item.value)}\n item={item}\n selected={!!checked}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n controller.onChange(item);\n }}\n />}\n {Array.isArray(item) && item.map((it, index) => {\n return (\n <CheckboxButton\n key={String(it.value)}\n item={it}\n selected={controller.isSelected(it)}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n lastToggledIndex.current = index;\n controller.onChange(it);\n }}\n />\n );\n })}\n </Flex>;\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n helperText={helperText}\n isFloatedLabel={isFloatedLabel}\n errors={errors}\n invalid={invalid}\n label={label}\n hideError={hideError}\n required={required}\n disabled={disabled}\n bare\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n};\n\nexport default KitsCheckbox;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/form/controls/Checkbox/index.tsx"],"sourcesContent":["import React, {useMemo, useRef} from \"react\";\n\nimport type {IKitsCheckboxProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsContainer, useComponentDefaults} from \"../../../_compat\";\nimport useResolvedElementStyles from \"../../../hooks/useResolvedElementStyles\";\n\nimport {useSelectionController} from \"../../../hooks\";\nimport CheckboxButton from \"./checkbox\";\n\nconst KitsCheckbox = <T, >({\n ref,\n ...rawProps\n }: IKitsCheckboxProps<T>) => {\n\n\n // No baseGroup — Checkbox is a standalone control, not text-input chrome.\n // FormElement (label/helperText/error) is applied automatically by the hook.\n const {mergedProps: props, elementStyles} = useComponentDefaults('Checkbox', rawProps);\n const resolvedStyles = useResolvedElementStyles(elementStyles);\n\n const itemSlotStyles = useMemo(() => ({\n item: elementStyles.item,\n itemSelected: elementStyles.itemSelected,\n itemDisabled: elementStyles.itemDisabled,\n itemInvalid: elementStyles.itemInvalid,\n }), [elementStyles.item, elementStyles.itemSelected, elementStyles.itemDisabled, elementStyles.itemInvalid]);\n\n const {\n id,\n label,\n required,\n errors,\n hideError,\n isFloatedLabel,\n helperText,\n item,\n value,\n checked,\n defaultValue,\n onChange,\n limit,\n appearanceMode = \"vertical\",\n disabled,\n invalid,\n attached,\n containerStyle\n } = props\n\n const lastToggledIndex = useRef<number | null>(null);\n\n const controller = useSelectionController<T>(checked != undefined ? {\n mode: 'boolean',\n value: checked as boolean,\n defaultValue: defaultValue as unknown as boolean,\n onChange: onChange as ((checked: boolean) => void),\n } : {\n mode: \"multiple\",\n value: value as T[],\n defaultValue: defaultValue as T[],\n onChange: onChange as unknown as ((val: T[]) => void),\n });\n\n const direction = appearanceMode === \"horizontal\" ? \"row\" : \"column\";\n\n const Element = <Flex\n id={id}\n flexDirection={direction}\n flexWrap=\"wrap\"\n gap=\"1rem\"\n style={resolvedStyles.itemsContainer || undefined}\n >\n {!Array.isArray(item) && <CheckboxButton\n key={String(item.value)}\n item={item}\n selected={!!checked}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n controller.onChange(item);\n }}\n />}\n {Array.isArray(item) && item.map((it, index) => {\n return (\n <CheckboxButton\n key={String(it.value)}\n item={it}\n selected={controller.isSelected(it)}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n lastToggledIndex.current = index;\n controller.onChange(it);\n }}\n />\n );\n })}\n </Flex>;\n\n if (attached) {\n return Element;\n }\n\n return (\n <KitsContainer\n id={id}\n helperText={helperText}\n isFloatedLabel={isFloatedLabel}\n errors={errors}\n invalid={invalid}\n label={label}\n hideError={hideError}\n required={required}\n disabled={disabled}\n bare\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {Element}\n </KitsContainer>\n );\n};\n\nexport default KitsCheckbox;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,MAAM,eAAe,CAAM;AAAA,EACvB,GAAA;AAAA,EACA,GAAG;AACoB,CAAA,KAA6B;AAKpD,EAAA,MAAM,EAAC,WAAA,EAAa,KAAA,EAAO,eAAa,GAAI,oBAAA,CAAqB,YAAY,QAAQ,CAAA;AACrF,EAAA,MAAM,cAAA,GAAiB,yBAAyB,aAAa,CAAA;AAE7D,EAAA,MAAM,cAAA,GAAiB,QAAQ,OAAO;AAAA,IAClC,MAAM,aAAA,CAAc,IAAA;AAAA,IACpB,cAAc,aAAA,CAAc,YAAA;AAAA,IAC5B,cAAc,aAAA,CAAc,YAAA;AAAA,IAC5B,aAAa,aAAA,CAAc;AAAA,GAC/B,CAAA,EAAI,CAAC,aAAA,CAAc,IAAA,EAAM,aAAA,CAAc,cAAc,aAAA,CAAc,YAAA,EAAc,aAAA,CAAc,WAAW,CAAC,CAAA;AAE3G,EAAA,M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AAM;AACZ,cAAA,UAAA,CAAW,SAAS,IAAI,CAAA;AAAA,YAC5B;AAAA,WAAA;AAAA,UARK,MAAA,CAAO,KAAK,KAAK;AAAA,SAS1B;AAAA,QACC,KAAA,CAAM,QAAQ,IAAI,CAAA,IAAK,KAAK,GAAA,CAAI,CAAC,IAAI,KAAA,KAAU;AAC5C,UAAA,uBACI,GAAA;AAAA,YAAC,cAAA;AAAA,YAAA;AAAA,cAEG,IAAA,EAAM,EAAA;AAAA,cACN,QAAA,EAAU,UAAA,CAAW,UAAA,CAAW,EAAE,CAAA;AAAA,cAClC,QAAA;AAAA,cACA,SAAA,EAAW,OAAA;AAAA,cACX,UAAA,EAAY,cAAA;AAAA,cACZ,UAAU,MAAM;AACZ,gBAAA,gBAAA,CAAiB,OAAA,GAAU,KAAA;AAC3B,gBAAA,UAAA,CAAW,SAAS,EAAE,CAAA;AAAA,cAC1B;AAAA,aAAA;AAAA,YATK,MAAA,CAAO,GAAG,KAAK;AAAA,WAUxB;AAAA,QAER,CAAC;AAAA;AAAA;AAAA,GACL;AAEA,EAAA,IAAI,QAAA,EAAU;AACV,IAAA,OAAO,OAAA;AAAA,EACX;AAEA,EAAA,uBACI,GAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACG,EAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,KAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA,EAAI,IAAA;AAAA,MACJ,cAAA;AAAA,MACA,aAAA;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACL;AAER;;;;"}
|
|
@@ -8,6 +8,7 @@ var useResolvedElementStyles = require('../../../hooks/useResolvedElementStyles.
|
|
|
8
8
|
var useSelectionController = require('../../../hooks/useSelectionController.cjs');
|
|
9
9
|
require('../../../contexts/DialogContext.cjs');
|
|
10
10
|
require('../../../contexts/PermissionsContext.cjs');
|
|
11
|
+
require('../../../contexts/BreadcrumbContext.cjs');
|
|
11
12
|
var useComponentDefaults = require('../../../hooks/useComponentDefaults.cjs');
|
|
12
13
|
var radiobutton_native = require('./radiobutton.cjs');
|
|
13
14
|
var index_native = require('../../helpers/FormContainer/index.cjs');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.cjs","sources":["../../../../../src/form/controls/RadioButton/radio.native.tsx"],"sourcesContent":["import React, {useMemo, useRef} from \"react\";\n\nimport type {IKitsRadioProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsContainer, useComponentDefaults} from \"../../../_compat\";\nimport useResolvedElementStyles from \"../../../hooks/useResolvedElementStyles\";\n\nimport {useSelectionController} from \"../../../hooks\";\nimport RadioButton from \"./radiobutton\";\n\nconst KitsRadio = <T, >({\n ref,\n ...rawProps\n }: IKitsRadioProps<T>) => {\n // No baseGroup — Radio is a standalone control, not text-input chrome.\n // FormElement (label/helperText/error) is applied automatically by the hook.\n const {mergedProps: props, elementStyles} = useComponentDefaults('Radio', rawProps);\n const resolvedStyles = useResolvedElementStyles(elementStyles);\n\n const itemSlotStyles = useMemo(() => ({\n item: elementStyles.item,\n itemSelected: elementStyles.itemSelected,\n itemDisabled: elementStyles.itemDisabled,\n itemInvalid: elementStyles.itemInvalid,\n }), [elementStyles.item, elementStyles.itemSelected, elementStyles.itemDisabled, elementStyles.itemInvalid]);\n const {\n id,\n label,\n required,\n errors,\n hideError,\n isFloatedLabel,\n helperText,\n item,\n value,\n defaultValue,\n onChange,\n appearanceMode = \"vertical\",\n disabled,\n invalid,\n containerStyle\n } = props;\n const items = useMemo(\n () => (Array.isArray(item) ? item : [item]),\n [item]\n );\n\n const lastToggledIndex = useRef<number | null>(null);\n\n const controller = useSelectionController<T>({\n mode: \"single\",\n value,\n defaultValue,\n onChange: (selectedValue) => {\n const index = lastToggledIndex.current;\n if (index == null) return;\n\n const currentItem = items[index];\n\n if (currentItem)\n onChange?.(selectedValue === currentItem?.value, {\n item: currentItem,\n index,\n value: currentItem.value,\n });\n },\n });\n const direction = appearanceMode === \"horizontal\" ? \"row\" : \"column\";\n\n return (\n <KitsContainer\n id={id}\n helperText={helperText}\n isFloatedLabel={isFloatedLabel}\n errors={errors}\n invalid={invalid}\n label={label}\n hideError={hideError}\n required={required}\n disabled={disabled}\n bare\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {/* No outer width wrapper here — RadioButton honours `item.w`\n directly (matches radio.web.tsx, which simply maps items\n without a wrapping Flex). Double-wrapping was forcing each\n radio to its parent's full width even when the parent was\n in row direction. */}\n <Flex\n flexDirection={direction}\n flexWrap=\"wrap\"\n gap={10}\n style={resolvedStyles.itemsContainer || undefined}\n >\n {items.map((it, index) => {\n const selected = controller.isSelected(it);\n\n return (\n <RadioButton<T>\n key={String(it.value)}\n item={it}\n selected={selected}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n lastToggledIndex.current = index;\n controller.onChange(it);\n }}\n />\n );\n })}\n </Flex>\n\n </KitsContainer>\n );\n};\n\nexport default KitsRadio;\n"],"names":["useComponentDefaults","useResolvedElementStyles","useMemo","useRef","useSelectionController","jsx","KitsContainer","Flex","RadioButton"],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio.cjs","sources":["../../../../../src/form/controls/RadioButton/radio.native.tsx"],"sourcesContent":["import React, {useMemo, useRef} from \"react\";\n\nimport type {IKitsRadioProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsContainer, useComponentDefaults} from \"../../../_compat\";\nimport useResolvedElementStyles from \"../../../hooks/useResolvedElementStyles\";\n\nimport {useSelectionController} from \"../../../hooks\";\nimport RadioButton from \"./radiobutton\";\n\nconst KitsRadio = <T, >({\n ref,\n ...rawProps\n }: IKitsRadioProps<T>) => {\n // No baseGroup — Radio is a standalone control, not text-input chrome.\n // FormElement (label/helperText/error) is applied automatically by the hook.\n const {mergedProps: props, elementStyles} = useComponentDefaults('Radio', rawProps);\n const resolvedStyles = useResolvedElementStyles(elementStyles);\n\n const itemSlotStyles = useMemo(() => ({\n item: elementStyles.item,\n itemSelected: elementStyles.itemSelected,\n itemDisabled: elementStyles.itemDisabled,\n itemInvalid: elementStyles.itemInvalid,\n }), [elementStyles.item, elementStyles.itemSelected, elementStyles.itemDisabled, elementStyles.itemInvalid]);\n const {\n id,\n label,\n required,\n errors,\n hideError,\n isFloatedLabel,\n helperText,\n item,\n value,\n defaultValue,\n onChange,\n appearanceMode = \"vertical\",\n disabled,\n invalid,\n containerStyle\n } = props;\n const items = useMemo(\n () => (Array.isArray(item) ? item : [item]),\n [item]\n );\n\n const lastToggledIndex = useRef<number | null>(null);\n\n const controller = useSelectionController<T>({\n mode: \"single\",\n value,\n defaultValue,\n onChange: (selectedValue) => {\n const index = lastToggledIndex.current;\n if (index == null) return;\n\n const currentItem = items[index];\n\n if (currentItem)\n onChange?.(selectedValue === currentItem?.value, {\n item: currentItem,\n index,\n value: currentItem.value,\n });\n },\n });\n const direction = appearanceMode === \"horizontal\" ? \"row\" : \"column\";\n\n return (\n <KitsContainer\n id={id}\n helperText={helperText}\n isFloatedLabel={isFloatedLabel}\n errors={errors}\n invalid={invalid}\n label={label}\n hideError={hideError}\n required={required}\n disabled={disabled}\n bare\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {/* No outer width wrapper here — RadioButton honours `item.w`\n directly (matches radio.web.tsx, which simply maps items\n without a wrapping Flex). Double-wrapping was forcing each\n radio to its parent's full width even when the parent was\n in row direction. */}\n <Flex\n flexDirection={direction}\n flexWrap=\"wrap\"\n gap={10}\n style={resolvedStyles.itemsContainer || undefined}\n >\n {items.map((it, index) => {\n const selected = controller.isSelected(it);\n\n return (\n <RadioButton<T>\n key={String(it.value)}\n item={it}\n selected={selected}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n lastToggledIndex.current = index;\n controller.onChange(it);\n }}\n />\n );\n })}\n </Flex>\n\n </KitsContainer>\n );\n};\n\nexport default KitsRadio;\n"],"names":["useComponentDefaults","useResolvedElementStyles","useMemo","useRef","useSelectionController","jsx","KitsContainer","Flex","RadioButton"],"mappings":";;;;;;;;;;;;;;;;;;AASA,MAAM,YAAY,CAAM;AAAA,EACI,GAAA;AAAA,EACA,GAAG;AACP,CAAA,KAA0B;AAG9C,EAAA,MAAM,EAAC,WAAA,EAAa,KAAA,EAAO,eAAa,GAAIA,4BAAA,CAAqB,SAAS,QAAQ,CAAA;AAClF,EAAA,MAAM,cAAA,GAAiBC,iCAAyB,aAAa,CAAA;AAE7D,EAAA,MAAM,cAAA,GAAiBC,cAAQ,OAAO;AAAA,IAClC,MAAM,aAAA,CAAc,IAAA;AAAA,IACpB,cAAc,aAAA,CAAc,YAAA;AAAA,IAC5B,cAAc,aAAA,CAAc,YAAA;AAAA,IAC5B,aAAa,aAAA,CAAc;AAAA,GAC/B,CAAA,EAAI,CAAC,aAAA,CAAc,IAAA,EAAM,aAAA,CAAc,cAAc,aAAA,CAAc,YAAA,EAAc,aAAA,CAAc,WAAW,CAAC,CAAA;AAC3G,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,cAAA,GAAiB,UAAA;AAAA,IACjB,QAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACJ,GAAI,KAAA;AACJ,EAAA,MAAM,KAAA,GAAQA,aAAA;AAAA,IACV,MAAO,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,GAAI,IAAA,GAAO,CAAC,IAAI,CAAA;AAAA,IACzC,CAAC,IAAI;AAAA,GACT;AAEA,EAAA,MAAM,gBAAA,GAAmBC,aAAsB,IAAI,CAAA;AAEnD,EAAA,MAAM,aAAaC,8BAAA,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gBACN,QAAA;AAAA,gBACA,QAAA;AAAA,gBACA,SAAA,EAAW,OAAA;AAAA,gBACX,UAAA,EAAY,cAAA;AAAA,gBACZ,UAAU,MAAM;AACZ,kBAAA,gBAAA,CAAiB,OAAA,GAAU,KAAA;AAC3B,kBAAA,UAAA,CAAW,SAAS,EAAE,CAAA;AAAA,gBAC1B;AAAA,eAAA;AAAA,cATK,MAAA,CAAO,GAAG,KAAK;AAAA,aAUxB;AAAA,UAER,CAAC;AAAA;AAAA;AACL;AAAA,GAEJ;AAER;;;;"}
|
|
@@ -4,6 +4,7 @@ import useResolvedElementStyles from '../../../hooks/useResolvedElementStyles.js
|
|
|
4
4
|
import useSelectionController from '../../../hooks/useSelectionController.js';
|
|
5
5
|
import '../../../contexts/DialogContext.js';
|
|
6
6
|
import '../../../contexts/PermissionsContext.js';
|
|
7
|
+
import '../../../contexts/BreadcrumbContext.js';
|
|
7
8
|
import useComponentDefaults from '../../../hooks/useComponentDefaults.js';
|
|
8
9
|
import RadioButton from './radiobutton.js';
|
|
9
10
|
import KitsContainer from '../../helpers/FormContainer/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sources":["../../../../../src/form/controls/RadioButton/radio.native.tsx"],"sourcesContent":["import React, {useMemo, useRef} from \"react\";\n\nimport type {IKitsRadioProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsContainer, useComponentDefaults} from \"../../../_compat\";\nimport useResolvedElementStyles from \"../../../hooks/useResolvedElementStyles\";\n\nimport {useSelectionController} from \"../../../hooks\";\nimport RadioButton from \"./radiobutton\";\n\nconst KitsRadio = <T, >({\n ref,\n ...rawProps\n }: IKitsRadioProps<T>) => {\n // No baseGroup — Radio is a standalone control, not text-input chrome.\n // FormElement (label/helperText/error) is applied automatically by the hook.\n const {mergedProps: props, elementStyles} = useComponentDefaults('Radio', rawProps);\n const resolvedStyles = useResolvedElementStyles(elementStyles);\n\n const itemSlotStyles = useMemo(() => ({\n item: elementStyles.item,\n itemSelected: elementStyles.itemSelected,\n itemDisabled: elementStyles.itemDisabled,\n itemInvalid: elementStyles.itemInvalid,\n }), [elementStyles.item, elementStyles.itemSelected, elementStyles.itemDisabled, elementStyles.itemInvalid]);\n const {\n id,\n label,\n required,\n errors,\n hideError,\n isFloatedLabel,\n helperText,\n item,\n value,\n defaultValue,\n onChange,\n appearanceMode = \"vertical\",\n disabled,\n invalid,\n containerStyle\n } = props;\n const items = useMemo(\n () => (Array.isArray(item) ? item : [item]),\n [item]\n );\n\n const lastToggledIndex = useRef<number | null>(null);\n\n const controller = useSelectionController<T>({\n mode: \"single\",\n value,\n defaultValue,\n onChange: (selectedValue) => {\n const index = lastToggledIndex.current;\n if (index == null) return;\n\n const currentItem = items[index];\n\n if (currentItem)\n onChange?.(selectedValue === currentItem?.value, {\n item: currentItem,\n index,\n value: currentItem.value,\n });\n },\n });\n const direction = appearanceMode === \"horizontal\" ? \"row\" : \"column\";\n\n return (\n <KitsContainer\n id={id}\n helperText={helperText}\n isFloatedLabel={isFloatedLabel}\n errors={errors}\n invalid={invalid}\n label={label}\n hideError={hideError}\n required={required}\n disabled={disabled}\n bare\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {/* No outer width wrapper here — RadioButton honours `item.w`\n directly (matches radio.web.tsx, which simply maps items\n without a wrapping Flex). Double-wrapping was forcing each\n radio to its parent's full width even when the parent was\n in row direction. */}\n <Flex\n flexDirection={direction}\n flexWrap=\"wrap\"\n gap={10}\n style={resolvedStyles.itemsContainer || undefined}\n >\n {items.map((it, index) => {\n const selected = controller.isSelected(it);\n\n return (\n <RadioButton<T>\n key={String(it.value)}\n item={it}\n selected={selected}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n lastToggledIndex.current = index;\n controller.onChange(it);\n }}\n />\n );\n })}\n </Flex>\n\n </KitsContainer>\n );\n};\n\nexport default KitsRadio;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio.js","sources":["../../../../../src/form/controls/RadioButton/radio.native.tsx"],"sourcesContent":["import React, {useMemo, useRef} from \"react\";\n\nimport type {IKitsRadioProps} from \"@lmb-it/kitsconcerto-types\";\nimport {Flex, KitsContainer, useComponentDefaults} from \"../../../_compat\";\nimport useResolvedElementStyles from \"../../../hooks/useResolvedElementStyles\";\n\nimport {useSelectionController} from \"../../../hooks\";\nimport RadioButton from \"./radiobutton\";\n\nconst KitsRadio = <T, >({\n ref,\n ...rawProps\n }: IKitsRadioProps<T>) => {\n // No baseGroup — Radio is a standalone control, not text-input chrome.\n // FormElement (label/helperText/error) is applied automatically by the hook.\n const {mergedProps: props, elementStyles} = useComponentDefaults('Radio', rawProps);\n const resolvedStyles = useResolvedElementStyles(elementStyles);\n\n const itemSlotStyles = useMemo(() => ({\n item: elementStyles.item,\n itemSelected: elementStyles.itemSelected,\n itemDisabled: elementStyles.itemDisabled,\n itemInvalid: elementStyles.itemInvalid,\n }), [elementStyles.item, elementStyles.itemSelected, elementStyles.itemDisabled, elementStyles.itemInvalid]);\n const {\n id,\n label,\n required,\n errors,\n hideError,\n isFloatedLabel,\n helperText,\n item,\n value,\n defaultValue,\n onChange,\n appearanceMode = \"vertical\",\n disabled,\n invalid,\n containerStyle\n } = props;\n const items = useMemo(\n () => (Array.isArray(item) ? item : [item]),\n [item]\n );\n\n const lastToggledIndex = useRef<number | null>(null);\n\n const controller = useSelectionController<T>({\n mode: \"single\",\n value,\n defaultValue,\n onChange: (selectedValue) => {\n const index = lastToggledIndex.current;\n if (index == null) return;\n\n const currentItem = items[index];\n\n if (currentItem)\n onChange?.(selectedValue === currentItem?.value, {\n item: currentItem,\n index,\n value: currentItem.value,\n });\n },\n });\n const direction = appearanceMode === \"horizontal\" ? \"row\" : \"column\";\n\n return (\n <KitsContainer\n id={id}\n helperText={helperText}\n isFloatedLabel={isFloatedLabel}\n errors={errors}\n invalid={invalid}\n label={label}\n hideError={hideError}\n required={required}\n disabled={disabled}\n bare\n containerStyle={containerStyle}\n elementStyles={elementStyles}\n >\n {/* No outer width wrapper here — RadioButton honours `item.w`\n directly (matches radio.web.tsx, which simply maps items\n without a wrapping Flex). Double-wrapping was forcing each\n radio to its parent's full width even when the parent was\n in row direction. */}\n <Flex\n flexDirection={direction}\n flexWrap=\"wrap\"\n gap={10}\n style={resolvedStyles.itemsContainer || undefined}\n >\n {items.map((it, index) => {\n const selected = controller.isSelected(it);\n\n return (\n <RadioButton<T>\n key={String(it.value)}\n item={it}\n selected={selected}\n disabled={disabled}\n isInvalid={invalid}\n slotStyles={itemSlotStyles}\n onToggle={() => {\n lastToggledIndex.current = index;\n controller.onChange(it);\n }}\n />\n );\n })}\n </Flex>\n\n </KitsContainer>\n );\n};\n\nexport default KitsRadio;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AASA,MAAM,YAAY,CAAM;AAAA,EACI,GAAA;AAAA,EACA,GAAG;AACP,CAAA,KAA0B;AAG9C,EAAA,MAAM,EAAC,WAAA,EAAa,KAAA,EAAO,eAAa,GAAI,oBAAA,CAAqB,SAAS,QAAQ,CAAA;AAClF,EAAA,MAAM,cAAA,GAAiB,yBAAyB,aAAa,CAAA;AAE7D,EAAA,MAAM,cAAA,GAAiB,QAAQ,OAAO;AAAA,IAClC,MAAM,aAAA,CAAc,IAAA;AAAA,IACpB,cAAc,aAAA,CAAc,YAAA;AAAA,IAC5B,cAAc,aAAA,CAAc,YAAA;AAAA,IAC5B,aAAa,aAAA,CAAc;AAAA,GAC/B,CAAA,EAAI,CAAC,aAAA,CAAc,IAAA,EAAM,aAAA,CAAc,cAAc,aAAA,CAAc,YAAA,EAAc,aAAA,CAAc,WAAW,CAAC,CAAA;AAC3G,EAAA,MAAM;AAAA,IACF,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,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A;AAAA,UACf,QAAA,EAAS,MAAA;AAAA,UACT,GAAA,EAAK,EAAA;AAAA,UACL,KAAA,EAAO,eAAe,cAAA,IAAkB,MAAA;AAAA,UAEvC,QAAA,EAAA,KAAA,CAAM,GAAA,CAAI,CAAC,EAAA,EAAI,KAAA,KAAU;AACtB,YAAA,MAAM,QAAA,GAAW,UAAA,CAAW,UAAA,CAAW,EAAE,CAAA;AAEzC,YAAA,uBACI,GAAA;AAAA,cAAC,WAAA;AAAA,cAAA;AAAA,gBAEG,IAAA,EAAM,EAAA;AAAA,gBACN,QAAA;AAAA,gBACA,QAAA;AAAA,gBACA,SAAA,EAAW,OAAA;AAAA,gBACX,UAAA,EAAY,cAAA;AAAA,gBACZ,UAAU,MAAM;AACZ,kBAAA,gBAAA,CAAiB,OAAA,GAAU,KAAA;AAC3B,kBAAA,UAAA,CAAW,SAAS,EAAE,CAAA;AAAA,gBAC1B;AAAA,eAAA;AAAA,cATK,MAAA,CAAO,GAAG,KAAK;AAAA,aAUxB;AAAA,UAER,CAAC;AAAA;AAAA;AACL;AAAA,GAEJ;AAER;;;;"}
|
|
@@ -86,6 +86,7 @@ require('../../../apps/mobile/src/Core/Input/Slot.cjs');
|
|
|
86
86
|
var useSelectionController = require('../../../hooks/useSelectionController.cjs');
|
|
87
87
|
require('../../../contexts/DialogContext.cjs');
|
|
88
88
|
require('../../../contexts/PermissionsContext.cjs');
|
|
89
|
+
require('../../../contexts/BreadcrumbContext.cjs');
|
|
89
90
|
|
|
90
91
|
const TriStateCheckbox = (props) => {
|
|
91
92
|
const { value, onChange } = useSelectionController.default({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/controls/TriStateCheckbox/index.native.tsx"],"sourcesContent":["import {TriStateCheckbox as TriStateCheckboxMobile, type TriStateCheckboxProps} from \"@lmb-it/kitsconcertomobile\";\nimport {useSelectionController} from \"../../../hooks\";\n\nexport const TriStateCheckbox = (props:TriStateCheckboxProps)=>{\n const { value, onChange } = useSelectionController({\n mode: 'tristate',\n defaultValue: false // Start at false\n });\n\n return <TriStateCheckboxMobile value={value} onChange={()=>onChange()} {...props} />\n}\n"],"names":["useSelectionController","jsx","TriStateCheckboxMobile"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/form/controls/TriStateCheckbox/index.native.tsx"],"sourcesContent":["import {TriStateCheckbox as TriStateCheckboxMobile, type TriStateCheckboxProps} from \"@lmb-it/kitsconcertomobile\";\nimport {useSelectionController} from \"../../../hooks\";\n\nexport const TriStateCheckbox = (props:TriStateCheckboxProps)=>{\n const { value, onChange } = useSelectionController({\n mode: 'tristate',\n defaultValue: false // Start at false\n });\n\n return <TriStateCheckboxMobile value={value} onChange={()=>onChange()} {...props} />\n}\n"],"names":["useSelectionController","jsx","TriStateCheckboxMobile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,gBAAA,GAAmB,CAAC,KAAA,KAA8B;AAC3D,EAAA,MAAM,EAAE,KAAA,EAAO,QAAA,EAAS,GAAIA,8BAAA,CAAuB;AAAA,IAC/C,IAAA,EAAM,UAAA;AAAA,IACN,YAAA,EAAc;AAAA;AAAA,GACjB,CAAA;AAED,EAAA,uBAAOC,cAAA,CAACC,0BAAuB,KAAA,EAAc,QAAA,EAAU,MAAI,QAAA,EAAS,EAAI,GAAG,KAAA,EAAO,CAAA;AACtF;;;;"}
|
|
@@ -84,6 +84,7 @@ import '../../../apps/mobile/src/Core/Input/Slot.js';
|
|
|
84
84
|
import useSelectionController from '../../../hooks/useSelectionController.js';
|
|
85
85
|
import '../../../contexts/DialogContext.js';
|
|
86
86
|
import '../../../contexts/PermissionsContext.js';
|
|
87
|
+
import '../../../contexts/BreadcrumbContext.js';
|
|
87
88
|
|
|
88
89
|
const TriStateCheckbox = (props) => {
|
|
89
90
|
const { value, onChange } = useSelectionController({
|