@navikt/ds-react 6.10.1 → 6.12.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/cjs/alert/Alert.d.ts +5 -0
- package/cjs/alert/Alert.js +5 -3
- package/cjs/alert/Alert.js.map +1 -1
- package/cjs/collapsible/parts/Collapsible.Content.js +1 -1
- package/cjs/collapsible/parts/Collapsible.Trigger.js +1 -1
- package/cjs/date/datepicker/types.d.ts +1 -1
- package/cjs/date/monthpicker/types.d.ts +1 -1
- package/cjs/form/file-upload/parts/Trigger.js +1 -1
- package/cjs/form/file-upload/parts/item/Item.d.ts +5 -0
- package/cjs/form/file-upload/parts/item/Item.js +2 -2
- package/cjs/form/file-upload/parts/item/Item.js.map +1 -1
- package/cjs/layout/base/BasePrimitive.d.ts +167 -0
- package/cjs/layout/base/BasePrimitive.js +70 -0
- package/cjs/layout/base/BasePrimitive.js.map +1 -0
- package/cjs/layout/base/PrimitiveAsChildProps.d.ts +41 -0
- package/cjs/layout/base/PrimitiveAsChildProps.js +3 -0
- package/cjs/layout/base/PrimitiveAsChildProps.js.map +1 -0
- package/cjs/layout/bleed/Bleed.js +1 -1
- package/cjs/layout/box/Box.d.ts +14 -35
- package/cjs/layout/box/Box.js +15 -4
- package/cjs/layout/box/Box.js.map +1 -1
- package/cjs/layout/grid/HGrid.d.ts +7 -5
- package/cjs/layout/grid/HGrid.js +7 -2
- package/cjs/layout/grid/HGrid.js.map +1 -1
- package/cjs/layout/page/Page.d.ts +4 -3
- package/cjs/layout/page/Page.js.map +1 -1
- package/cjs/layout/responsive/Responsive.js +1 -1
- package/cjs/layout/stack/HStack.d.ts +2 -1
- package/cjs/layout/stack/HStack.js.map +1 -1
- package/cjs/layout/stack/Stack.d.ts +8 -5
- package/cjs/layout/stack/Stack.js +10 -5
- package/cjs/layout/stack/Stack.js.map +1 -1
- package/cjs/layout/stack/VStack.d.ts +2 -1
- package/cjs/layout/stack/VStack.js.map +1 -1
- package/cjs/layout/utilities/css.js +3 -0
- package/cjs/layout/utilities/css.js.map +1 -1
- package/cjs/layout/utilities/types.d.ts +2 -1
- package/cjs/list/ListItem.js +2 -2
- package/cjs/list/ListItem.js.map +1 -1
- package/cjs/modal/dialog-polyfill.js +0 -3
- package/cjs/modal/dialog-polyfill.js.map +1 -1
- package/cjs/overlays/dismissablelayer/DismissableLayer.js +1 -1
- package/cjs/overlays/dismissablelayer/util/useFocusOutside.d.ts +2 -2
- package/cjs/overlays/dismissablelayer/util/useFocusOutside.js +6 -2
- package/cjs/overlays/dismissablelayer/util/useFocusOutside.js.map +1 -1
- package/cjs/overlays/dismissablelayer/util/usePointerDownOutside.d.ts +1 -1
- package/cjs/overlays/dismissablelayer/util/usePointerDownOutside.js +3 -1
- package/cjs/overlays/dismissablelayer/util/usePointerDownOutside.js.map +1 -1
- package/cjs/overlays/floating/Floating.js +1 -1
- package/cjs/pagination/Pagination.d.ts +7 -0
- package/cjs/pagination/Pagination.js +5 -2
- package/cjs/pagination/Pagination.js.map +1 -1
- package/cjs/pagination/PaginationItem.js +4 -2
- package/cjs/pagination/PaginationItem.js.map +1 -1
- package/cjs/portal/Portal.js +1 -1
- package/cjs/slot/Slot.d.ts +6 -0
- package/cjs/{util → slot}/Slot.js +6 -37
- package/cjs/slot/Slot.js.map +1 -0
- package/cjs/slot/merge-props.d.ts +4 -0
- package/cjs/slot/merge-props.js +37 -0
- package/cjs/slot/merge-props.js.map +1 -0
- package/cjs/toggle-group/ToggleGroup.d.ts +3 -3
- package/cjs/toggle-group/ToggleGroup.js +3 -3
- package/cjs/toggle-group/parts/ToggleItem.d.ts +32 -5
- package/cjs/toggle-group/parts/ToggleItem.js +4 -2
- package/cjs/toggle-group/parts/ToggleItem.js.map +1 -1
- package/cjs/toggle-group/parts/useToggleItem.js +1 -1
- package/cjs/toggle-group/parts/useToggleItem.js.map +1 -1
- package/cjs/util/hooks/descendants/useDescendant.js +1 -1
- package/cjs/util/hooks/descendants/useDescendant.js.map +1 -1
- package/cjs/util/hooks/descendants/utils.js +1 -1
- package/cjs/util/hooks/descendants/utils.js.map +1 -1
- package/cjs/util/i18n/get.js +3 -2
- package/cjs/util/i18n/get.js.map +1 -1
- package/cjs/util/types/AsChildProps.d.ts +1 -0
- package/esm/alert/Alert.d.ts +5 -0
- package/esm/alert/Alert.js +5 -3
- package/esm/alert/Alert.js.map +1 -1
- package/esm/collapsible/parts/Collapsible.Content.js +1 -1
- package/esm/collapsible/parts/Collapsible.Trigger.js +1 -1
- package/esm/date/datepicker/types.d.ts +1 -1
- package/esm/date/monthpicker/types.d.ts +1 -1
- package/esm/form/file-upload/parts/Trigger.js +1 -1
- package/esm/form/file-upload/parts/item/Item.d.ts +5 -0
- package/esm/form/file-upload/parts/item/Item.js +2 -2
- package/esm/form/file-upload/parts/item/Item.js.map +1 -1
- package/esm/layout/base/BasePrimitive.d.ts +167 -0
- package/esm/layout/base/BasePrimitive.js +63 -0
- package/esm/layout/base/BasePrimitive.js.map +1 -0
- package/esm/layout/base/PrimitiveAsChildProps.d.ts +41 -0
- package/esm/layout/base/PrimitiveAsChildProps.js +2 -0
- package/esm/layout/base/PrimitiveAsChildProps.js.map +1 -0
- package/esm/layout/bleed/Bleed.js +1 -1
- package/esm/layout/box/Box.d.ts +14 -35
- package/esm/layout/box/Box.js +15 -4
- package/esm/layout/box/Box.js.map +1 -1
- package/esm/layout/grid/HGrid.d.ts +7 -5
- package/esm/layout/grid/HGrid.js +7 -2
- package/esm/layout/grid/HGrid.js.map +1 -1
- package/esm/layout/page/Page.d.ts +4 -3
- package/esm/layout/page/Page.js.map +1 -1
- package/esm/layout/responsive/Responsive.js +1 -1
- package/esm/layout/stack/HStack.d.ts +2 -1
- package/esm/layout/stack/HStack.js.map +1 -1
- package/esm/layout/stack/Stack.d.ts +8 -5
- package/esm/layout/stack/Stack.js +10 -5
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/layout/stack/VStack.d.ts +2 -1
- package/esm/layout/stack/VStack.js.map +1 -1
- package/esm/layout/utilities/css.js +3 -0
- package/esm/layout/utilities/css.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +2 -1
- package/esm/list/ListItem.js +3 -3
- package/esm/list/ListItem.js.map +1 -1
- package/esm/modal/dialog-polyfill.js +0 -3
- package/esm/modal/dialog-polyfill.js.map +1 -1
- package/esm/overlays/dismissablelayer/DismissableLayer.js +1 -1
- package/esm/overlays/dismissablelayer/util/useFocusOutside.d.ts +2 -2
- package/esm/overlays/dismissablelayer/util/useFocusOutside.js +6 -2
- package/esm/overlays/dismissablelayer/util/useFocusOutside.js.map +1 -1
- package/esm/overlays/dismissablelayer/util/usePointerDownOutside.d.ts +1 -1
- package/esm/overlays/dismissablelayer/util/usePointerDownOutside.js +3 -1
- package/esm/overlays/dismissablelayer/util/usePointerDownOutside.js.map +1 -1
- package/esm/overlays/floating/Floating.js +1 -1
- package/esm/pagination/Pagination.d.ts +7 -0
- package/esm/pagination/Pagination.js +6 -3
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/pagination/PaginationItem.js +4 -2
- package/esm/pagination/PaginationItem.js.map +1 -1
- package/esm/portal/Portal.js +1 -1
- package/esm/slot/Slot.d.ts +6 -0
- package/esm/slot/Slot.js +32 -0
- package/esm/slot/Slot.js.map +1 -0
- package/esm/slot/merge-props.d.ts +4 -0
- package/esm/slot/merge-props.js +34 -0
- package/esm/slot/merge-props.js.map +1 -0
- package/esm/toggle-group/ToggleGroup.d.ts +3 -3
- package/esm/toggle-group/ToggleGroup.js +3 -3
- package/esm/toggle-group/parts/ToggleItem.d.ts +32 -5
- package/esm/toggle-group/parts/ToggleItem.js +4 -2
- package/esm/toggle-group/parts/ToggleItem.js.map +1 -1
- package/esm/toggle-group/parts/useToggleItem.js +1 -1
- package/esm/toggle-group/parts/useToggleItem.js.map +1 -1
- package/esm/util/hooks/descendants/useDescendant.js +1 -1
- package/esm/util/hooks/descendants/useDescendant.js.map +1 -1
- package/esm/util/hooks/descendants/utils.js +1 -1
- package/esm/util/hooks/descendants/utils.js.map +1 -1
- package/esm/util/i18n/get.js +3 -2
- package/esm/util/i18n/get.js.map +1 -1
- package/esm/util/types/AsChildProps.d.ts +1 -0
- package/package.json +3 -3
- package/src/alert/Alert.tsx +23 -2
- package/src/collapsible/parts/Collapsible.Content.tsx +1 -1
- package/src/collapsible/parts/Collapsible.Trigger.tsx +1 -1
- package/src/date/datepicker/types.ts +1 -1
- package/src/date/monthpicker/types.ts +1 -1
- package/src/form/file-upload/parts/Trigger.tsx +1 -1
- package/src/form/file-upload/parts/item/Item.tsx +7 -1
- package/src/layout/base/BasePrimitive.tsx +314 -0
- package/src/layout/base/PrimitiveAsChildProps.ts +42 -0
- package/src/layout/bleed/Bleed.tsx +1 -1
- package/src/layout/box/Box.tsx +66 -76
- package/src/layout/grid/HGrid.tsx +73 -45
- package/src/layout/page/Page.tsx +4 -3
- package/src/layout/responsive/Responsive.tsx +1 -1
- package/src/layout/stack/HStack.tsx +2 -1
- package/src/layout/stack/Stack.tsx +80 -62
- package/src/layout/stack/VStack.tsx +3 -1
- package/src/layout/utilities/css.ts +3 -0
- package/src/layout/utilities/types.ts +2 -3
- package/src/list/ListItem.tsx +5 -5
- package/src/modal/dialog-polyfill.ts +0 -3
- package/src/overlays/dismissablelayer/DismissableLayer.tsx +1 -1
- package/src/overlays/dismissablelayer/util/useFocusOutside.ts +6 -2
- package/src/overlays/dismissablelayer/util/usePointerDownOutside.ts +3 -1
- package/src/overlays/floating/Floating.tsx +1 -1
- package/src/pagination/Pagination.tsx +26 -1
- package/src/pagination/PaginationItem.tsx +4 -0
- package/src/portal/Portal.tsx +1 -1
- package/src/slot/Slot.tsx +33 -0
- package/src/{util/Slot.tsx → slot/merge-props.ts} +2 -34
- package/src/slot/tests/merge-props.test.ts +49 -0
- package/src/toggle-group/ToggleGroup.test.tsx +3 -9
- package/src/toggle-group/ToggleGroup.tsx +3 -3
- package/src/toggle-group/parts/ToggleItem.tsx +54 -8
- package/src/toggle-group/parts/useToggleItem.ts +4 -1
- package/src/util/hooks/descendants/useDescendant.tsx +1 -1
- package/src/util/hooks/descendants/utils.ts +1 -1
- package/src/util/i18n/get.ts +4 -2
- package/src/util/types/AsChildProps.ts +1 -0
- package/cjs/layout/sidemal-test/AvatarPanel.d.ts +0 -4
- package/cjs/layout/sidemal-test/AvatarPanel.js +0 -19
- package/cjs/layout/sidemal-test/AvatarPanel.js.map +0 -1
- package/cjs/layout/sidemal-test/Content.d.ts +0 -2
- package/cjs/layout/sidemal-test/Content.js +0 -67
- package/cjs/layout/sidemal-test/Content.js.map +0 -1
- package/cjs/layout/sidemal-test/Filter.d.ts +0 -2
- package/cjs/layout/sidemal-test/Filter.js +0 -49
- package/cjs/layout/sidemal-test/Filter.js.map +0 -1
- package/cjs/layout/sidemal-test/Header.d.ts +0 -2
- package/cjs/layout/sidemal-test/Header.js +0 -49
- package/cjs/layout/sidemal-test/Header.js.map +0 -1
- package/cjs/layout/sidemal-test/Intro.d.ts +0 -2
- package/cjs/layout/sidemal-test/Intro.js +0 -37
- package/cjs/layout/sidemal-test/Intro.js.map +0 -1
- package/cjs/layout/sidemal-test/Sidebar.d.ts +0 -4
- package/cjs/layout/sidemal-test/Sidebar.js +0 -50
- package/cjs/layout/sidemal-test/Sidebar.js.map +0 -1
- package/cjs/layout/sidemal-test/content-box/ContentBox.d.ts +0 -8
- package/cjs/layout/sidemal-test/content-box/ContentBox.js +0 -66
- package/cjs/layout/sidemal-test/content-box/ContentBox.js.map +0 -1
- package/cjs/layout/sidemal-test/content-box/index.d.ts +0 -1
- package/cjs/layout/sidemal-test/content-box/index.js +0 -9
- package/cjs/layout/sidemal-test/content-box/index.js.map +0 -1
- package/cjs/util/Slot.d.ts +0 -6
- package/cjs/util/Slot.js.map +0 -1
- package/esm/layout/sidemal-test/AvatarPanel.d.ts +0 -4
- package/esm/layout/sidemal-test/AvatarPanel.js +0 -12
- package/esm/layout/sidemal-test/AvatarPanel.js.map +0 -1
- package/esm/layout/sidemal-test/Content.d.ts +0 -2
- package/esm/layout/sidemal-test/Content.js +0 -60
- package/esm/layout/sidemal-test/Content.js.map +0 -1
- package/esm/layout/sidemal-test/Filter.d.ts +0 -2
- package/esm/layout/sidemal-test/Filter.js +0 -22
- package/esm/layout/sidemal-test/Filter.js.map +0 -1
- package/esm/layout/sidemal-test/Header.d.ts +0 -2
- package/esm/layout/sidemal-test/Header.js +0 -42
- package/esm/layout/sidemal-test/Header.js.map +0 -1
- package/esm/layout/sidemal-test/Intro.d.ts +0 -2
- package/esm/layout/sidemal-test/Intro.js +0 -30
- package/esm/layout/sidemal-test/Intro.js.map +0 -1
- package/esm/layout/sidemal-test/Sidebar.d.ts +0 -4
- package/esm/layout/sidemal-test/Sidebar.js +0 -41
- package/esm/layout/sidemal-test/Sidebar.js.map +0 -1
- package/esm/layout/sidemal-test/content-box/ContentBox.d.ts +0 -8
- package/esm/layout/sidemal-test/content-box/ContentBox.js +0 -37
- package/esm/layout/sidemal-test/content-box/ContentBox.js.map +0 -1
- package/esm/layout/sidemal-test/content-box/index.d.ts +0 -1
- package/esm/layout/sidemal-test/content-box/index.js +0 -2
- package/esm/layout/sidemal-test/content-box/index.js.map +0 -1
- package/esm/util/Slot.d.ts +0 -6
- package/esm/util/Slot.js +0 -63
- package/esm/util/Slot.js.map +0 -1
- package/src/layout/sidemal-test/AvatarPanel.tsx +0 -27
- package/src/layout/sidemal-test/Content.tsx +0 -129
- package/src/layout/sidemal-test/Filter.tsx +0 -46
- package/src/layout/sidemal-test/Header.tsx +0 -96
- package/src/layout/sidemal-test/Intro.tsx +0 -91
- package/src/layout/sidemal-test/Sidebar.tsx +0 -77
- package/src/layout/sidemal-test/content-box/ContentBox.tsx +0 -46
- package/src/layout/sidemal-test/content-box/index.ts +0 -1
- package/src/layout/sidemal-test/styling.css +0 -43
- /package/src/{util/__tests__ → slot/tests}/Slot.test.tsx +0 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ResponsiveProp, SpacingScale } from "../utilities/types.js";
|
|
3
|
+
export type PrimitiveProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Padding around children.
|
|
7
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
8
|
+
* or an object of spacing tokens for different breakpoints.
|
|
9
|
+
* @example
|
|
10
|
+
* padding='4'
|
|
11
|
+
* padding={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
12
|
+
*/
|
|
13
|
+
padding?: ResponsiveProp<SpacingScale>;
|
|
14
|
+
/**
|
|
15
|
+
* Horizontal padding around children.
|
|
16
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
17
|
+
* or an object of spacing tokens for different breakpoints.
|
|
18
|
+
* @example
|
|
19
|
+
* paddingInline='4'
|
|
20
|
+
* paddingInline='4 5'
|
|
21
|
+
* paddingInline={{xs: '0 32', sm: '3', md: '4 5', lg: '5', xl: '6'}}
|
|
22
|
+
*/
|
|
23
|
+
paddingInline?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
|
|
24
|
+
/**
|
|
25
|
+
* Vertical padding around children.
|
|
26
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
27
|
+
* or an object of spacing tokens for different breakpoints.
|
|
28
|
+
* @example
|
|
29
|
+
* paddingBlock='4'
|
|
30
|
+
* paddingBlock='4 5'
|
|
31
|
+
* paddingBlock={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
32
|
+
*/
|
|
33
|
+
paddingBlock?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
|
|
34
|
+
/**
|
|
35
|
+
* Margin around element.
|
|
36
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
37
|
+
* or an object of spacing tokens for different breakpoints.
|
|
38
|
+
* @example
|
|
39
|
+
* margin='4'
|
|
40
|
+
* margin={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
41
|
+
*/
|
|
42
|
+
margin?: ResponsiveProp<SpacingScale>;
|
|
43
|
+
/**
|
|
44
|
+
* Horizontal margin around element.
|
|
45
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
46
|
+
* or an object of spacing tokens for different breakpoints.
|
|
47
|
+
* @example
|
|
48
|
+
* marginInline='4'
|
|
49
|
+
* marginInline='4 5'
|
|
50
|
+
* marginInline={{xs: '0 32', sm: '3', md: '4 5', lg: '5', xl: '6'}}
|
|
51
|
+
*/
|
|
52
|
+
marginInline?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}` | "auto" | `auto ${SpacingScale}` | `${SpacingScale} auto`>;
|
|
53
|
+
/**
|
|
54
|
+
* Vertical margin around element.
|
|
55
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
56
|
+
* or an object of spacing tokens for different breakpoints.
|
|
57
|
+
* @example
|
|
58
|
+
* marginBlock='4'
|
|
59
|
+
* marginBlock='4 5'
|
|
60
|
+
* marginBlock={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
61
|
+
*/
|
|
62
|
+
marginBlock?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}` | "auto" | `auto ${SpacingScale}` | `${SpacingScale} auto`>;
|
|
63
|
+
/**
|
|
64
|
+
* CSS `width`
|
|
65
|
+
*/
|
|
66
|
+
width?: ResponsiveProp<string>;
|
|
67
|
+
/**
|
|
68
|
+
* CSS `min-width`
|
|
69
|
+
*/
|
|
70
|
+
minWidth?: ResponsiveProp<string>;
|
|
71
|
+
/**
|
|
72
|
+
* CSS `max-width`
|
|
73
|
+
*/
|
|
74
|
+
maxWidth?: ResponsiveProp<string>;
|
|
75
|
+
/**
|
|
76
|
+
* CSS `height`
|
|
77
|
+
*/
|
|
78
|
+
height?: ResponsiveProp<string>;
|
|
79
|
+
/**
|
|
80
|
+
* CSS `min-height`
|
|
81
|
+
*/
|
|
82
|
+
minHeight?: ResponsiveProp<string>;
|
|
83
|
+
/**
|
|
84
|
+
* CSS `max-height`
|
|
85
|
+
*/
|
|
86
|
+
maxHeight?: ResponsiveProp<string>;
|
|
87
|
+
/**
|
|
88
|
+
* CSS `position`
|
|
89
|
+
*/
|
|
90
|
+
position?: ResponsiveProp<"static" | "relative" | "absolute" | "fixed" | "sticky">;
|
|
91
|
+
/**
|
|
92
|
+
* CSS `inset`.
|
|
93
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
94
|
+
* or an object of spacing tokens for different breakpoints.
|
|
95
|
+
* @example
|
|
96
|
+
* inset='4'
|
|
97
|
+
* inset='4 5'
|
|
98
|
+
* inset={{xs: '0 32', sm: '3', md: '4 5', lg: '5', xl: '6'}}
|
|
99
|
+
*/
|
|
100
|
+
inset?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
|
|
101
|
+
/**
|
|
102
|
+
* CSS `top`
|
|
103
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
104
|
+
* or an object of spacing tokens for different breakpoints.
|
|
105
|
+
* @example
|
|
106
|
+
* top='4'
|
|
107
|
+
* top={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
108
|
+
*/
|
|
109
|
+
top?: ResponsiveProp<SpacingScale>;
|
|
110
|
+
/**
|
|
111
|
+
* CSS `right`
|
|
112
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
113
|
+
* or an object of spacing tokens for different breakpoints.
|
|
114
|
+
* @example
|
|
115
|
+
* right='4'
|
|
116
|
+
* right={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
117
|
+
*/
|
|
118
|
+
right?: ResponsiveProp<SpacingScale>;
|
|
119
|
+
/**
|
|
120
|
+
* CSS `bottom`
|
|
121
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
122
|
+
* or an object of spacing tokens for different breakpoints.
|
|
123
|
+
* @example
|
|
124
|
+
* bottom='4'
|
|
125
|
+
* bottom={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
126
|
+
*/
|
|
127
|
+
bottom?: ResponsiveProp<SpacingScale>;
|
|
128
|
+
/**
|
|
129
|
+
* CSS `left`
|
|
130
|
+
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
131
|
+
* or an object of spacing tokens for different breakpoints.
|
|
132
|
+
* @example
|
|
133
|
+
* left='4'
|
|
134
|
+
* left={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
135
|
+
*/
|
|
136
|
+
left?: ResponsiveProp<SpacingScale>;
|
|
137
|
+
/**
|
|
138
|
+
* CSS `overflow`
|
|
139
|
+
*/
|
|
140
|
+
overflow?: ResponsiveProp<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
141
|
+
/**
|
|
142
|
+
* CSS `overflow-x`
|
|
143
|
+
*/
|
|
144
|
+
overflowX?: ResponsiveProp<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
145
|
+
/**
|
|
146
|
+
* CSS `overflow-y`
|
|
147
|
+
*/
|
|
148
|
+
overflowY?: ResponsiveProp<"visible" | "hidden" | "clip" | "scroll" | "auto">;
|
|
149
|
+
/**
|
|
150
|
+
* CSS `flex-basis`
|
|
151
|
+
*/
|
|
152
|
+
flexBasis?: ResponsiveProp<string>;
|
|
153
|
+
/**
|
|
154
|
+
* CSS `flex-shrink`
|
|
155
|
+
*/
|
|
156
|
+
flexShrink?: ResponsiveProp<string>;
|
|
157
|
+
/**
|
|
158
|
+
* CSS `flex-grow`
|
|
159
|
+
*/
|
|
160
|
+
flexGrow?: ResponsiveProp<string>;
|
|
161
|
+
};
|
|
162
|
+
export declare const PRIMITIVE_PROPS: (keyof PrimitiveProps)[];
|
|
163
|
+
interface BasePrimitiveProps extends PrimitiveProps {
|
|
164
|
+
children: React.ReactElement;
|
|
165
|
+
}
|
|
166
|
+
export declare const BasePrimitive: ({ children, className, padding, paddingInline, paddingBlock, margin, marginInline, marginBlock, width, minWidth, maxWidth, height, minHeight, maxHeight, position, inset, top, right, left, bottom, overflow, overflowX, overflowY, flexBasis, flexGrow, flexShrink, }: BasePrimitiveProps) => React.JSX.Element;
|
|
167
|
+
export default BasePrimitive;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import cl from "clsx";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Slot } from "../../slot/Slot.js";
|
|
4
|
+
import { getResponsiveProps, getResponsiveValue } from "../utilities/css.js";
|
|
5
|
+
export const PRIMITIVE_PROPS = [
|
|
6
|
+
"className",
|
|
7
|
+
"padding",
|
|
8
|
+
"paddingInline",
|
|
9
|
+
"paddingBlock",
|
|
10
|
+
"margin",
|
|
11
|
+
"marginInline",
|
|
12
|
+
"marginBlock",
|
|
13
|
+
"width",
|
|
14
|
+
"minWidth",
|
|
15
|
+
"maxWidth",
|
|
16
|
+
"height",
|
|
17
|
+
"minHeight",
|
|
18
|
+
"maxHeight",
|
|
19
|
+
"position",
|
|
20
|
+
"inset",
|
|
21
|
+
"top",
|
|
22
|
+
"right",
|
|
23
|
+
"bottom",
|
|
24
|
+
"left",
|
|
25
|
+
"overflow",
|
|
26
|
+
"overflowX",
|
|
27
|
+
"overflowY",
|
|
28
|
+
"flexBasis",
|
|
29
|
+
"flexGrow",
|
|
30
|
+
"flexShrink",
|
|
31
|
+
];
|
|
32
|
+
export const BasePrimitive = ({ children, className, padding, paddingInline, paddingBlock, margin, marginInline, marginBlock, width, minWidth, maxWidth, height, minHeight, maxHeight, position, inset, top, right, left, bottom, overflow, overflowX, overflowY, flexBasis, flexGrow, flexShrink, }) => {
|
|
33
|
+
const style = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getResponsiveProps("r", "p", "spacing", padding)), getResponsiveProps("r", "pi", "spacing", paddingInline)), getResponsiveProps("r", "pb", "spacing", paddingBlock)), getResponsiveProps("r", "m", "spacing", margin)), getResponsiveProps("r", "mi", "spacing", marginInline)), getResponsiveProps("r", "mb", "spacing", marginBlock)), getResponsiveValue("r", "w", width)), getResponsiveValue("r", "minw", minWidth)), getResponsiveValue("r", "maxw", maxWidth)), getResponsiveValue("r", "h", height)), getResponsiveValue("r", "minh", minHeight)), getResponsiveValue("r", "maxh", maxHeight)), getResponsiveValue("r", "position", position)), getResponsiveProps("r", "inset", "spacing", inset)), getResponsiveProps("r", "top", "spacing", top)), getResponsiveProps("r", "right", "spacing", right)), getResponsiveProps("r", "bottom", "spacing", bottom)), getResponsiveProps("r", "left", "spacing", left)), getResponsiveValue("r", "overflow", overflow)), getResponsiveValue("r", "overflowx", overflowX)), getResponsiveValue("r", "overflowy", overflowY)), getResponsiveValue("r", "flex-basis", flexBasis)), getResponsiveValue("r", "flex-grow", flexGrow)), getResponsiveValue("r", "flex-shrink", flexShrink));
|
|
34
|
+
return (React.createElement(Slot, { className: cl({
|
|
35
|
+
className,
|
|
36
|
+
"navds-r-p": padding,
|
|
37
|
+
"navds-r-pi": paddingInline,
|
|
38
|
+
"navds-r-pb": paddingBlock,
|
|
39
|
+
"navds-r-m": margin,
|
|
40
|
+
"navds-r-mi": marginInline,
|
|
41
|
+
"navds-r-mb": marginBlock,
|
|
42
|
+
"navds-r-w": width,
|
|
43
|
+
"navds-r-minw": minWidth,
|
|
44
|
+
"navds-r-maxw": maxWidth,
|
|
45
|
+
"navds-r-h": height,
|
|
46
|
+
"navds-r-minh": minHeight,
|
|
47
|
+
"navds-r-maxh": maxHeight,
|
|
48
|
+
"navds-r-position": position,
|
|
49
|
+
"navds-r-inset": inset,
|
|
50
|
+
"navds-r-top": top,
|
|
51
|
+
"navds-r-right": right,
|
|
52
|
+
"navds-r-bottom": bottom,
|
|
53
|
+
"navds-r-left": left,
|
|
54
|
+
"navds-r-overflow": overflow,
|
|
55
|
+
"navds-r-overflowx": overflowX,
|
|
56
|
+
"navds-r-overflowy": overflowY,
|
|
57
|
+
"navds-r-flex-basis": flexBasis,
|
|
58
|
+
"navds-r-flex-grow": flexGrow,
|
|
59
|
+
"navds-r-flex-shrink": flexShrink,
|
|
60
|
+
}), style: style }, children));
|
|
61
|
+
};
|
|
62
|
+
export default BasePrimitive;
|
|
63
|
+
//# sourceMappingURL=BasePrimitive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasePrimitive.js","sourceRoot":"","sources":["../../../src/layout/base/BasePrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAqL1E,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD,WAAW;IACX,SAAS;IACT,eAAe;IACf,cAAc;IACd,QAAQ;IACR,cAAc;IACd,aAAa;IACb,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,WAAW;IACX,WAAW;IACX,UAAU;IACV,OAAO;IACP,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,UAAU;IACV,WAAW;IACX,WAAW;IACX,WAAW;IACX,UAAU;IACV,YAAY;CACb,CAAC;AAMF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,QAAQ,EACR,SAAS,E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AmB,EAAE,QAAQ;YAC7B,qBAAqB,EAAE,UAAU;SAClC,CAAC,EACF,KAAK,EAAE,KAAK,IAEX,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type PrimitiveAsChildProps = {
|
|
3
|
+
children: React.ReactElement | false | null;
|
|
4
|
+
/**
|
|
5
|
+
* Renders the component and its child as a single element,
|
|
6
|
+
* merging the props of the component with the props of the child.
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Component asChild data-prop>
|
|
10
|
+
* <ChildComponent data-child />
|
|
11
|
+
* </Component>
|
|
12
|
+
*
|
|
13
|
+
* // Renders
|
|
14
|
+
* <div data-prop data-child />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
asChild: true;
|
|
18
|
+
/**
|
|
19
|
+
* Implements [OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent)
|
|
20
|
+
*
|
|
21
|
+
* When using asChild, the prop is not allowed as it would have no effect.
|
|
22
|
+
*/
|
|
23
|
+
as?: never;
|
|
24
|
+
} | {
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Renders the component and its child as a single element,
|
|
28
|
+
* merging the props of the component with the props of the child.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Component asChild data-prop>
|
|
33
|
+
* <ChildComponent data-child />
|
|
34
|
+
* </Component>
|
|
35
|
+
*
|
|
36
|
+
* // Renders
|
|
37
|
+
* <div data-prop data-child />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
asChild?: false;
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveAsChildProps.js","sourceRoot":"","sources":["../../../src/layout/base/PrimitiveAsChildProps.ts"],"names":[],"mappings":""}
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
-
import { Slot } from "../../
|
|
14
|
+
import { Slot } from "../../slot/Slot.js";
|
|
15
15
|
import { getResponsiveProps } from "../utilities/css.js";
|
|
16
16
|
/**
|
|
17
17
|
* Foundational Layout-primitive for generic encapsulation & styling.
|
package/esm/layout/box/Box.d.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OverridableComponent } from "../../util/types/index.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
3
|
+
import { PrimitiveProps } from "../base/BasePrimitive.js";
|
|
4
|
+
import { PrimitiveAsChildProps } from "../base/PrimitiveAsChildProps.js";
|
|
5
|
+
import { BackgroundColorToken, BorderColorToken, BorderRadiiToken, ResponsiveProp, ShadowToken, SpaceDelimitedAttribute, SurfaceColorToken } from "../utilities/types.js";
|
|
6
|
+
export type BoxProps = PrimitiveProps & PrimitiveAsChildProps & React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
/**
|
|
8
|
+
* CSS `background-color` property.
|
|
9
|
+
* Accepts a [background/surface color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#afff774dad80).
|
|
10
|
+
*/
|
|
11
|
+
background?: BackgroundColorToken | SurfaceColorToken;
|
|
12
|
+
/**
|
|
13
|
+
* CSS `border-color` property.
|
|
14
|
+
* Accepts a [border color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#adb1767e2f87).
|
|
15
|
+
*/
|
|
8
16
|
borderColor?: BorderColorToken;
|
|
9
17
|
/**
|
|
10
18
|
* CSS `border-radius` property.
|
|
@@ -23,41 +31,12 @@ export interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
23
31
|
* borderWidth='1 2 3 4'
|
|
24
32
|
*/
|
|
25
33
|
borderWidth?: SpaceDelimitedAttribute<"0" | "1" | "2" | "3" | "4" | "5">;
|
|
26
|
-
/**
|
|
27
|
-
* Padding around children.
|
|
28
|
-
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
29
|
-
* or an object of spacing tokens for different breakpoints.
|
|
30
|
-
* @example
|
|
31
|
-
* padding='4'
|
|
32
|
-
* padding={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
33
|
-
*/
|
|
34
|
-
padding?: ResponsiveProp<SpacingScale>;
|
|
35
|
-
/**
|
|
36
|
-
* Horizontal padding around children.
|
|
37
|
-
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
38
|
-
* or an object of spacing tokens for different breakpoints.
|
|
39
|
-
* @example
|
|
40
|
-
* paddingInline='4'
|
|
41
|
-
* paddingInline='4 5'
|
|
42
|
-
* paddingInline={{xs: '0 32', sm: '3', md: '4 5', lg: '5', xl: '6'}}
|
|
43
|
-
*/
|
|
44
|
-
paddingInline?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
|
|
45
|
-
/**
|
|
46
|
-
* Vertical padding around children.
|
|
47
|
-
* Accepts a [spacing token](https://aksel.nav.no/grunnleggende/styling/design-tokens#0cc9fb32f213)
|
|
48
|
-
* or an object of spacing tokens for different breakpoints.
|
|
49
|
-
* @example
|
|
50
|
-
* paddingBlock='4'
|
|
51
|
-
* paddingBlock='4 5'
|
|
52
|
-
* paddingBlock={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
53
|
-
*/
|
|
54
|
-
paddingBlock?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
|
|
55
34
|
/** Shadow on box. Accepts a shadow token.
|
|
56
35
|
* @example
|
|
57
36
|
* shadow='small'
|
|
58
37
|
*/
|
|
59
38
|
shadow?: ShadowToken;
|
|
60
|
-
}
|
|
39
|
+
};
|
|
61
40
|
/**
|
|
62
41
|
* Foundational Layout-primitive for generic encapsulation & styling.
|
|
63
42
|
*
|
package/esm/layout/box/Box.js
CHANGED
|
@@ -11,6 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
+
import { Slot } from "../../slot/Slot.js";
|
|
15
|
+
import { omit } from "../../util/index.js";
|
|
16
|
+
import BasePrimitive, { PRIMITIVE_PROPS, } from "../base/BasePrimitive.js";
|
|
14
17
|
import { getResponsiveProps } from "../utilities/css.js";
|
|
15
18
|
/**
|
|
16
19
|
* Foundational Layout-primitive for generic encapsulation & styling.
|
|
@@ -40,8 +43,8 @@ import { getResponsiveProps } from "../utilities/css.js";
|
|
|
40
43
|
* </VStack>
|
|
41
44
|
*/
|
|
42
45
|
export const Box = forwardRef((_a, ref) => {
|
|
43
|
-
var { as: Component = "div", background, borderColor, borderWidth, borderRadius,
|
|
44
|
-
const style = Object.assign(Object.assign(Object.assign(
|
|
46
|
+
var { children, className, as: Component = "div", background, borderColor, borderWidth, borderRadius, shadow, style: _style, asChild } = _a, rest = __rest(_a, ["children", "className", "as", "background", "borderColor", "borderWidth", "borderRadius", "shadow", "style", "asChild"]);
|
|
47
|
+
const style = Object.assign(Object.assign(Object.assign({}, _style), { "--__ac-box-background": background
|
|
45
48
|
? `var(--a-${background})`
|
|
46
49
|
: undefined, "--__ac-box-shadow": shadow ? `var(--a-shadow-${shadow})` : undefined, "--__ac-box-border-color": borderColor
|
|
47
50
|
? `var(--a-${borderColor})`
|
|
@@ -50,8 +53,16 @@ export const Box = forwardRef((_a, ref) => {
|
|
|
50
53
|
.split(" ")
|
|
51
54
|
.map((x) => `${x}px`)
|
|
52
55
|
.join(" ")
|
|
53
|
-
: undefined }), getResponsiveProps("box", "border-radius", "border-radius", borderRadius, false, ["0"]))
|
|
54
|
-
|
|
56
|
+
: undefined }), getResponsiveProps("box", "border-radius", "border-radius", borderRadius, false, ["0"]));
|
|
57
|
+
const Comp = asChild ? Slot : Component;
|
|
58
|
+
return (React.createElement(BasePrimitive, Object.assign({}, rest),
|
|
59
|
+
React.createElement(Comp, Object.assign({}, omit(rest, PRIMITIVE_PROPS), { ref: ref, style: style, className: cl("navds-box", className, {
|
|
60
|
+
"navds-box-bg": background,
|
|
61
|
+
"navds-box-border-color": borderColor,
|
|
62
|
+
"navds-box-border-width": borderWidth,
|
|
63
|
+
"navds-box-border-radius": borderRadius,
|
|
64
|
+
"navds-box-shadow": shadow,
|
|
65
|
+
}) }), children)));
|
|
55
66
|
});
|
|
56
67
|
export default Box;
|
|
57
68
|
//# sourceMappingURL=Box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../../src/layout/box/Box.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Box.js","sourceRoot":"","sources":["../../../src/layout/box/Box.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,aAAa,EAAE,EACpB,eAAe,GAEhB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAgDtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,GAAG,GAAmD,UAAU,CAC3E,CACE,EAYC,EACD,GAAG,EACH,EAAE;QAdF,EACE,QAAQ,EACR,S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ACO,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "../../util/index.js";
|
|
3
|
+
import { PrimitiveProps } from "../base/BasePrimitive.js";
|
|
4
|
+
import { PrimitiveAsChildProps } from "../base/PrimitiveAsChildProps.js";
|
|
2
5
|
import { ResponsiveProp, SpacingScale } from "../utilities/types.js";
|
|
3
|
-
export
|
|
4
|
-
children: React.ReactNode;
|
|
6
|
+
export type HGridProps = PrimitiveProps & PrimitiveAsChildProps & React.HTMLAttributes<HTMLDivElement> & {
|
|
5
7
|
/**
|
|
6
8
|
* Number of columns to display. Can be a number, a string, or an object with values for specific breakpoints.
|
|
7
9
|
* Sets `grid-template-columns`, so `fr`, `minmax` etc. works.
|
|
@@ -25,7 +27,7 @@ export interface HGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
25
27
|
* Vertical alignment of children. Elements will by default stretch to the height of parent-element.
|
|
26
28
|
*/
|
|
27
29
|
align?: "start" | "center" | "end";
|
|
28
|
-
}
|
|
30
|
+
};
|
|
29
31
|
/**
|
|
30
32
|
* Horizontal Grid Primitive with dynamic columns and gap based on breakpoints.
|
|
31
33
|
*
|
|
@@ -51,5 +53,5 @@ export interface HGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
51
53
|
* <div />
|
|
52
54
|
* </HGrid>
|
|
53
55
|
*/
|
|
54
|
-
export declare const HGrid:
|
|
56
|
+
export declare const HGrid: OverridableComponent<HGridProps, HTMLDivElement>;
|
|
55
57
|
export default HGrid;
|
package/esm/layout/grid/HGrid.js
CHANGED
|
@@ -11,6 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
+
import { Slot } from "../../slot/Slot.js";
|
|
15
|
+
import { omit } from "../../util/index.js";
|
|
16
|
+
import BasePrimitive, { PRIMITIVE_PROPS, } from "../base/BasePrimitive.js";
|
|
14
17
|
import { getResponsiveProps, getResponsiveValue } from "../utilities/css.js";
|
|
15
18
|
/**
|
|
16
19
|
* Horizontal Grid Primitive with dynamic columns and gap based on breakpoints.
|
|
@@ -38,9 +41,11 @@ import { getResponsiveProps, getResponsiveValue } from "../utilities/css.js";
|
|
|
38
41
|
* </HGrid>
|
|
39
42
|
*/
|
|
40
43
|
export const HGrid = forwardRef((_a, ref) => {
|
|
41
|
-
var { className, columns, gap, style, align } = _a, rest = __rest(_a, ["className", "columns", "gap", "style", "align"]);
|
|
44
|
+
var { children, className, as: Component = "div", columns, gap, style, align, asChild } = _a, rest = __rest(_a, ["children", "className", "as", "columns", "gap", "style", "align", "asChild"]);
|
|
42
45
|
const styles = Object.assign(Object.assign(Object.assign(Object.assign({}, style), { "--__ac-hgrid-align": align }), getResponsiveProps(`hgrid`, "gap", "spacing", gap)), getResponsiveValue(`hgrid`, "columns", formatGrid(columns)));
|
|
43
|
-
|
|
46
|
+
const Comp = asChild ? Slot : Component;
|
|
47
|
+
return (React.createElement(BasePrimitive, Object.assign({}, rest),
|
|
48
|
+
React.createElement(Comp, Object.assign({}, omit(rest, PRIMITIVE_PROPS), { ref: ref, className: cl("navds-hgrid", className), style: styles }), children)));
|
|
44
49
|
});
|
|
45
50
|
function formatGrid(props) {
|
|
46
51
|
if (!props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HGrid.js","sourceRoot":"","sources":["../../../src/layout/grid/HGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"HGrid.js","sourceRoot":"","sources":["../../../src/layout/grid/HGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,E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,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC3D,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,eAAe,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC;QAC5D,eAAe;QACf,cAAc,CAAC,WAAW,CAAC;KAC5B,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,CAAC,IAAqB,EAAE,EAAE;IAC/C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,UAAU,IAAI,mBAAmB,CAAC;IAC3C,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import bgColors from "@navikt/ds-tokens/src/colors-bg.json";
|
|
3
2
|
import { OverridableComponent } from "../../util/index.js";
|
|
3
|
+
import { BackgroundColorToken } from "../utilities/types.js";
|
|
4
4
|
import { PageBlock } from "./parts/PageBlock.js";
|
|
5
5
|
export interface PageProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
6
|
/**
|
|
@@ -9,10 +9,11 @@ export interface PageProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
9
9
|
*/
|
|
10
10
|
as?: "div" | "body";
|
|
11
11
|
/**
|
|
12
|
-
* Background color.
|
|
12
|
+
* Background color.
|
|
13
|
+
* Accepts a [background color token](https://aksel.nav.no/grunnleggende/styling/design-tokens#753d1cf4d1d6).
|
|
13
14
|
* @default "bg-default"
|
|
14
15
|
*/
|
|
15
|
-
background?:
|
|
16
|
+
background?: BackgroundColorToken;
|
|
16
17
|
/**
|
|
17
18
|
* Allows better positioning of footer
|
|
18
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/layout/page/Page.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/layout/page/Page.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkC9C,MAAM,CAAC,MAAM,aAAa,GACxB,UAAU,CACR,CACE,EAUC,EACD,GAAG,EACH,EAAE;QAZF,EACE,EAAE,EAAE,SAAS,GAAG,KAAK,EACrB,SAAS,EACT,KAAK,EAAE,MAAM,EACb,MAAM,EACN,QAAQ,EACR,cAAc,EACd,UAAU,GAAG,YAAY,EACzB,mBAAmB,GAAG,KAAK,OAE5B,EADI,IAAI,cATT,yGAUC,CADQ;IAIT,MAAM,KAAK,mCACN,MAAM,KACT,wBAAwB,EAAE,WAAW,UAAU,GAAG,GACnD,CAAC;IAEF,MAAM,SAAS,GAAG,cAAc,KAAK,WAAW,CAAC;IAEjD,OAAO,CACL,oBAAC,SAAS,oBACJ,IAAI,IACR,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,EACtC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK;QAEZ,6BACE,SAAS,EAAE,EAAE,CAAC;gBACZ,iCAAiC,EAAE,SAAS;gBAC5C,2BAA2B,EAAE,CAAC,SAAS;gBACvC,8BAA8B,EAAE,mBAAmB,KAAK,KAAK;aAC9D,CAAC,IAED,QAAQ,CACL;QACL,MAAM,CACG,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,IAAI,GAAG,aAAkC,CAAC;AAEhD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;AAEvB,eAAe,IAAI,CAAC"}
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
-
import { Slot } from "../../
|
|
14
|
+
import { Slot } from "../../slot/Slot.js";
|
|
15
15
|
const Responsive = forwardRef((_a, ref) => {
|
|
16
16
|
var { as: Component = "div", className, above, below, variant, asChild } = _a, rest = __rest(_a, ["as", "className", "above", "below", "variant", "asChild"]);
|
|
17
17
|
const aboveProp = variant === "show" ? above : below;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OverridableComponent } from "../../util/types/index.js";
|
|
2
|
+
import { PrimitiveAsChildProps } from "../base/PrimitiveAsChildProps.js";
|
|
2
3
|
import { StackProps } from "./Stack.js";
|
|
3
|
-
export type HStackProps = Omit<StackProps, "direction">;
|
|
4
|
+
export type HStackProps = PrimitiveAsChildProps & Omit<StackProps, "direction">;
|
|
4
5
|
/**
|
|
5
6
|
* Layout-primitive for horizontal flexbox
|
|
6
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HStack.js","sourceRoot":"","sources":["../../../src/layout/stack/HStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"HStack.js","sourceRoot":"","sources":["../../../src/layout/stack/HStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,KAAK,EAAc,MAAM,SAAS,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,MAAM,GACjB,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACxB,OAAO,oBAAC,KAAK,oBAAK,KAAK,IAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,KAAK,IAAG,CAAC;AACxD,CAAC,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
2
|
import { OverridableComponent } from "../../util/types/index.js";
|
|
3
|
+
import { PrimitiveProps } from "../base/BasePrimitive.js";
|
|
4
|
+
import { PrimitiveAsChildProps } from "../base/PrimitiveAsChildProps.js";
|
|
3
5
|
import { ResponsiveProp, SpacingScale } from "../utilities/types.js";
|
|
4
|
-
export
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
+
export type StackProps = PrimitiveProps & PrimitiveAsChildProps & HTMLAttributes<HTMLDivElement> & {
|
|
6
7
|
/**
|
|
7
8
|
* CSS `justify-content` property.
|
|
8
9
|
*
|
|
@@ -13,6 +14,7 @@ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
13
14
|
justify?: ResponsiveProp<"start" | "center" | "end" | "space-around" | "space-between" | "space-evenly">;
|
|
14
15
|
/**
|
|
15
16
|
* CSS `align-items` property.
|
|
17
|
+
* @default "stretch"
|
|
16
18
|
*
|
|
17
19
|
* @example
|
|
18
20
|
* align='center'
|
|
@@ -30,9 +32,10 @@ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
30
32
|
*
|
|
31
33
|
* @example
|
|
32
34
|
* gap='4'
|
|
35
|
+
* gap='8 4'
|
|
33
36
|
* gap={{xs: '2', sm: '3', md: '4', lg: '5', xl: '6'}}
|
|
34
37
|
*/
|
|
35
|
-
gap?: ResponsiveProp<SpacingScale
|
|
38
|
+
gap?: ResponsiveProp<SpacingScale | `${SpacingScale} ${SpacingScale}`>;
|
|
36
39
|
/**
|
|
37
40
|
* CSS `flex-direction` property.
|
|
38
41
|
* @default "row"
|
|
@@ -42,6 +45,6 @@ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
42
45
|
* direction={{xs: 'row', sm: 'column'}}
|
|
43
46
|
*/
|
|
44
47
|
direction?: ResponsiveProp<"row" | "column" | "row-reverse" | "column-reverse">;
|
|
45
|
-
}
|
|
48
|
+
};
|
|
46
49
|
export declare const Stack: OverridableComponent<StackProps, HTMLDivElement>;
|
|
47
50
|
export default Stack;
|
|
@@ -11,14 +11,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
+
import { Slot } from "../../slot/Slot.js";
|
|
15
|
+
import { omit } from "../../util/index.js";
|
|
16
|
+
import BasePrimitive, { PRIMITIVE_PROPS, } from "../base/BasePrimitive.js";
|
|
14
17
|
import { getResponsiveProps, getResponsiveValue } from "../utilities/css.js";
|
|
15
18
|
export const Stack = forwardRef((_a, ref) => {
|
|
16
|
-
var { as: Component = "div",
|
|
19
|
+
var { children, className, as: Component = "div", align = "stretch", justify, wrap = true, gap, style: _style, direction = "row", asChild } = _a, rest = __rest(_a, ["children", "className", "as", "align", "justify", "wrap", "gap", "style", "direction", "asChild"]);
|
|
17
20
|
const style = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, _style), { "--__ac-stack-wrap": wrap ? "wrap" : "nowrap" }), getResponsiveProps(`stack`, "gap", "spacing", gap)), getResponsiveValue(`stack`, "direction", direction)), getResponsiveValue(`stack`, "align", align)), getResponsiveValue(`stack`, "justify", justify));
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const Comp = asChild ? Slot : Component;
|
|
22
|
+
return (React.createElement(BasePrimitive, Object.assign({}, rest),
|
|
23
|
+
React.createElement(Comp, Object.assign({}, omit(rest, PRIMITIVE_PROPS), { ref: ref, style: style, className: cl("navds-stack", className, {
|
|
24
|
+
"navds-vstack": direction === "column",
|
|
25
|
+
"navds-hstack": direction === "row",
|
|
26
|
+
}) }), children)));
|
|
22
27
|
});
|
|
23
28
|
export default Stack;
|
|
24
29
|
//# sourceMappingURL=Stack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../../src/layout/stack/Stack.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../../src/layout/stack/Stack.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,aAAa,EAAE,EACpB,eAAe,GAEhB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA0D1E,MAAM,CAAC,MAAM,KAAK,GAChB,UAAU,CACR,CACE,EAYC,EACD,GAAG,EACH,EAAE;QAdF,EACE,QAAQ,EACR,SAAS,EACT,EAAE,EAAE,SAAS,GAAG,KAAK,EACrB,KAAK,GAAG,SAAS,EACjB,OAAO,EACP,IAAI,GAAG,IAAI,EACX,GAAG,EACH,KAAK,EAAE,MAAM,EACb,SAAS,GAAG,KAAK,EACjB,OAAO,OAER,EADI,IAAI,cAXT,mGAYC,CADQ;IAIT,MAAM,KAAK,2FACN,MAAM,KACT,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,KAC1C,kBAAkB,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,GAClD,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,GACnD,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,GAC3C,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CACnD,CAAC;IAEF,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAExC,OAAO,CACL,oBAAC,aAAa,oBAAK,IAAI;QACrB,oBAAC,IAAI,oBACC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,IAC/B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE;gBACtC,cAAc,EAAE,SAAS,KAAK,QAAQ;gBACtC,cAAc,EAAE,SAAS,KAAK,KAAK;aACpC,CAAC,KAED,QAAQ,CACJ,CACO,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ,eAAe,KAAK,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OverridableComponent } from "../../util/types/index.js";
|
|
2
|
+
import { PrimitiveAsChildProps } from "../base/PrimitiveAsChildProps.js";
|
|
2
3
|
import { StackProps } from "./Stack.js";
|
|
3
|
-
export type VStackProps = Omit<StackProps, "direction" | "wrap">;
|
|
4
|
+
export type VStackProps = PrimitiveAsChildProps & Omit<StackProps, "direction" | "wrap">;
|
|
4
5
|
/**
|
|
5
6
|
* Layout-primitive for vetical flexbox
|
|
6
7
|
*
|