@ankhorage/surface 4.2.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +4 -4
- package/dist/components/tabs/Tabs.js +2 -2
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/context.js +1 -1
- package/dist/components/tabs/context.js.map +1 -1
- package/dist/context/FontContext.d.ts.map +1 -1
- package/dist/context/FontContext.js +3 -3
- package/dist/context/FontContext.js.map +1 -1
- package/dist/context/TranslationContext.d.ts.map +1 -1
- package/dist/context/TranslationContext.js +3 -4
- package/dist/context/TranslationContext.js.map +1 -1
- package/dist/core/responsive/ResponsiveProvider.d.ts.map +1 -1
- package/dist/core/responsive/ResponsiveProvider.js +3 -3
- package/dist/core/responsive/ResponsiveProvider.js.map +1 -1
- package/dist/examples/DocsExamples.js +1 -1
- package/dist/examples/DocsExamples.js.map +1 -1
- package/dist/features/accordion/adapters/inbound/Accordion.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/Accordion.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/Accordion.js +46 -0
- package/dist/features/accordion/adapters/inbound/Accordion.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.js +16 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.d.ts +4 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.js +3 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.js +28 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.d.ts +4 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.js +3 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.js +17 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.js.map +1 -0
- package/dist/features/accordion/public.d.ts +6 -0
- package/dist/features/accordion/public.d.ts.map +1 -0
- package/dist/features/accordion/public.js +5 -0
- package/dist/features/accordion/public.js.map +1 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.d.ts +11 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.d.ts.map +1 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.js +13 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.js.map +1 -0
- package/dist/features/bottom-sheet/BottomSheetProvider.js +2 -2
- package/dist/features/bottom-sheet/BottomSheetProvider.js.map +1 -1
- package/dist/features/bottom-sheet/useBottomSheet.js +1 -1
- package/dist/features/bottom-sheet/useBottomSheet.js.map +1 -1
- package/dist/features/popover/adapters/inbound/Popover.d.ts +5 -0
- package/dist/features/popover/adapters/inbound/Popover.d.ts.map +1 -0
- package/dist/features/popover/adapters/inbound/Popover.js +31 -0
- package/dist/features/popover/adapters/inbound/Popover.js.map +1 -0
- package/dist/features/popover/adapters/inbound/PopoverOverlay.d.ts +17 -0
- package/dist/features/popover/adapters/inbound/PopoverOverlay.d.ts.map +1 -0
- package/dist/features/popover/adapters/inbound/PopoverOverlay.js +34 -0
- package/dist/features/popover/adapters/inbound/PopoverOverlay.js.map +1 -0
- package/dist/features/popover/adapters/inbound/usePopoverLayout.d.ts +21 -0
- package/dist/features/popover/adapters/inbound/usePopoverLayout.d.ts.map +1 -0
- package/dist/features/popover/adapters/inbound/usePopoverLayout.js +33 -0
- package/dist/features/popover/adapters/inbound/usePopoverLayout.js.map +1 -0
- package/dist/features/popover/public.d.ts +3 -0
- package/dist/features/popover/public.d.ts.map +1 -0
- package/dist/features/popover/public.js +2 -0
- package/dist/features/popover/public.js.map +1 -0
- package/dist/features/popover/utils/resolvePopoverPosition.d.ts +25 -0
- package/dist/features/popover/utils/resolvePopoverPosition.d.ts.map +1 -0
- package/dist/features/popover/utils/resolvePopoverPosition.js +23 -0
- package/dist/features/popover/utils/resolvePopoverPosition.js.map +1 -0
- package/dist/{components/toast → features/toast/adapters/inbound}/Toast.d.ts +2 -1
- package/dist/features/toast/adapters/inbound/Toast.d.ts.map +1 -0
- package/dist/{components/toast → features/toast/adapters/inbound}/Toast.js +37 -32
- package/dist/features/toast/adapters/inbound/Toast.js.map +1 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.d.ts +5 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.d.ts.map +1 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.js +29 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.js.map +1 -0
- package/dist/features/toast/adapters/inbound/useToast.d.ts +4 -0
- package/dist/features/toast/adapters/inbound/useToast.d.ts.map +1 -0
- package/dist/features/toast/adapters/inbound/useToast.js +11 -0
- package/dist/features/toast/adapters/inbound/useToast.js.map +1 -0
- package/dist/features/toast/composition/ToastContext.d.ts +4 -0
- package/dist/features/toast/composition/ToastContext.d.ts.map +1 -0
- package/dist/features/toast/composition/ToastContext.js +4 -0
- package/dist/features/toast/composition/ToastContext.js.map +1 -0
- package/dist/features/toast/composition/useToastRuntime.d.ts +11 -0
- package/dist/features/toast/composition/useToastRuntime.d.ts.map +1 -0
- package/dist/features/toast/composition/useToastRuntime.js +50 -0
- package/dist/features/toast/composition/useToastRuntime.js.map +1 -0
- package/dist/features/toast/public.d.ts +5 -0
- package/dist/features/toast/public.d.ts.map +1 -0
- package/dist/features/toast/public.js +4 -0
- package/dist/features/toast/public.js.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/overlay/OverlayProvider.d.ts +1 -0
- package/dist/internal/overlay/OverlayProvider.d.ts.map +1 -1
- package/dist/internal/overlay/OverlayProvider.js +9 -7
- package/dist/internal/overlay/OverlayProvider.js.map +1 -1
- package/dist/internal/overlay/useOverlayStack.js +1 -1
- package/dist/internal/overlay/useOverlayStack.js.map +1 -1
- package/dist/internal/resolvers/resolveOverlayZIndex.d.ts +1 -1
- package/dist/internal/resolvers/resolveOverlayZIndex.d.ts.map +1 -1
- package/dist/internal/resolvers/resolveOverlayZIndex.js +1 -0
- package/dist/internal/resolvers/resolveOverlayZIndex.js.map +1 -1
- package/dist/layout/AppBar.js +1 -1
- package/dist/layout/AppBar.js.map +1 -1
- package/dist/theme/ThemeContext.d.ts.map +1 -1
- package/dist/theme/ThemeContext.js +4 -5
- package/dist/theme/ThemeContext.js.map +1 -1
- package/dist/types/accordion.d.ts +54 -0
- package/dist/types/accordion.d.ts.map +1 -0
- package/dist/types/accordion.js +2 -0
- package/dist/types/accordion.js.map +1 -0
- package/dist/types/popover.d.ts +21 -0
- package/dist/types/popover.d.ts.map +1 -0
- package/dist/types/popover.js +2 -0
- package/dist/types/popover.js.map +1 -0
- package/dist/{components/toast/types.d.ts → types/toast.d.ts} +11 -3
- package/dist/types/toast.d.ts.map +1 -0
- package/dist/types/toast.js +2 -0
- package/dist/types/toast.js.map +1 -0
- package/package.json +1 -1
- package/src/components/tabs/Tabs.tsx +2 -2
- package/src/components/tabs/context.tsx +1 -1
- package/src/context/FontContext.tsx +3 -3
- package/src/context/TranslationContext.tsx +3 -4
- package/src/core/responsive/ResponsiveProvider.tsx +3 -3
- package/src/examples/DocsExamples.tsx +1 -1
- package/src/features/accordion/adapters/inbound/Accordion.tsx +83 -0
- package/src/features/accordion/adapters/inbound/AccordionContent.tsx +30 -0
- package/src/features/accordion/adapters/inbound/AccordionContext.ts +5 -0
- package/src/features/accordion/adapters/inbound/AccordionItem.tsx +42 -0
- package/src/features/accordion/adapters/inbound/AccordionItemContext.ts +5 -0
- package/src/features/accordion/adapters/inbound/AccordionTrigger.tsx +34 -0
- package/src/features/accordion/public.ts +13 -0
- package/src/features/accordion/utils/resolveAccordionToggle.test.ts +57 -0
- package/src/features/accordion/utils/resolveAccordionToggle.ts +28 -0
- package/src/features/bottom-sheet/BottomSheetProvider.tsx +2 -2
- package/src/features/bottom-sheet/useBottomSheet.ts +1 -1
- package/src/features/popover/adapters/inbound/Popover.tsx +49 -0
- package/src/features/popover/adapters/inbound/PopoverOverlay.tsx +72 -0
- package/src/features/popover/adapters/inbound/usePopoverLayout.ts +51 -0
- package/src/features/popover/public.ts +2 -0
- package/src/features/popover/utils/resolvePopoverPosition.test.ts +31 -0
- package/src/features/popover/utils/resolvePopoverPosition.ts +40 -0
- package/src/{components/toast → features/toast/adapters/inbound}/Toast.tsx +58 -54
- package/src/features/toast/adapters/inbound/ToastProvider.tsx +47 -0
- package/src/features/toast/adapters/inbound/useToast.test.tsx +18 -0
- package/src/features/toast/adapters/inbound/useToast.ts +15 -0
- package/src/features/toast/composition/ToastContext.ts +6 -0
- package/src/features/toast/composition/useToastRuntime.ts +76 -0
- package/src/features/toast/public.ts +10 -0
- package/src/index.test.ts +3 -1
- package/src/index.ts +29 -2
- package/src/internal/overlay/OverlayProvider.tsx +10 -8
- package/src/internal/overlay/useOverlayStack.ts +1 -1
- package/src/internal/resolvers/resolveOverlayZIndex.test.ts +2 -1
- package/src/internal/resolvers/resolveOverlayZIndex.ts +2 -1
- package/src/layout/AppBar.tsx +1 -1
- package/src/theme/ThemeContext.tsx +4 -5
- package/src/types/accordion.ts +69 -0
- package/src/types/popover.ts +25 -0
- package/src/{components/toast/types.ts → types/toast.ts} +12 -2
- package/dist/components/toast/Toast.d.ts.map +0 -1
- package/dist/components/toast/Toast.js.map +0 -1
- package/dist/components/toast/ToastProvider.d.ts +0 -13
- package/dist/components/toast/ToastProvider.d.ts.map +0 -1
- package/dist/components/toast/ToastProvider.js +0 -70
- package/dist/components/toast/ToastProvider.js.map +0 -1
- package/dist/components/toast/index.d.ts +0 -4
- package/dist/components/toast/index.d.ts.map +0 -1
- package/dist/components/toast/index.js +0 -3
- package/dist/components/toast/index.js.map +0 -1
- package/dist/components/toast/types.d.ts.map +0 -1
- package/dist/components/toast/types.js +0 -2
- package/dist/components/toast/types.js.map +0 -1
- package/src/components/toast/ToastProvider.tsx +0 -115
- package/src/components/toast/index.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/surface
|
|
2
2
|
|
|
3
|
+
## 4.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ee44bc6: Add a feature-owned toast runtime and anchored popover foundation, and modernize Surface-owned React contexts to the React 19 context API.
|
|
8
|
+
|
|
9
|
+
## 4.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 00ffbe0: Add a feature-owned accordion foundation with single/multiple state, controlled and uncontrolled values, accessible trigger/content semantics, and passive interaction support.
|
|
14
|
+
|
|
3
15
|
## 4.2.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/surface
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Cross-platform UI foundation for React Native and React Native Web. Provides theming, layout primitives, and core building blocks for modern apps.
|
|
9
9
|
|
|
@@ -15,21 +15,21 @@ Cross-platform UI foundation for React Native and React Native Web. Provides the
|
|
|
15
15
|
- [Architecture overview](././paradox/diagrams/architecture-overview.mmd)
|
|
16
16
|
- [Module relationships](././paradox/diagrams/module-relationships.mmd)
|
|
17
17
|
- [Export graph](././paradox/diagrams/export-graph.mmd)
|
|
18
|
+
- [Accordion sequence](././paradox/diagrams/sequences/accordion.mmd)
|
|
18
19
|
- [AppBar sequence](././paradox/diagrams/sequences/app-bar.mmd)
|
|
19
20
|
- [Badge sequence](././paradox/diagrams/sequences/badge.mmd)
|
|
20
21
|
- [Button sequence](././paradox/diagrams/sequences/button.mmd)
|
|
21
22
|
- [Card sequence](././paradox/diagrams/sequences/card.mmd)
|
|
22
23
|
- [Checkbox sequence](././paradox/diagrams/sequences/checkbox.mmd)
|
|
23
|
-
- [Container sequence](././paradox/diagrams/sequences/container.mmd)
|
|
24
24
|
- [Field sequence](././paradox/diagrams/sequences/field.mmd)
|
|
25
25
|
- [FontProvider sequence](././paradox/diagrams/sequences/font-provider.mmd)
|
|
26
|
-
- [Grid sequence](././paradox/diagrams/sequences/grid.mmd)
|
|
27
26
|
- [Icon sequence](././paradox/diagrams/sequences/icon.mmd)
|
|
28
27
|
- [IconButton sequence](././paradox/diagrams/sequences/icon-button.mmd)
|
|
29
28
|
- [isDeepEqual sequence](././paradox/diagrams/sequences/is-deep-equal.mmd)
|
|
30
29
|
- [ListItem sequence](././paradox/diagrams/sequences/list-item.mmd)
|
|
31
30
|
- [Menu sequence](././paradox/diagrams/sequences/menu.mmd)
|
|
32
31
|
- [Modal sequence](././paradox/diagrams/sequences/modal.mmd)
|
|
32
|
+
- [Popover sequence](././paradox/diagrams/sequences/popover.mmd)
|
|
33
33
|
- [Radio sequence](././paradox/diagrams/sequences/radio.mmd)
|
|
34
34
|
- [resolveResponsive sequence](././paradox/diagrams/sequences/resolve-responsive.mmd)
|
|
35
35
|
- [ResponsiveProvider sequence](././paradox/diagrams/sequences/responsive-provider.mmd)
|
|
@@ -40,7 +40,6 @@ Cross-platform UI foundation for React Native and React Native Web. Provides the
|
|
|
40
40
|
- [TabList sequence](././paradox/diagrams/sequences/tab-list.mmd)
|
|
41
41
|
- [TabPanel sequence](././paradox/diagrams/sequences/tab-panel.mmd)
|
|
42
42
|
- [Tabs sequence](././paradox/diagrams/sequences/tabs.mmd)
|
|
43
|
-
- [Template sequence](././paradox/diagrams/sequences/template.mmd)
|
|
44
43
|
- [ThemeProvider sequence](././paradox/diagrams/sequences/theme-provider.mmd)
|
|
45
44
|
- [Toast sequence](././paradox/diagrams/sequences/toast.mmd)
|
|
46
45
|
- [ToastProvider sequence](././paradox/diagrams/sequences/toast-provider.mmd)
|
|
@@ -51,4 +50,5 @@ Cross-platform UI foundation for React Native and React Native Web. Provides the
|
|
|
51
50
|
- [useTheme sequence](././paradox/diagrams/sequences/use-theme.mmd)
|
|
52
51
|
- [useThemeConfig sequence](././paradox/diagrams/sequences/use-theme-config.mmd)
|
|
53
52
|
- [useThemeMode sequence](././paradox/diagrams/sequences/use-theme-mode.mmd)
|
|
53
|
+
- [useToast sequence](././paradox/diagrams/sequences/use-toast.mmd)
|
|
54
54
|
- [useTranslationContext sequence](././paradox/diagrams/sequences/use-translation-context.mmd)
|
|
@@ -47,8 +47,8 @@ export function Tabs({ children, value, defaultValue, onValueChange, testID }) {
|
|
|
47
47
|
tabs,
|
|
48
48
|
unregisterTab,
|
|
49
49
|
}), [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab]);
|
|
50
|
-
return (<TabsContext
|
|
50
|
+
return (<TabsContext value={contextValue}>
|
|
51
51
|
<Box testID={testID}>{children}</Box>
|
|
52
|
-
</TabsContext
|
|
52
|
+
</TabsContext>);
|
|
53
53
|
}
|
|
54
54
|
//# sourceMappingURL=Tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC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ACd,CAAC,EACF,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,CACtF,CAAC;IAEF,OAAO,CACL,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAC/B;MAAA,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CACtC;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { Box } from '../../features/layout/public';\nimport { useControllableState } from '../../internal/useControllableState';\nimport { getTabId as resolveTabId, getTabPanelId as resolveTabPanelId } from './a11y';\nimport { type TabRegistration, TabsContext } from './context';\nimport type { TabsProps } from './types';\n\nexport function Tabs({ children, value, defaultValue, onValueChange, testID }: TabsProps) {\n const [activeValue, setActiveValue] = useControllableState<string | undefined>({\n value,\n defaultValue,\n onChange: (nextValue) => {\n if (nextValue !== undefined) {\n onValueChange?.(nextValue);\n }\n },\n });\n const [focusedValue, setFocusedValue] = React.useState<string | undefined>(undefined);\n const [tabs, setTabs] = React.useState<TabRegistration[]>([]);\n\n const registerTab = React.useCallback((tab: TabRegistration) => {\n setTabs((current) => {\n return current.some((entry) => entry.value === tab.value)\n ? current.map((entry) => (entry.value === tab.value ? tab : entry))\n : [...current, tab];\n });\n }, []);\n\n const unregisterTab = React.useCallback((valueToRemove: string) => {\n setTabs((current) => current.filter((entry) => entry.value !== valueToRemove));\n }, []);\n\n React.useEffect(() => {\n if (activeValue !== undefined) {\n return;\n }\n\n const firstEnabledTab = tabs.find((entry) => !entry.disabled);\n if (firstEnabledTab) {\n setActiveValue(firstEnabledTab.value);\n }\n }, [activeValue, setActiveValue, tabs]);\n\n const contextValue = React.useMemo(\n () => ({\n activeValue,\n focusedValue,\n getPanelId: (tabValue: string) => resolveTabPanelId(testID, tabValue),\n getTabId: (tabValue: string) => resolveTabId(testID, tabValue),\n registerTab,\n setActiveValue: (nextValue: string) => {\n setActiveValue(nextValue);\n },\n setFocusedValue,\n tabs,\n unregisterTab,\n }),\n [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab],\n );\n\n return (\n <TabsContext value={contextValue}>\n <Box testID={testID}>{children}</Box>\n </TabsContext>\n );\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export const TabsContext = React.createContext(null);
|
|
3
3
|
export function useTabsContext() {
|
|
4
|
-
const value = React.
|
|
4
|
+
const value = React.use(TabsContext);
|
|
5
5
|
if (!value) {
|
|
6
6
|
throw new Error('Tabs components must be used within <Tabs>.');
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/tabs/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAA0B,IAAI,CAAC,CAAC;AAE9E,MAAM,UAAU,cAAc;IAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/tabs/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAA0B,IAAI,CAAC,CAAC;AAE9E,MAAM,UAAU,cAAc;IAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAErC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import React from 'react';\n\nexport interface TabRegistration {\n disabled: boolean;\n focus: () => void;\n value: string;\n}\n\nexport interface TabsContextValue {\n activeValue: string | undefined;\n focusedValue: string | undefined;\n getPanelId: (value: string) => string;\n getTabId: (value: string) => string;\n registerTab: (tab: TabRegistration) => void;\n setActiveValue: (value: string) => void;\n setFocusedValue: (value: string | undefined) => void;\n tabs: TabRegistration[];\n unregisterTab: (value: string) => void;\n}\n\nexport const TabsContext = React.createContext<TabsContextValue | null>(null);\n\nexport function useTabsContext(): TabsContextValue {\n const value = React.use(TabsContext);\n\n if (!value) {\n throw new Error('Tabs components must be used within <Tabs>.');\n }\n\n return value;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FontContext.d.ts","sourceRoot":"","sources":["../../src/context/FontContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FontContext.d.ts","sourceRoot":"","sources":["../../src/context/FontContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6DAA6D;IAC7D,WAAW,EAAE,OAAO,CAAC;IAErB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,uCAAuC;IACvC,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAYD,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,qBAuBA;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext,
|
|
1
|
+
import React, { createContext, use, useMemo, useState } from 'react';
|
|
2
2
|
const fallbackRuntime = {
|
|
3
3
|
fontsLoaded: true,
|
|
4
4
|
activeFontId: null,
|
|
@@ -19,9 +19,9 @@ export function FontProvider(props) {
|
|
|
19
19
|
onActiveFontChange(id);
|
|
20
20
|
},
|
|
21
21
|
}), [fontsLoaded, activeFontId, onActiveFontChange]);
|
|
22
|
-
return <FontContext
|
|
22
|
+
return <FontContext value={value}>{children}</FontContext>;
|
|
23
23
|
}
|
|
24
24
|
export function useFontContext() {
|
|
25
|
-
return
|
|
25
|
+
return use(FontContext);
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=FontContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FontContext.js","sourceRoot":"","sources":["../../src/context/FontContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"FontContext.js","sourceRoot":"","sources":["../../src/context/FontContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAgBrE,MAAM,eAAe,GAAgB;IACnC,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,GAAG,EAAE;QACpB,cAAc;IAChB,CAAC;CACF,CAAC;AAEF,MAAM,WAAW,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAEnD,MAAM,UAAU,YAAY,CAAC,KAK5B;IACC,MAAM,EACJ,WAAW,EACX,YAAY,EAAE,mBAAmB,GAAG,IAAI,EACxC,QAAQ,EACR,kBAAkB,GACnB,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,YAAY,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IAE3E,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,WAAW;QACX,YAAY;QACZ,eAAe,EAAE,CAAC,EAAU,EAAE,EAAE;YAC9B,oBAAoB,CAAC,EAAE,CAAC,CAAC;YACzB,IAAI,kBAAkB;gBAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC;KACF,CAAC,EACF,CAAC,WAAW,EAAE,YAAY,EAAE,kBAAkB,CAAC,CAChD,CAAC;IAEF,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["import React, { createContext, use, useMemo, useState } from 'react';\n\n/**\n * Runtime font state consumed by theme and text primitives.\n */\nexport interface FontRuntime {\n /** true when the active font assets have finished loading */\n fontsLoaded: boolean;\n\n /** The currently active font family id */\n activeFontId: string | null;\n\n /** Update the active font family id */\n setActiveFontId: (id: string) => void;\n}\n\nconst fallbackRuntime: FontRuntime = {\n fontsLoaded: true,\n activeFontId: null,\n setActiveFontId: () => {\n /* fallback */\n },\n};\n\nconst FontContext = createContext(fallbackRuntime);\n\nexport function FontProvider(props: {\n fontsLoaded: boolean;\n activeFontId?: string | null;\n children: React.ReactNode;\n onActiveFontChange?: (id: string) => void;\n}) {\n const {\n fontsLoaded,\n activeFontId: initialActiveFontId = null,\n children,\n onActiveFontChange,\n } = props;\n\n const [activeFontId, setActiveFontIdState] = useState(initialActiveFontId);\n\n const value = useMemo<FontRuntime>(\n () => ({\n fontsLoaded,\n activeFontId,\n setActiveFontId: (id: string) => {\n setActiveFontIdState(id);\n if (onActiveFontChange) onActiveFontChange(id);\n },\n }),\n [fontsLoaded, activeFontId, onActiveFontChange],\n );\n\n return <FontContext value={value}>{children}</FontContext>;\n}\n\nexport function useFontContext(): FontRuntime {\n return use(FontContext);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationContext.d.ts","sourceRoot":"","sources":["../../src/context/TranslationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TranslationContext.d.ts","sourceRoot":"","sources":["../../src/context/TranslationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,CAAC,EAAE,UAAU,CAAC;CAChB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;AAEpF,MAAM,WAAW,kBAAkB;IACjC,CAAC,EAAE,UAAU,CAAC;IACd,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CAC3B;AASD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,CAAC,EAAE,UAAU,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAeA;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,CAE1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext,
|
|
1
|
+
import React, { createContext, use } from 'react';
|
|
2
2
|
const fallbackRuntime = {
|
|
3
3
|
t: (key) => key,
|
|
4
4
|
i18n: null,
|
|
@@ -10,7 +10,6 @@ export function TranslationProvider(props) {
|
|
|
10
10
|
t: (key, options) => {
|
|
11
11
|
if (i18n?.t) {
|
|
12
12
|
const result = i18n.t(key, options);
|
|
13
|
-
// If translation returns the key, it's missing in the current dictionary
|
|
14
13
|
if (result !== key)
|
|
15
14
|
return result;
|
|
16
15
|
}
|
|
@@ -18,9 +17,9 @@ export function TranslationProvider(props) {
|
|
|
18
17
|
},
|
|
19
18
|
i18n: i18n ?? null,
|
|
20
19
|
};
|
|
21
|
-
return <TranslationContext
|
|
20
|
+
return <TranslationContext value={value}>{children}</TranslationContext>;
|
|
22
21
|
}
|
|
23
22
|
export function useTranslationContext() {
|
|
24
|
-
return
|
|
23
|
+
return use(TranslationContext);
|
|
25
24
|
}
|
|
26
25
|
//# sourceMappingURL=TranslationContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationContext.js","sourceRoot":"","sources":["../../src/context/TranslationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"TranslationContext.js","sourceRoot":"","sources":["../../src/context/TranslationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAmBlD,MAAM,eAAe,GAAuB;IAC1C,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG;IACf,IAAI,EAAE,IAAI;CACX,CAAC;AAEF,MAAM,kBAAkB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAE1D,MAAM,UAAU,mBAAmB,CAAC,KAInC;IACC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEpC,MAAM,KAAK,GAAuB;QAChC,CAAC,EAAE,CAAC,GAAW,EAAE,OAAiC,EAAE,EAAE;YACpD,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC;gBACZ,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBACpC,IAAI,MAAM,KAAK,GAAG;oBAAE,OAAO,MAAM,CAAC;YACpC,CAAC;YACD,OAAO,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACzB,CAAC;QACD,IAAI,EAAE,IAAI,IAAI,IAAI;KACnB,CAAC;IAEF,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,GAAG,CAAC,kBAAkB,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import React, { createContext, use } from 'react';\n\n/**\n * Minimal translation runtime surface.\n * Do not import i18next types here; keep Surface runtime-agnostic.\n */\nexport interface I18nInstance {\n changeLanguage: (lng: string) => Promise<unknown>;\n language?: string;\n t?: Translator;\n}\n\nexport type Translator = (key: string, options?: Record<string, unknown>) => string;\n\nexport interface TranslationRuntime {\n t: Translator;\n i18n: I18nInstance | null;\n}\n\nconst fallbackRuntime: TranslationRuntime = {\n t: (key) => key,\n i18n: null,\n};\n\nconst TranslationContext = createContext(fallbackRuntime);\n\nexport function TranslationProvider(props: {\n t: Translator;\n i18n?: I18nInstance | null;\n children: React.ReactNode;\n}) {\n const { t, i18n, children } = props;\n\n const value: TranslationRuntime = {\n t: (key: string, options?: Record<string, unknown>) => {\n if (i18n?.t) {\n const result = i18n.t(key, options);\n if (result !== key) return result;\n }\n return t(key, options);\n },\n i18n: i18n ?? null,\n };\n\n return <TranslationContext value={value}>{children}</TranslationContext>;\n}\n\nexport function useTranslationContext(): TranslationRuntime {\n return use(TranslationContext);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveProvider.d.ts","sourceRoot":"","sources":["../../../src/core/responsive/ResponsiveProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ResponsiveProvider.d.ts","sourceRoot":"","sources":["../../../src/core/responsive/ResponsiveProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAY7E;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,CAQxD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext,
|
|
1
|
+
import React, { createContext, use, useMemo } from 'react';
|
|
2
2
|
import { useWindowDimensions } from 'react-native';
|
|
3
3
|
import { getBreakpointFromWidth } from './getBreakpointFromWidth';
|
|
4
4
|
const ResponsiveContext = createContext(null);
|
|
@@ -8,10 +8,10 @@ export function ResponsiveProvider({ children }) {
|
|
|
8
8
|
breakpoint: getBreakpointFromWidth(width),
|
|
9
9
|
width,
|
|
10
10
|
}), [width]);
|
|
11
|
-
return <ResponsiveContext
|
|
11
|
+
return <ResponsiveContext value={value}>{children}</ResponsiveContext>;
|
|
12
12
|
}
|
|
13
13
|
export function useResponsiveRuntime() {
|
|
14
|
-
const runtime =
|
|
14
|
+
const runtime = use(ResponsiveContext);
|
|
15
15
|
if (!runtime) {
|
|
16
16
|
throw new Error('useResponsiveRuntime must be used within a ResponsiveProvider');
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsiveProvider.js","sourceRoot":"","sources":["../../../src/core/responsive/ResponsiveProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"ResponsiveProvider.js","sourceRoot":"","sources":["../../../src/core/responsive/ResponsiveProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,MAAM,iBAAiB,GAAG,aAAa,CAA2B,IAAI,CAAC,CAAC;AAExE,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAiC;IAC5E,MAAM,EAAE,KAAK,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAExC,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC;QACL,UAAU,EAAE,sBAAsB,CAAC,KAAK,CAAC;QACzC,KAAK;KACN,CAAC,EACF,CAAC,KAAK,CAAC,CACR,CAAC;IAEF,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,MAAM,OAAO,GAAG,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAEvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import React, { createContext, use, useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\n\nimport { getBreakpointFromWidth } from './getBreakpointFromWidth';\nimport type { ResponsiveRuntime } from './types';\n\nconst ResponsiveContext = createContext<ResponsiveRuntime | null>(null);\n\nexport function ResponsiveProvider({ children }: { children: React.ReactNode }) {\n const { width } = useWindowDimensions();\n\n const value = useMemo<ResponsiveRuntime>(\n () => ({\n breakpoint: getBreakpointFromWidth(width),\n width,\n }),\n [width],\n );\n\n return <ResponsiveContext value={value}>{children}</ResponsiveContext>;\n}\n\nexport function useResponsiveRuntime(): ResponsiveRuntime {\n const runtime = use(ResponsiveContext);\n\n if (!runtime) {\n throw new Error('useResponsiveRuntime must be used within a ResponsiveProvider');\n }\n\n return runtime;\n}\n"]}
|
|
@@ -4,13 +4,13 @@ import { HelperText } from '../components/helper-text';
|
|
|
4
4
|
import { Menu } from '../components/menu';
|
|
5
5
|
import { Modal } from '../components/modal';
|
|
6
6
|
import { Tab, TabList, TabPanel, Tabs } from '../components/tabs';
|
|
7
|
-
import { ToastProvider, useToast } from '../components/toast';
|
|
8
7
|
import { Tooltip } from '../components/tooltip';
|
|
9
8
|
import { Button } from '../features/button/public';
|
|
10
9
|
import { Card } from '../features/card/public';
|
|
11
10
|
import { Checkbox } from '../features/form/checkbox/public';
|
|
12
11
|
import { TextInput } from '../features/form/text-input/public';
|
|
13
12
|
import { Box, Stack } from '../features/layout/public';
|
|
13
|
+
import { ToastProvider, useToast } from '../features/toast/public';
|
|
14
14
|
import { Text } from '../features/typography/public';
|
|
15
15
|
import { ThemeProvider } from '../theme';
|
|
16
16
|
const docsThemeConfig = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocsExamples.js","sourceRoot":"","sources":["../../src/examples/DocsExamples.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DocsExamples.js","sourceRoot":"","sources":["../../src/examples/DocsExamples.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB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,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;YAC7B,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;SACpD,CAAC,CACF,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,EAElC;QAAA,CAAC,GAAG,CACF;UAAA,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,kCAAkC,EAAE,IAAI,CAChE;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { Field } from '../components/field';\nimport { HelperText } from '../components/helper-text';\nimport { Menu } from '../components/menu';\nimport { Modal } from '../components/modal';\nimport { Tab, TabList, TabPanel, Tabs } from '../components/tabs';\nimport { Tooltip } from '../components/tooltip';\nimport { Button } from '../features/button/public';\nimport { Card } from '../features/card/public';\nimport { Checkbox } from '../features/form/checkbox/public';\nimport { TextInput } from '../features/form/text-input/public';\nimport { Box, Stack } from '../features/layout/public';\nimport { ToastProvider, useToast } from '../features/toast/public';\nimport { Text } from '../features/typography/public';\nimport { ThemeProvider } from '../theme';\nimport type { ThemeConfig } from '../theme/types';\n\nconst docsThemeConfig: ThemeConfig = {\n id: 'docs',\n name: 'Docs',\n light: { primaryColor: '#2563EB', harmony: 'analogous' },\n dark: { primaryColor: '#60A5FA', harmony: 'analogous' },\n};\n\nexport function FormExample() {\n return (\n <ThemeProvider initialConfig={docsThemeConfig}>\n <Stack gap=\"m\" p=\"l\">\n <Field helperText=\"Use your work email.\" label=\"Email\" required>\n <TextInput placeholder=\"you@example.com\" />\n </Field>\n <Checkbox checked>Accept terms</Checkbox>\n <HelperText emphasis=\"muted\">Looks good.</HelperText>\n </Stack>\n </ThemeProvider>\n );\n}\n\nfunction ToastButton() {\n const { showToast } = useToast();\n return (\n <Button\n onPress={() =>\n showToast({ description: 'Your changes were saved.', status: 'success', title: 'Saved' })\n }\n >\n Show toast\n </Button>\n );\n}\n\nexport function FeedbackExample() {\n return (\n <ThemeProvider initialConfig={docsThemeConfig}>\n <ToastProvider>\n <Stack gap=\"m\" p=\"l\">\n <Tooltip content=\"Helpful contextual information\">\n <Text>Hover for tooltip</Text>\n </Tooltip>\n <ToastButton />\n </Stack>\n </ToastProvider>\n </ThemeProvider>\n );\n}\n\nexport function OverlayExample() {\n const [modalVisible, setModalVisible] = React.useState(false);\n\n return (\n <ThemeProvider initialConfig={docsThemeConfig}>\n <Stack gap=\"m\" p=\"l\">\n <Button onPress={() => setModalVisible(true)}>Open modal</Button>\n <Modal onDismiss={() => setModalVisible(false)} visible={modalVisible}>\n <Card>\n <Stack gap=\"s\">\n <Text variant=\"label\" weight=\"semiBold\">\n Modal title\n </Text>\n <Text>Modal content</Text>\n </Stack>\n </Card>\n </Modal>\n </Stack>\n </ThemeProvider>\n );\n}\n\nexport function NavigationExample() {\n return (\n <ThemeProvider initialConfig={docsThemeConfig}>\n <Stack gap=\"m\" p=\"l\">\n <Tabs defaultValue=\"account\">\n <TabList>\n <Tab value=\"account\">Account</Tab>\n <Tab disabled value=\"security\">\n Security\n </Tab>\n <Tab value=\"billing\">Billing</Tab>\n </TabList>\n <TabPanel value=\"account\">\n <Text>Account settings</Text>\n </TabPanel>\n <TabPanel value=\"billing\">\n <Text>Billing settings</Text>\n </TabPanel>\n </Tabs>\n <Menu\n actions={[\n { id: 'edit', title: 'Edit' },\n { disabled: true, id: 'archive', title: 'Archive' },\n ]}\n trigger={<Text>Open menu</Text>}\n />\n <Box>\n <Text color=\"success\">Theme overrides can stay semantic.</Text>\n </Box>\n </Stack>\n </ThemeProvider>\n );\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AccordionProps } from '../../../../types/accordion';
|
|
3
|
+
/*** Coordinates controlled or uncontrolled accordion expansion state. */
|
|
4
|
+
export declare function Accordion(props: AccordionProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,6BAA6B,CAAC;AAIrC,yEAAyE;AACzE,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBA6C9C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { resolveAccordionToggle } from '../../utils/resolveAccordionToggle';
|
|
4
|
+
import { AccordionContext } from './AccordionContext';
|
|
5
|
+
/*** Coordinates controlled or uncontrolled accordion expansion state. */
|
|
6
|
+
export function Accordion(props) {
|
|
7
|
+
const { children, collapsible = false, defaultValue, disabled = false, interactionPolicy = 'enabled', onValueChange: _onValueChange, type = 'single', value, ...viewProps } = props;
|
|
8
|
+
const [uncontrolledValues, setUncontrolledValues] = React.useState(() => normalizeAccordionValues(type, defaultValue));
|
|
9
|
+
const controlled = value !== undefined;
|
|
10
|
+
const openValues = controlled ? normalizeAccordionValues(type, value) : uncontrolledValues;
|
|
11
|
+
const toggleValue = React.useCallback((itemValue) => {
|
|
12
|
+
if (disabled || interactionPolicy === 'passive')
|
|
13
|
+
return;
|
|
14
|
+
const nextValues = resolveAccordionToggle({
|
|
15
|
+
collapsible,
|
|
16
|
+
mode: type,
|
|
17
|
+
openValues,
|
|
18
|
+
value: itemValue,
|
|
19
|
+
});
|
|
20
|
+
if (!controlled)
|
|
21
|
+
setUncontrolledValues(nextValues);
|
|
22
|
+
notifyValueChange(props, nextValues);
|
|
23
|
+
}, [collapsible, controlled, disabled, interactionPolicy, openValues, props, type]);
|
|
24
|
+
const contextValue = React.useMemo(() => ({ disabled, interactionPolicy, mode: type, openValues, toggleValue }), [disabled, interactionPolicy, openValues, toggleValue, type]);
|
|
25
|
+
return (<AccordionContext value={contextValue}>
|
|
26
|
+
<View {...viewProps}>{children}</View>
|
|
27
|
+
</AccordionContext>);
|
|
28
|
+
}
|
|
29
|
+
/*** Normalizes the public single/multiple value shapes for internal state. */
|
|
30
|
+
function normalizeAccordionValues(mode, value) {
|
|
31
|
+
if (mode === 'multiple') {
|
|
32
|
+
return typeof value === 'string' || value === undefined ? [] : value;
|
|
33
|
+
}
|
|
34
|
+
return typeof value === 'string' ? [value] : [];
|
|
35
|
+
}
|
|
36
|
+
/*** Emits the public value shape matching the configured accordion mode. */
|
|
37
|
+
function notifyValueChange(props, values) {
|
|
38
|
+
if (props.type === 'multiple') {
|
|
39
|
+
const multipleProps = props;
|
|
40
|
+
multipleProps.onValueChange?.(values);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const singleProps = props;
|
|
44
|
+
singleProps.onValueChange?.(values[0]);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=Accordion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAQpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,yEAAyE;AACzE,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EACJ,QAAQ,EACR,WAAW,GAAG,KAAK,EACnB,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,iBAAiB,GAAG,SAAS,EAC7B,aAAa,EAAE,cAAc,EAC7B,IAAI,GAAG,QAAQ,EACf,KAAK,EACL,GA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AAE,IAAI,CACvC;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,SAAS,wBAAwB,CAC/B,IAAmB,EACnB,KAA6C;IAE7C,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACvE,CAAC;IAED,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAClD,CAAC;AAED,4EAA4E;AAC5E,SAAS,iBAAiB,CAAC,KAAqB,EAAE,MAAyB;IACzE,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC9B,MAAM,aAAa,GAA2B,KAAK,CAAC;QACpD,aAAa,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAyB,KAAK,CAAC;IAChD,WAAW,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport type {\n AccordionMode,\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n} from '../../../../types/accordion';\nimport { resolveAccordionToggle } from '../../utils/resolveAccordionToggle';\nimport { AccordionContext } from './AccordionContext';\n\n/*** Coordinates controlled or uncontrolled accordion expansion state. */\nexport function Accordion(props: AccordionProps) {\n const {\n children,\n collapsible = false,\n defaultValue,\n disabled = false,\n interactionPolicy = 'enabled',\n onValueChange: _onValueChange,\n type = 'single',\n value,\n ...viewProps\n } = props;\n const [uncontrolledValues, setUncontrolledValues] = React.useState<readonly string[]>(() =>\n normalizeAccordionValues(type, defaultValue),\n );\n const controlled = value !== undefined;\n const openValues = controlled ? normalizeAccordionValues(type, value) : uncontrolledValues;\n\n const toggleValue = React.useCallback(\n (itemValue: string) => {\n if (disabled || interactionPolicy === 'passive') return;\n\n const nextValues = resolveAccordionToggle({\n collapsible,\n mode: type,\n openValues,\n value: itemValue,\n });\n\n if (!controlled) setUncontrolledValues(nextValues);\n notifyValueChange(props, nextValues);\n },\n [collapsible, controlled, disabled, interactionPolicy, openValues, props, type],\n );\n\n const contextValue = React.useMemo(\n () => ({ disabled, interactionPolicy, mode: type, openValues, toggleValue }),\n [disabled, interactionPolicy, openValues, toggleValue, type],\n );\n\n return (\n <AccordionContext value={contextValue}>\n <View {...viewProps}>{children}</View>\n </AccordionContext>\n );\n}\n\n/*** Normalizes the public single/multiple value shapes for internal state. */\nfunction normalizeAccordionValues(\n mode: AccordionMode,\n value: string | readonly string[] | undefined,\n): readonly string[] {\n if (mode === 'multiple') {\n return typeof value === 'string' || value === undefined ? [] : value;\n }\n\n return typeof value === 'string' ? [value] : [];\n}\n\n/*** Emits the public value shape matching the configured accordion mode. */\nfunction notifyValueChange(props: AccordionProps, values: readonly string[]) {\n if (props.type === 'multiple') {\n const multipleProps: AccordionMultipleProps = props;\n multipleProps.onValueChange?.(values);\n return;\n }\n\n const singleProps: AccordionSingleProps = props;\n singleProps.onValueChange?.(values[0]);\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AccordionContentProps } from '../../../../types/accordion';
|
|
3
|
+
/*** Renders an accordion item's content when expanded or force-mounted. */
|
|
4
|
+
export declare function AccordionContent({ children, forceMount, style, ...viewProps }: AccordionContentProps): React.JSX.Element | null;
|
|
5
|
+
//# sourceMappingURL=AccordionContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,UAAkB,EAClB,KAAK,EACL,GAAG,SAAS,EACb,EAAE,qBAAqB,4BAevB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { AccordionItemContext } from './AccordionItemContext';
|
|
4
|
+
/*** Renders an accordion item's content when expanded or force-mounted. */
|
|
5
|
+
export function AccordionContent({ children, forceMount = false, style, ...viewProps }) {
|
|
6
|
+
const item = React.use(AccordionItemContext);
|
|
7
|
+
if (!item)
|
|
8
|
+
throw new Error('AccordionContent must be rendered inside AccordionItem.');
|
|
9
|
+
if (!item.open && !forceMount)
|
|
10
|
+
return null;
|
|
11
|
+
return (<View {...viewProps} accessibilityLabelledBy={item.triggerId} nativeID={item.contentId} style={[!item.open ? hiddenContentStyle : undefined, style]}>
|
|
12
|
+
{children}
|
|
13
|
+
</View>);
|
|
14
|
+
}
|
|
15
|
+
const hiddenContentStyle = { display: 'none' };
|
|
16
|
+
//# sourceMappingURL=AccordionContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionContent.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,EAC/B,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,GAAG,SAAS,EACU;IACtB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC7C,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IACtF,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE3C,OAAO,CACL,CAAC,IAAI,CACH,IAAI,SAAS,CAAC,CACd,uBAAuB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CACxC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CACzB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAE5D;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,kBAAkB,GAAc,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["import React from 'react';\nimport { View, type ViewStyle } from 'react-native';\n\nimport type { AccordionContentProps } from '../../../../types/accordion';\nimport { AccordionItemContext } from './AccordionItemContext';\n\n/*** Renders an accordion item's content when expanded or force-mounted. */\nexport function AccordionContent({\n children,\n forceMount = false,\n style,\n ...viewProps\n}: AccordionContentProps) {\n const item = React.use(AccordionItemContext);\n if (!item) throw new Error('AccordionContent must be rendered inside AccordionItem.');\n if (!item.open && !forceMount) return null;\n\n return (\n <View\n {...viewProps}\n accessibilityLabelledBy={item.triggerId}\n nativeID={item.contentId}\n style={[!item.open ? hiddenContentStyle : undefined, style]}\n >\n {children}\n </View>\n );\n}\n\nconst hiddenContentStyle: ViewStyle = { display: 'none' };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionContext.d.ts","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,eAAO,MAAM,gBAAgB,6CAA0D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionContext.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAA+B,IAAI,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type { AccordionContextValue } from '../../../../types/accordion';\n\nexport const AccordionContext = React.createContext<AccordionContextValue | null>(null);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AccordionItemProps } from '../../../../types/accordion';
|
|
3
|
+
/*** Provides one accordion item's value, state, and trigger/content identifiers. */
|
|
4
|
+
export declare function AccordionItem({ children, disabled, interactionPolicy, value, ...viewProps }: AccordionItemProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=AccordionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAItE,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAgB,EAChB,iBAAiB,EACjB,KAAK,EACL,GAAG,SAAS,EACb,EAAE,kBAAkB,qBA2BpB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { AccordionContext } from './AccordionContext';
|
|
4
|
+
import { AccordionItemContext } from './AccordionItemContext';
|
|
5
|
+
/*** Provides one accordion item's value, state, and trigger/content identifiers. */
|
|
6
|
+
export function AccordionItem({ children, disabled = false, interactionPolicy, value, ...viewProps }) {
|
|
7
|
+
const accordion = React.use(AccordionContext);
|
|
8
|
+
if (!accordion)
|
|
9
|
+
throw new Error('AccordionItem must be rendered inside Accordion.');
|
|
10
|
+
const reactId = React.useId();
|
|
11
|
+
const resolvedDisabled = accordion.disabled || disabled;
|
|
12
|
+
const resolvedInteractionPolicy = interactionPolicy ?? accordion.interactionPolicy;
|
|
13
|
+
const open = accordion.openValues.includes(value);
|
|
14
|
+
const toggle = React.useCallback(() => accordion.toggleValue(value), [accordion, value]);
|
|
15
|
+
const contextValue = React.useMemo(() => ({
|
|
16
|
+
contentId: `accordion-${reactId}-content`,
|
|
17
|
+
disabled: resolvedDisabled,
|
|
18
|
+
interactionPolicy: resolvedInteractionPolicy,
|
|
19
|
+
open,
|
|
20
|
+
toggle,
|
|
21
|
+
triggerId: `accordion-${reactId}-trigger`,
|
|
22
|
+
value,
|
|
23
|
+
}), [open, reactId, resolvedDisabled, resolvedInteractionPolicy, toggle, value]);
|
|
24
|
+
return (<AccordionItemContext value={contextValue}>
|
|
25
|
+
<View {...viewProps}>{children}</View>
|
|
26
|
+
</AccordionItemContext>);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=AccordionItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,oFAAoF;AACpF,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,iBAAiB,EACjB,KAAK,EACL,GAAG,SAAS,EACO;IACnB,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC9C,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IAEpF,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;IAC9B,MAAM,gBAAgB,GAAG,SAAS,CAAC,QAAQ,IAAI,QAAQ,CAAC;IACxD,MAAM,yBAAyB,GAAG,iBAAiB,IAAI,SAAS,CAAC,iBAAiB,CAAC;IACnF,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IACzF,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAChC,GAAG,EAAE,CAAC,CAAC;QACL,SAAS,EAAE,aAAa,OAAO,UAAU;QACzC,QAAQ,EAAE,gBAAgB;QAC1B,iBAAiB,EAAE,yBAAyB;QAC5C,IAAI;QACJ,MAAM;QACN,SAAS,EAAE,aAAa,OAAO,UAAU;QACzC,KAAK;KACN,CAAC,EACF,CAAC,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,EAAE,KAAK,CAAC,CAC5E,CAAC;IAEF,OAAO,CACL,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACxC;MAAA,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CACvC;IAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport type { AccordionItemProps } from '../../../../types/accordion';\nimport { AccordionContext } from './AccordionContext';\nimport { AccordionItemContext } from './AccordionItemContext';\n\n/*** Provides one accordion item's value, state, and trigger/content identifiers. */\nexport function AccordionItem({\n children,\n disabled = false,\n interactionPolicy,\n value,\n ...viewProps\n}: AccordionItemProps) {\n const accordion = React.use(AccordionContext);\n if (!accordion) throw new Error('AccordionItem must be rendered inside Accordion.');\n\n const reactId = React.useId();\n const resolvedDisabled = accordion.disabled || disabled;\n const resolvedInteractionPolicy = interactionPolicy ?? accordion.interactionPolicy;\n const open = accordion.openValues.includes(value);\n const toggle = React.useCallback(() => accordion.toggleValue(value), [accordion, value]);\n const contextValue = React.useMemo(\n () => ({\n contentId: `accordion-${reactId}-content`,\n disabled: resolvedDisabled,\n interactionPolicy: resolvedInteractionPolicy,\n open,\n toggle,\n triggerId: `accordion-${reactId}-trigger`,\n value,\n }),\n [open, reactId, resolvedDisabled, resolvedInteractionPolicy, toggle, value],\n );\n\n return (\n <AccordionItemContext value={contextValue}>\n <View {...viewProps}>{children}</View>\n </AccordionItemContext>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItemContext.d.ts","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionItemContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE7E,eAAO,MAAM,oBAAoB,iDAA8D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItemContext.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionItemContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAmC,IAAI,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type { AccordionItemContextValue } from '../../../../types/accordion';\n\nexport const AccordionItemContext = React.createContext<AccordionItemContextValue | null>(null);\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AccordionTriggerProps } from '../../../../types/accordion';
|
|
3
|
+
/*** Renders the accessible button that toggles its owning accordion item. */
|
|
4
|
+
export declare function AccordionTrigger({ children, disabled, interactionPolicy, ...pressableProps }: AccordionTriggerProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=AccordionTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGzE,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAgB,EAChB,iBAAiB,EACjB,GAAG,cAAc,EAClB,EAAE,qBAAqB,qBAqBvB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pressable, View } from 'react-native';
|
|
3
|
+
import { AccordionItemContext } from './AccordionItemContext';
|
|
4
|
+
/*** Renders the accessible button that toggles its owning accordion item. */
|
|
5
|
+
export function AccordionTrigger({ children, disabled = false, interactionPolicy, ...pressableProps }) {
|
|
6
|
+
const item = React.use(AccordionItemContext);
|
|
7
|
+
if (!item)
|
|
8
|
+
throw new Error('AccordionTrigger must be rendered inside AccordionItem.');
|
|
9
|
+
const resolvedDisabled = item.disabled || disabled;
|
|
10
|
+
const resolvedInteractionPolicy = interactionPolicy ?? item.interactionPolicy;
|
|
11
|
+
return (<View accessibilityRole="header">
|
|
12
|
+
<Pressable {...pressableProps} accessibilityRole="button" accessibilityState={{ disabled: resolvedDisabled, expanded: item.open }} disabled={resolvedDisabled} nativeID={item.triggerId} onPress={resolvedInteractionPolicy === 'passive' ? undefined : item.toggle}>
|
|
13
|
+
{children}
|
|
14
|
+
</Pressable>
|
|
15
|
+
</View>);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=AccordionTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionTrigger.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,6EAA6E;AAC7E,MAAM,UAAU,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,iBAAiB,EACjB,GAAG,cAAc,EACK;IACtB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC7C,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAEtF,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC;IACnD,MAAM,yBAAyB,GAAG,iBAAiB,IAAI,IAAI,CAAC,iBAAiB,CAAC;IAE9E,OAAO,CACL,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAC9B;MAAA,CAAC,SAAS,CACR,IAAI,cAAc,CAAC,CACnB,iBAAiB,CAAC,QAAQ,CAC1B,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CACxE,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAC3B,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CACzB,OAAO,CAAC,CAAC,yBAAyB,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAE3E;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,SAAS,CACb;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Pressable, View } from 'react-native';\n\nimport type { AccordionTriggerProps } from '../../../../types/accordion';\nimport { AccordionItemContext } from './AccordionItemContext';\n\n/*** Renders the accessible button that toggles its owning accordion item. */\nexport function AccordionTrigger({\n children,\n disabled = false,\n interactionPolicy,\n ...pressableProps\n}: AccordionTriggerProps) {\n const item = React.use(AccordionItemContext);\n if (!item) throw new Error('AccordionTrigger must be rendered inside AccordionItem.');\n\n const resolvedDisabled = item.disabled || disabled;\n const resolvedInteractionPolicy = interactionPolicy ?? item.interactionPolicy;\n\n return (\n <View accessibilityRole=\"header\">\n <Pressable\n {...pressableProps}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: resolvedDisabled, expanded: item.open }}\n disabled={resolvedDisabled}\n nativeID={item.triggerId}\n onPress={resolvedInteractionPolicy === 'passive' ? undefined : item.toggle}\n >\n {children}\n </Pressable>\n </View>\n );\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { AccordionContentProps, AccordionItemProps, AccordionMode, AccordionMultipleProps, AccordionProps, AccordionSingleProps, AccordionTriggerProps, } from '../../types/accordion';
|
|
2
|
+
export { Accordion } from './adapters/inbound/Accordion';
|
|
3
|
+
export { AccordionContent } from './adapters/inbound/AccordionContent';
|
|
4
|
+
export { AccordionItem } from './adapters/inbound/AccordionItem';
|
|
5
|
+
export { AccordionTrigger } from './adapters/inbound/AccordionTrigger';
|
|
6
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/accordion/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Accordion } from './adapters/inbound/Accordion';
|
|
2
|
+
export { AccordionContent } from './adapters/inbound/AccordionContent';
|
|
3
|
+
export { AccordionItem } from './adapters/inbound/AccordionItem';
|
|
4
|
+
export { AccordionTrigger } from './adapters/inbound/AccordionTrigger';
|
|
5
|
+
//# sourceMappingURL=public.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/accordion/public.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["export type {\n AccordionContentProps,\n AccordionItemProps,\n AccordionMode,\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n AccordionTriggerProps,\n} from '../../types/accordion';\nexport { Accordion } from './adapters/inbound/Accordion';\nexport { AccordionContent } from './adapters/inbound/AccordionContent';\nexport { AccordionItem } from './adapters/inbound/AccordionItem';\nexport { AccordionTrigger } from './adapters/inbound/AccordionTrigger';\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AccordionMode } from '../../../types/accordion';
|
|
2
|
+
/*** Resolves the next immutable set of open accordion item values. */
|
|
3
|
+
export declare function resolveAccordionToggle({ collapsible, mode, openValues, value, }: ResolveAccordionToggleInput): readonly string[];
|
|
4
|
+
interface ResolveAccordionToggleInput {
|
|
5
|
+
collapsible: boolean;
|
|
6
|
+
mode: AccordionMode;
|
|
7
|
+
openValues: readonly string[];
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=resolveAccordionToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAccordionToggle.d.ts","sourceRoot":"","sources":["../../../../src/features/accordion/utils/resolveAccordionToggle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,EACrC,WAAW,EACX,IAAI,EACJ,UAAU,EACV,KAAK,GACN,EAAE,2BAA2B,GAAG,SAAS,MAAM,EAAE,CAYjD;AAED,UAAU,2BAA2B;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf"}
|