@ndla/primitives 1.0.87-alpha.0 → 1.0.89-alpha.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @ndla/primitives
2
2
 
3
- A set of primitive components used throughout ndla packages and websites. Mostly styled versions of components from [ ark-ui ](https://ark-ui.com).
3
+ A set of primitive components used throughout ndla packages and websites. Mostly styled versions of components from [ ark-ui ](https://ark-ui.com)
4
4
 
5
5
  ## Installation
6
6
 
@@ -283,6 +283,18 @@
283
283
  "color]___[value:stroke.default",
284
284
  "textDecoration]___[value:underline]___[cond:_checked",
285
285
  "textDecoration]___[value:underline]___[cond:_highlighted",
286
+ "animation]___[value:fade-shift-in 0.25s ease-in-out]___[cond:_open",
287
+ "animation]___[value:fade-shift-out 0.25s ease-in-out]___[cond:_closed",
288
+ "gap]___[value:5xsmall",
289
+ "borderCollapse]___[value:separate",
290
+ "borderSpacing]___[value:5xsmall",
291
+ "margin]___[value:-5xsmall",
292
+ "content]___[value:'-']___[cond:&[data-today]<___>_before",
293
+ "color]___[value:stroke.default]___[cond:&[data-today]<___>_before",
294
+ "position]___[value:absolute]___[cond:&[data-today]<___>_before",
295
+ "marginBlockStart]___[value:medium]___[cond:&[data-today]<___>_before",
296
+ "color]___[value:text.subtle]___[cond:&[data-outside-range]",
297
+ "fontWeight]___[value:normal]___[cond:&[data-outside-range]",
286
298
  "position]___[value:fixed",
287
299
  "height]___[value:100vh",
288
300
  "width]___[value:100vw",
package/dist/styles.css CHANGED
@@ -392,6 +392,22 @@
392
392
  color: var(--colors-stroke-default);
393
393
  }
394
394
 
395
+ .gap_5xsmall {
396
+ gap: var(--spacing-5xsmall);
397
+ }
398
+
399
+ .bd-cl_separate {
400
+ border-collapse: separate;
401
+ }
402
+
403
+ .bd-sp_5xsmall {
404
+ border-spacing: var(--spacing-5xsmall);
405
+ }
406
+
407
+ .m_-5xsmall {
408
+ margin: calc(var(--spacing-5xsmall) * -1);
409
+ }
410
+
395
411
  .pos_fixed {
396
412
  position: fixed;
397
413
  }
@@ -1709,6 +1725,18 @@
1709
1725
  text-decoration: underline;
1710
1726
  }
1711
1727
 
1728
+ .open\:anim_fade-shift-in_0\.25s_ease-in-out:is([open], [data-open], [data-state="open"]) {
1729
+ animation: fade-shift-in 0.25s ease-in-out;
1730
+ }
1731
+
1732
+ .closed\:anim_fade-shift-out_0\.25s_ease-in-out:is([closed], [data-closed], [data-state="closed"]) {
1733
+ animation: fade-shift-out 0.25s ease-in-out;
1734
+ }
1735
+
1736
+ .\[\&\[data-outside-range\]\]\:c_text\.subtle[data-outside-range] {
1737
+ color: var(--colors-text-subtle);
1738
+ }
1739
+
1712
1740
  .open\:anim_backdrop-in:is([open], [data-open], [data-state="open"]) {
1713
1741
  animation: var(--animations-backdrop-in);
1714
1742
  }
@@ -2064,6 +2092,10 @@
2064
2092
  transition-timing-function: var(--easings-default);
2065
2093
  }
2066
2094
 
2095
+ .\[\&\[data-outside-range\]\]\:fw_normal[data-outside-range] {
2096
+ font-weight: var(--font-weights-normal);
2097
+ }
2098
+
2067
2099
  .\[\&_\>_\*\]\:grid-cs_2 > * {
2068
2100
  grid-column-start: 2;
2069
2101
  }
@@ -2602,6 +2634,18 @@
2602
2634
  transform: rotate(180deg);
2603
2635
  }
2604
2636
 
2637
+ .\[\&\[data-today\]\]\:before\:c_stroke\.default[data-today]::before {
2638
+ color: var(--colors-stroke-default);
2639
+ }
2640
+
2641
+ .\[\&\[data-today\]\]\:before\:pos_absolute[data-today]::before {
2642
+ position: absolute;
2643
+ }
2644
+
2645
+ .\[\&\[data-today\]\]\:before\:mbs_medium[data-today]::before {
2646
+ margin-block-start: var(--spacing-medium);
2647
+ }
2648
+
2605
2649
  .open\:\[\&_summary\,_\[data-embed-type\=\'expandable-box-summary\'\]\]\:mbe_-xxsmall:is([open], [data-open], [data-state="open"]) summary,.open\:\[\&_summary\,_\[data-embed-type\=\'expandable-box-summary\'\]\]\:mbe_-xxsmall:is([open], [data-open], [data-state="open"]) [data-embed-type='expandable-box-summary'] {
2606
2650
  margin-block-end: calc(var(--spacing-xxsmall) * -1);
2607
2651
  }
@@ -2748,6 +2792,10 @@
2748
2792
  background-color: var(--colors-surface-default);
2749
2793
  }
2750
2794
 
2795
+ .\[\&\[data-today\]\]\:before\:content_\'-\'[data-today]::before {
2796
+ content: '-';
2797
+ }
2798
+
2751
2799
  .first\:hover\:bd-bs-c_var\(--border-hover\):first-child:is(:hover, [data-hover]) {
2752
2800
  border-block-start-color: var(--border-hover);
2753
2801
  }
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Copyright (c) 2024-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import { forwardRef } from "react";
10
+ import { DatePicker, datePickerAnatomy } from "@ark-ui/react";
11
+ import { sva } from "@ndla/styled-system/css";
12
+ import { createStyleContext } from "./createStyleContext";
13
+ import { Label } from "./Label";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ const datePickerRecipe = sva({
16
+ slots: datePickerAnatomy.keys(),
17
+ base: {
18
+ root: {
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ gap: "xsmall"
22
+ },
23
+ content: {
24
+ background: "surface.default",
25
+ borderRadius: "xsmall",
26
+ boxShadow: "large",
27
+ display: "flex",
28
+ flexDirection: "column",
29
+ gap: "xsmall",
30
+ padding: "xsmall",
31
+ zIndex: "dropdown",
32
+ _open: {
33
+ animation: "fade-shift-in 0.25s ease-in-out"
34
+ },
35
+ _closed: {
36
+ animation: "fade-shift-out 0.25s ease-in-out"
37
+ }
38
+ },
39
+ control: {
40
+ display: "flex",
41
+ width: "fit-content",
42
+ gap: "xsmall"
43
+ },
44
+ label: {},
45
+ tableHeader: {},
46
+ viewControl: {
47
+ display: "flex",
48
+ gap: "5xsmall",
49
+ justifyContent: "space-between"
50
+ },
51
+ table: {
52
+ width: "100%",
53
+ borderCollapse: "separate",
54
+ borderSpacing: "5xsmall",
55
+ margin: "-5xsmall"
56
+ },
57
+ tableCell: {
58
+ textAlign: "center"
59
+ },
60
+ tableCellTrigger: {
61
+ width: "100%",
62
+ "&[data-today]": {
63
+ _before: {
64
+ content: "'-'",
65
+ color: "stroke.default",
66
+ position: "absolute",
67
+ marginBlockStart: "medium"
68
+ }
69
+ },
70
+ "&[data-outside-range]": {
71
+ color: "text.subtle",
72
+ fontWeight: "normal"
73
+ }
74
+ },
75
+ view: {
76
+ display: "flex",
77
+ flexDirection: "column",
78
+ gap: "xsmall"
79
+ }
80
+ }
81
+ });
82
+ const {
83
+ withProvider,
84
+ withContext
85
+ } = createStyleContext(datePickerRecipe);
86
+ export const DatePickerRoot = withProvider(DatePicker.Root, "root", {
87
+ baseComponent: true
88
+ });
89
+ export const DatePickerClearTrigger = withContext(DatePicker.ClearTrigger, "clearTrigger", {
90
+ baseComponent: true
91
+ });
92
+ export const DatePickerContent = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(DatePickerPositioner, {
93
+ children: /*#__PURE__*/_jsx(DatePickerStandaloneContent, {
94
+ ...props,
95
+ ref: ref
96
+ })
97
+ }));
98
+ export const DatePickerStandaloneContent = withContext(DatePicker.Content, "content", {
99
+ baseComponent: true
100
+ });
101
+ export const DatePickerControl = withContext(DatePicker.Control, "control", {
102
+ baseComponent: true
103
+ });
104
+ export const DatePickerInput = withContext(DatePicker.Input, "input", {
105
+ baseComponent: true
106
+ });
107
+ const InternalDatePickerLabel = withContext(DatePicker.Label, "label");
108
+ export const DatePickerLabel = _ref => {
109
+ let {
110
+ textStyle = "label.medium",
111
+ fontWeight = "bold",
112
+ ...props
113
+ } = _ref;
114
+ return /*#__PURE__*/_jsx(InternalDatePickerLabel, {
115
+ asChild: true,
116
+ children: /*#__PURE__*/_jsx(Label, {
117
+ textStyle: textStyle,
118
+ fontWeight: fontWeight,
119
+ ...props
120
+ })
121
+ });
122
+ };
123
+ export const DatePickerMonthSelect = withContext(DatePicker.MonthSelect, "monthSelect", {
124
+ baseComponent: true
125
+ });
126
+ export const DatePickerNextTrigger = withContext(DatePicker.NextTrigger, "nextTrigger", {
127
+ baseComponent: true
128
+ });
129
+ export const DatePickerPositioner = withContext(DatePicker.Positioner, "positioner", {
130
+ baseComponent: true
131
+ });
132
+ export const DatePickerPresetTrigger = withContext(DatePicker.PresetTrigger, "presetTrigger", {
133
+ baseComponent: true
134
+ });
135
+ export const DatePickerPrevTrigger = withContext(DatePicker.PrevTrigger, "prevTrigger", {
136
+ baseComponent: true
137
+ });
138
+ export const DatePickerRangeText = withContext(DatePicker.RangeText, "rangeText", {
139
+ baseComponent: true
140
+ });
141
+ export const DatePickerTableBody = withContext(DatePicker.TableBody, "tableBody", {
142
+ baseComponent: true
143
+ });
144
+ export const DatePickerTableCell = withContext(DatePicker.TableCell, "tableCell", {
145
+ baseComponent: true
146
+ });
147
+ export const DatePickerTableCellTrigger = withContext(DatePicker.TableCellTrigger, "tableCellTrigger", {
148
+ baseComponent: true
149
+ });
150
+ export const DatePickerTableHead = withContext(DatePicker.TableHead, "tableHead", {
151
+ baseComponent: true
152
+ });
153
+ export const DatePickerTableHeader = withContext(DatePicker.TableHeader, "tableHeader", {
154
+ baseComponent: true
155
+ });
156
+ export const DatePickerTable = withContext(DatePicker.Table, "table", {
157
+ baseComponent: true
158
+ });
159
+ export const DatePickerTableRow = withContext(DatePicker.TableRow, "tableRow", {
160
+ baseComponent: true
161
+ });
162
+ export const DatePickerTrigger = withContext(DatePicker.Trigger, "trigger", {
163
+ baseComponent: true
164
+ });
165
+ export const DatePickerViewControl = withContext(DatePicker.ViewControl, "viewControl", {
166
+ baseComponent: true
167
+ });
168
+ export const DatePickerView = withContext(DatePicker.View, "view", {
169
+ baseComponent: true
170
+ });
171
+ export const DatePickerViewTrigger = withContext(DatePicker.ViewTrigger, "viewTrigger", {
172
+ baseComponent: true
173
+ });
174
+ export const DatePickerYearSelect = withContext(DatePicker.YearSelect, "yearSelect", {
175
+ baseComponent: true
176
+ });
177
+ export { DatePickerContext } from "@ark-ui/react";
package/es/index.js CHANGED
@@ -16,6 +16,7 @@ export { createStyleContext } from "./createStyleContext";
16
16
  export { ToggleGroupRoot, ToggleGroupItem } from "./ToggleGroup";
17
17
  export { CheckboxRoot, CheckboxIndicator, CheckboxLabel, CheckboxControl, CheckboxGroup, CheckboxHiddenInput } from "./Checkbox";
18
18
  export { ComboboxRoot, ComboboxClearTrigger, ComboboxContent, ComboboxContentStandalone, ComboboxControl, ComboboxInput, ComboboxItemGroupLabel, ComboboxItemGroup, ComboboxItemIndicator, ComboboxItem, ComboboxItemText, ComboboxLabel, ComboboxPositioner, ComboboxTrigger, ComboboxList } from "./Combobox";
19
+ export { DatePickerRoot, DatePickerClearTrigger, DatePickerContent, DatePickerStandaloneContent, DatePickerControl, DatePickerInput, DatePickerLabel, DatePickerMonthSelect, DatePickerNextTrigger, DatePickerPositioner, DatePickerPresetTrigger, DatePickerPrevTrigger, DatePickerRangeText, DatePickerTableBody, DatePickerTableCell, DatePickerTableCellTrigger, DatePickerTableHead, DatePickerTableHeader, DatePickerTable, DatePickerTableRow, DatePickerTrigger, DatePickerViewControl, DatePickerView, DatePickerViewTrigger, DatePickerYearSelect, DatePickerContext } from "./DatePicker";
19
20
  export { DialogRoot, DialogBackdrop, DialogStandaloneContent, DialogPositioner, DialogContent, DialogDescription, DialogTitle, DialogTrigger, DialogCloseTrigger, DialogHeader, DialogBody, DialogFooter, useDialog, DialogRootProvider } from "./Dialog";
20
21
  export { ExpandableBox, ExpandableBoxSummary } from "./ExpandableBox";
21
22
  export { ErrorMessageRoot, ErrorMessageContent, ErrorMessageActions, ErrorMessageDescription, ErrorMessageTitle } from "./ErrorMessage/ErrorMessage";
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Copyright (c) 2024-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { DatePicker } from "@ark-ui/react";
9
+ import type { JsxStyleProps } from "@ndla/styled-system/types";
10
+ import type { TextProps } from "./Text";
11
+ export interface DatePickerRootProps extends DatePicker.RootProps, JsxStyleProps {
12
+ translations: DatePicker.RootProps["translations"];
13
+ locale: DatePicker.RootProps["locale"];
14
+ }
15
+ export declare const DatePickerRoot: import("react").ForwardRefExoticComponent<DatePickerRootProps & import("react").RefAttributes<HTMLDivElement>>;
16
+ interface ClearTriggerProps extends DatePicker.ClearTriggerProps, JsxStyleProps {
17
+ }
18
+ export declare const DatePickerClearTrigger: import("react").ForwardRefExoticComponent<ClearTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
19
+ export declare const DatePickerContent: import("react").ForwardRefExoticComponent<DatePicker.ContentProps & {
20
+ consumeCss?: boolean;
21
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
22
+ interface DatePickerContentProps extends DatePicker.ContentProps, JsxStyleProps {
23
+ }
24
+ export declare const DatePickerStandaloneContent: import("react").ForwardRefExoticComponent<DatePickerContentProps & import("react").RefAttributes<HTMLDivElement>>;
25
+ interface DatePickerControlProps extends DatePicker.ControlProps, JsxStyleProps {
26
+ }
27
+ export declare const DatePickerControl: import("react").ForwardRefExoticComponent<DatePickerControlProps & import("react").RefAttributes<HTMLDivElement>>;
28
+ interface DatePickerInputProps extends DatePicker.InputProps, JsxStyleProps {
29
+ }
30
+ export declare const DatePickerInput: import("react").ForwardRefExoticComponent<DatePickerInputProps & import("react").RefAttributes<HTMLInputElement>>;
31
+ interface DatePickerLabelProps extends DatePicker.LabelProps, JsxStyleProps {
32
+ }
33
+ export declare const DatePickerLabel: ({ textStyle, fontWeight, ...props }: DatePickerLabelProps & TextProps) => import("react/jsx-runtime").JSX.Element;
34
+ interface DatePickerMonthSelectProps extends DatePicker.MonthSelectProps, JsxStyleProps {
35
+ }
36
+ export declare const DatePickerMonthSelect: import("react").ForwardRefExoticComponent<DatePickerMonthSelectProps & import("react").RefAttributes<HTMLSelectElement>>;
37
+ interface DatePickerNextTrigger extends DatePicker.NextTriggerProps, JsxStyleProps {
38
+ }
39
+ export declare const DatePickerNextTrigger: import("react").ForwardRefExoticComponent<DatePickerNextTrigger & import("react").RefAttributes<HTMLButtonElement>>;
40
+ interface DatePickerPositionerProps extends DatePicker.PositionerProps, JsxStyleProps {
41
+ }
42
+ export declare const DatePickerPositioner: import("react").ForwardRefExoticComponent<DatePickerPositionerProps & import("react").RefAttributes<HTMLDivElement>>;
43
+ interface DatePickerPresetTriggerProps extends DatePicker.PresetTriggerProps, JsxStyleProps {
44
+ }
45
+ export declare const DatePickerPresetTrigger: import("react").ForwardRefExoticComponent<DatePickerPresetTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
46
+ interface DatePickerPrevTriggerProps extends DatePicker.PrevTriggerProps, JsxStyleProps {
47
+ }
48
+ export declare const DatePickerPrevTrigger: import("react").ForwardRefExoticComponent<DatePickerPrevTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
49
+ interface DatePickerRangeTextProps extends DatePicker.RangeTextProps, JsxStyleProps {
50
+ }
51
+ export declare const DatePickerRangeText: import("react").ForwardRefExoticComponent<DatePickerRangeTextProps & import("react").RefAttributes<HTMLDivElement>>;
52
+ interface DatePickerTableBodyProps extends DatePicker.TableBodyProps, JsxStyleProps {
53
+ }
54
+ export declare const DatePickerTableBody: import("react").ForwardRefExoticComponent<DatePickerTableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
55
+ interface DatePickerTableCellProps extends DatePicker.TableCellProps, JsxStyleProps {
56
+ }
57
+ export declare const DatePickerTableCell: import("react").ForwardRefExoticComponent<DatePickerTableCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
58
+ interface DatePickerTableCellTriggerProps extends DatePicker.TableCellTriggerProps, JsxStyleProps {
59
+ }
60
+ export declare const DatePickerTableCellTrigger: import("react").ForwardRefExoticComponent<DatePickerTableCellTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
61
+ interface DatePickerTableHeadProps extends DatePicker.TableHeadProps, JsxStyleProps {
62
+ }
63
+ export declare const DatePickerTableHead: import("react").ForwardRefExoticComponent<DatePickerTableHeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
64
+ interface DatePickerTableHeaderProps extends DatePicker.TableHeaderProps, JsxStyleProps {
65
+ }
66
+ export declare const DatePickerTableHeader: import("react").ForwardRefExoticComponent<DatePickerTableHeaderProps & import("react").RefAttributes<HTMLTableCellElement>>;
67
+ interface DatePickerTableProps extends DatePicker.TableProps, JsxStyleProps {
68
+ }
69
+ export declare const DatePickerTable: import("react").ForwardRefExoticComponent<DatePickerTableProps & import("react").RefAttributes<HTMLTableElement>>;
70
+ interface DatePickerTableRowProps extends DatePicker.TableRowProps, JsxStyleProps {
71
+ }
72
+ export declare const DatePickerTableRow: import("react").ForwardRefExoticComponent<DatePickerTableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
73
+ interface DatePickerTriggerProps extends DatePicker.TriggerProps, JsxStyleProps {
74
+ }
75
+ export declare const DatePickerTrigger: import("react").ForwardRefExoticComponent<DatePickerTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
76
+ interface DatePickerViewControlProps extends DatePicker.ViewControlProps, JsxStyleProps {
77
+ }
78
+ export declare const DatePickerViewControl: import("react").ForwardRefExoticComponent<DatePickerViewControlProps & import("react").RefAttributes<HTMLDivElement>>;
79
+ interface DatePickerViewProps extends DatePicker.ViewProps, JsxStyleProps {
80
+ }
81
+ export declare const DatePickerView: import("react").ForwardRefExoticComponent<DatePickerViewProps & import("react").RefAttributes<HTMLDivElement>>;
82
+ interface DatePickerViewTriggerProps extends DatePicker.ViewTriggerProps, JsxStyleProps {
83
+ }
84
+ export declare const DatePickerViewTrigger: import("react").ForwardRefExoticComponent<DatePickerViewTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
85
+ interface DatePickerYearSelectProps extends DatePicker.YearSelectProps, JsxStyleProps {
86
+ }
87
+ export declare const DatePickerYearSelect: import("react").ForwardRefExoticComponent<DatePickerYearSelectProps & import("react").RefAttributes<HTMLSelectElement>>;
88
+ export { DatePickerContext } from "@ark-ui/react";
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DatePickerContent = exports.DatePickerClearTrigger = void 0;
7
+ Object.defineProperty(exports, "DatePickerContext", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _react2.DatePickerContext;
11
+ }
12
+ });
13
+ exports.DatePickerYearSelect = exports.DatePickerViewTrigger = exports.DatePickerViewControl = exports.DatePickerView = exports.DatePickerTrigger = exports.DatePickerTableRow = exports.DatePickerTableHeader = exports.DatePickerTableHead = exports.DatePickerTableCellTrigger = exports.DatePickerTableCell = exports.DatePickerTableBody = exports.DatePickerTable = exports.DatePickerStandaloneContent = exports.DatePickerRoot = exports.DatePickerRangeText = exports.DatePickerPrevTrigger = exports.DatePickerPresetTrigger = exports.DatePickerPositioner = exports.DatePickerNextTrigger = exports.DatePickerMonthSelect = exports.DatePickerLabel = exports.DatePickerInput = exports.DatePickerControl = void 0;
14
+ var _react = require("react");
15
+ var _react2 = require("@ark-ui/react");
16
+ var _css = require("@ndla/styled-system/css");
17
+ var _createStyleContext = require("./createStyleContext");
18
+ var _Label = require("./Label");
19
+ var _jsxRuntime = require("react/jsx-runtime");
20
+ /**
21
+ * Copyright (c) 2024-present, NDLA.
22
+ *
23
+ * This source code is licensed under the GPLv3 license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ *
26
+ */
27
+
28
+ const datePickerRecipe = (0, _css.sva)({
29
+ slots: _react2.datePickerAnatomy.keys(),
30
+ base: {
31
+ root: {
32
+ display: "flex",
33
+ flexDirection: "column",
34
+ gap: "xsmall"
35
+ },
36
+ content: {
37
+ background: "surface.default",
38
+ borderRadius: "xsmall",
39
+ boxShadow: "large",
40
+ display: "flex",
41
+ flexDirection: "column",
42
+ gap: "xsmall",
43
+ padding: "xsmall",
44
+ zIndex: "dropdown",
45
+ _open: {
46
+ animation: "fade-shift-in 0.25s ease-in-out"
47
+ },
48
+ _closed: {
49
+ animation: "fade-shift-out 0.25s ease-in-out"
50
+ }
51
+ },
52
+ control: {
53
+ display: "flex",
54
+ width: "fit-content",
55
+ gap: "xsmall"
56
+ },
57
+ label: {},
58
+ tableHeader: {},
59
+ viewControl: {
60
+ display: "flex",
61
+ gap: "5xsmall",
62
+ justifyContent: "space-between"
63
+ },
64
+ table: {
65
+ width: "100%",
66
+ borderCollapse: "separate",
67
+ borderSpacing: "5xsmall",
68
+ margin: "-5xsmall"
69
+ },
70
+ tableCell: {
71
+ textAlign: "center"
72
+ },
73
+ tableCellTrigger: {
74
+ width: "100%",
75
+ "&[data-today]": {
76
+ _before: {
77
+ content: "'-'",
78
+ color: "stroke.default",
79
+ position: "absolute",
80
+ marginBlockStart: "medium"
81
+ }
82
+ },
83
+ "&[data-outside-range]": {
84
+ color: "text.subtle",
85
+ fontWeight: "normal"
86
+ }
87
+ },
88
+ view: {
89
+ display: "flex",
90
+ flexDirection: "column",
91
+ gap: "xsmall"
92
+ }
93
+ }
94
+ });
95
+ const {
96
+ withProvider,
97
+ withContext
98
+ } = (0, _createStyleContext.createStyleContext)(datePickerRecipe);
99
+ const DatePickerRoot = exports.DatePickerRoot = withProvider(_react2.DatePicker.Root, "root", {
100
+ baseComponent: true
101
+ });
102
+ const DatePickerClearTrigger = exports.DatePickerClearTrigger = withContext(_react2.DatePicker.ClearTrigger, "clearTrigger", {
103
+ baseComponent: true
104
+ });
105
+ const DatePickerContent = exports.DatePickerContent = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(DatePickerPositioner, {
106
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DatePickerStandaloneContent, {
107
+ ...props,
108
+ ref: ref
109
+ })
110
+ }));
111
+ const DatePickerStandaloneContent = exports.DatePickerStandaloneContent = withContext(_react2.DatePicker.Content, "content", {
112
+ baseComponent: true
113
+ });
114
+ const DatePickerControl = exports.DatePickerControl = withContext(_react2.DatePicker.Control, "control", {
115
+ baseComponent: true
116
+ });
117
+ const DatePickerInput = exports.DatePickerInput = withContext(_react2.DatePicker.Input, "input", {
118
+ baseComponent: true
119
+ });
120
+ const InternalDatePickerLabel = withContext(_react2.DatePicker.Label, "label");
121
+ const DatePickerLabel = _ref => {
122
+ let {
123
+ textStyle = "label.medium",
124
+ fontWeight = "bold",
125
+ ...props
126
+ } = _ref;
127
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalDatePickerLabel, {
128
+ asChild: true,
129
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Label.Label, {
130
+ textStyle: textStyle,
131
+ fontWeight: fontWeight,
132
+ ...props
133
+ })
134
+ });
135
+ };
136
+ exports.DatePickerLabel = DatePickerLabel;
137
+ const DatePickerMonthSelect = exports.DatePickerMonthSelect = withContext(_react2.DatePicker.MonthSelect, "monthSelect", {
138
+ baseComponent: true
139
+ });
140
+ const DatePickerNextTrigger = exports.DatePickerNextTrigger = withContext(_react2.DatePicker.NextTrigger, "nextTrigger", {
141
+ baseComponent: true
142
+ });
143
+ const DatePickerPositioner = exports.DatePickerPositioner = withContext(_react2.DatePicker.Positioner, "positioner", {
144
+ baseComponent: true
145
+ });
146
+ const DatePickerPresetTrigger = exports.DatePickerPresetTrigger = withContext(_react2.DatePicker.PresetTrigger, "presetTrigger", {
147
+ baseComponent: true
148
+ });
149
+ const DatePickerPrevTrigger = exports.DatePickerPrevTrigger = withContext(_react2.DatePicker.PrevTrigger, "prevTrigger", {
150
+ baseComponent: true
151
+ });
152
+ const DatePickerRangeText = exports.DatePickerRangeText = withContext(_react2.DatePicker.RangeText, "rangeText", {
153
+ baseComponent: true
154
+ });
155
+ const DatePickerTableBody = exports.DatePickerTableBody = withContext(_react2.DatePicker.TableBody, "tableBody", {
156
+ baseComponent: true
157
+ });
158
+ const DatePickerTableCell = exports.DatePickerTableCell = withContext(_react2.DatePicker.TableCell, "tableCell", {
159
+ baseComponent: true
160
+ });
161
+ const DatePickerTableCellTrigger = exports.DatePickerTableCellTrigger = withContext(_react2.DatePicker.TableCellTrigger, "tableCellTrigger", {
162
+ baseComponent: true
163
+ });
164
+ const DatePickerTableHead = exports.DatePickerTableHead = withContext(_react2.DatePicker.TableHead, "tableHead", {
165
+ baseComponent: true
166
+ });
167
+ const DatePickerTableHeader = exports.DatePickerTableHeader = withContext(_react2.DatePicker.TableHeader, "tableHeader", {
168
+ baseComponent: true
169
+ });
170
+ const DatePickerTable = exports.DatePickerTable = withContext(_react2.DatePicker.Table, "table", {
171
+ baseComponent: true
172
+ });
173
+ const DatePickerTableRow = exports.DatePickerTableRow = withContext(_react2.DatePicker.TableRow, "tableRow", {
174
+ baseComponent: true
175
+ });
176
+ const DatePickerTrigger = exports.DatePickerTrigger = withContext(_react2.DatePicker.Trigger, "trigger", {
177
+ baseComponent: true
178
+ });
179
+ const DatePickerViewControl = exports.DatePickerViewControl = withContext(_react2.DatePicker.ViewControl, "viewControl", {
180
+ baseComponent: true
181
+ });
182
+ const DatePickerView = exports.DatePickerView = withContext(_react2.DatePicker.View, "view", {
183
+ baseComponent: true
184
+ });
185
+ const DatePickerViewTrigger = exports.DatePickerViewTrigger = withContext(_react2.DatePicker.ViewTrigger, "viewTrigger", {
186
+ baseComponent: true
187
+ });
188
+ const DatePickerYearSelect = exports.DatePickerYearSelect = withContext(_react2.DatePicker.YearSelect, "yearSelect", {
189
+ baseComponent: true
190
+ });
package/lib/index.d.ts CHANGED
@@ -24,6 +24,8 @@ export type { CheckboxVariantProps, CheckboxRootProps } from "./Checkbox";
24
24
  export { CheckboxRoot, CheckboxIndicator, CheckboxLabel, CheckboxControl, CheckboxGroup, CheckboxHiddenInput, } from "./Checkbox";
25
25
  export type { ComboboxVariantProps, ComboboxRootProps, ComboboxClearTriggerProps, ComboboxContentProps, ComboboxControlProps, ComboboxInputProps, ComboboxItemGroupLabelProps, ComboboxItemGroupProps, ComboboxItemProps, ComboboxItemIndicatorProps, ComboboxItemTextProps, ComboboxLabelProps, ComboboxPositionerProps, ComboboxTriggerProps, ComboboxListProps, } from "./Combobox";
26
26
  export { ComboboxRoot, ComboboxClearTrigger, ComboboxContent, ComboboxContentStandalone, ComboboxControl, ComboboxInput, ComboboxItemGroupLabel, ComboboxItemGroup, ComboboxItemIndicator, ComboboxItem, ComboboxItemText, ComboboxLabel, ComboboxPositioner, ComboboxTrigger, ComboboxList, } from "./Combobox";
27
+ export type { DatePickerRootProps } from "./DatePicker";
28
+ export { DatePickerRoot, DatePickerClearTrigger, DatePickerContent, DatePickerStandaloneContent, DatePickerControl, DatePickerInput, DatePickerLabel, DatePickerMonthSelect, DatePickerNextTrigger, DatePickerPositioner, DatePickerPresetTrigger, DatePickerPrevTrigger, DatePickerRangeText, DatePickerTableBody, DatePickerTableCell, DatePickerTableCellTrigger, DatePickerTableHead, DatePickerTableHeader, DatePickerTable, DatePickerTableRow, DatePickerTrigger, DatePickerViewControl, DatePickerView, DatePickerViewTrigger, DatePickerYearSelect, DatePickerContext, } from "./DatePicker";
27
29
  export type { DialogVariantProps, DialogRootProps } from "./Dialog";
28
30
  export { DialogRoot, DialogBackdrop, DialogStandaloneContent, DialogPositioner, DialogContent, DialogDescription, DialogTitle, DialogTrigger, DialogCloseTrigger, DialogHeader, DialogBody, DialogFooter, useDialog, DialogRootProvider, } from "./Dialog";
29
31
  export type { ExpandableBoxProps, ExpandableBoxSummaryProps } from "./ExpandableBox";
package/lib/index.js CHANGED
@@ -207,6 +207,162 @@ Object.defineProperty(exports, "ComboboxTrigger", {
207
207
  return _Combobox.ComboboxTrigger;
208
208
  }
209
209
  });
210
+ Object.defineProperty(exports, "DatePickerClearTrigger", {
211
+ enumerable: true,
212
+ get: function () {
213
+ return _DatePicker.DatePickerClearTrigger;
214
+ }
215
+ });
216
+ Object.defineProperty(exports, "DatePickerContent", {
217
+ enumerable: true,
218
+ get: function () {
219
+ return _DatePicker.DatePickerContent;
220
+ }
221
+ });
222
+ Object.defineProperty(exports, "DatePickerContext", {
223
+ enumerable: true,
224
+ get: function () {
225
+ return _DatePicker.DatePickerContext;
226
+ }
227
+ });
228
+ Object.defineProperty(exports, "DatePickerControl", {
229
+ enumerable: true,
230
+ get: function () {
231
+ return _DatePicker.DatePickerControl;
232
+ }
233
+ });
234
+ Object.defineProperty(exports, "DatePickerInput", {
235
+ enumerable: true,
236
+ get: function () {
237
+ return _DatePicker.DatePickerInput;
238
+ }
239
+ });
240
+ Object.defineProperty(exports, "DatePickerLabel", {
241
+ enumerable: true,
242
+ get: function () {
243
+ return _DatePicker.DatePickerLabel;
244
+ }
245
+ });
246
+ Object.defineProperty(exports, "DatePickerMonthSelect", {
247
+ enumerable: true,
248
+ get: function () {
249
+ return _DatePicker.DatePickerMonthSelect;
250
+ }
251
+ });
252
+ Object.defineProperty(exports, "DatePickerNextTrigger", {
253
+ enumerable: true,
254
+ get: function () {
255
+ return _DatePicker.DatePickerNextTrigger;
256
+ }
257
+ });
258
+ Object.defineProperty(exports, "DatePickerPositioner", {
259
+ enumerable: true,
260
+ get: function () {
261
+ return _DatePicker.DatePickerPositioner;
262
+ }
263
+ });
264
+ Object.defineProperty(exports, "DatePickerPresetTrigger", {
265
+ enumerable: true,
266
+ get: function () {
267
+ return _DatePicker.DatePickerPresetTrigger;
268
+ }
269
+ });
270
+ Object.defineProperty(exports, "DatePickerPrevTrigger", {
271
+ enumerable: true,
272
+ get: function () {
273
+ return _DatePicker.DatePickerPrevTrigger;
274
+ }
275
+ });
276
+ Object.defineProperty(exports, "DatePickerRangeText", {
277
+ enumerable: true,
278
+ get: function () {
279
+ return _DatePicker.DatePickerRangeText;
280
+ }
281
+ });
282
+ Object.defineProperty(exports, "DatePickerRoot", {
283
+ enumerable: true,
284
+ get: function () {
285
+ return _DatePicker.DatePickerRoot;
286
+ }
287
+ });
288
+ Object.defineProperty(exports, "DatePickerStandaloneContent", {
289
+ enumerable: true,
290
+ get: function () {
291
+ return _DatePicker.DatePickerStandaloneContent;
292
+ }
293
+ });
294
+ Object.defineProperty(exports, "DatePickerTable", {
295
+ enumerable: true,
296
+ get: function () {
297
+ return _DatePicker.DatePickerTable;
298
+ }
299
+ });
300
+ Object.defineProperty(exports, "DatePickerTableBody", {
301
+ enumerable: true,
302
+ get: function () {
303
+ return _DatePicker.DatePickerTableBody;
304
+ }
305
+ });
306
+ Object.defineProperty(exports, "DatePickerTableCell", {
307
+ enumerable: true,
308
+ get: function () {
309
+ return _DatePicker.DatePickerTableCell;
310
+ }
311
+ });
312
+ Object.defineProperty(exports, "DatePickerTableCellTrigger", {
313
+ enumerable: true,
314
+ get: function () {
315
+ return _DatePicker.DatePickerTableCellTrigger;
316
+ }
317
+ });
318
+ Object.defineProperty(exports, "DatePickerTableHead", {
319
+ enumerable: true,
320
+ get: function () {
321
+ return _DatePicker.DatePickerTableHead;
322
+ }
323
+ });
324
+ Object.defineProperty(exports, "DatePickerTableHeader", {
325
+ enumerable: true,
326
+ get: function () {
327
+ return _DatePicker.DatePickerTableHeader;
328
+ }
329
+ });
330
+ Object.defineProperty(exports, "DatePickerTableRow", {
331
+ enumerable: true,
332
+ get: function () {
333
+ return _DatePicker.DatePickerTableRow;
334
+ }
335
+ });
336
+ Object.defineProperty(exports, "DatePickerTrigger", {
337
+ enumerable: true,
338
+ get: function () {
339
+ return _DatePicker.DatePickerTrigger;
340
+ }
341
+ });
342
+ Object.defineProperty(exports, "DatePickerView", {
343
+ enumerable: true,
344
+ get: function () {
345
+ return _DatePicker.DatePickerView;
346
+ }
347
+ });
348
+ Object.defineProperty(exports, "DatePickerViewControl", {
349
+ enumerable: true,
350
+ get: function () {
351
+ return _DatePicker.DatePickerViewControl;
352
+ }
353
+ });
354
+ Object.defineProperty(exports, "DatePickerViewTrigger", {
355
+ enumerable: true,
356
+ get: function () {
357
+ return _DatePicker.DatePickerViewTrigger;
358
+ }
359
+ });
360
+ Object.defineProperty(exports, "DatePickerYearSelect", {
361
+ enumerable: true,
362
+ get: function () {
363
+ return _DatePicker.DatePickerYearSelect;
364
+ }
365
+ });
210
366
  Object.defineProperty(exports, "DefinitionList", {
211
367
  enumerable: true,
212
368
  get: function () {
@@ -1393,6 +1549,7 @@ var _createStyleContext = require("./createStyleContext");
1393
1549
  var _ToggleGroup = require("./ToggleGroup");
1394
1550
  var _Checkbox = require("./Checkbox");
1395
1551
  var _Combobox = require("./Combobox");
1552
+ var _DatePicker = require("./DatePicker");
1396
1553
  var _Dialog = require("./Dialog");
1397
1554
  var _ExpandableBox = require("./ExpandableBox");
1398
1555
  var _ErrorMessage = require("./ErrorMessage/ErrorMessage");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/primitives",
3
- "version": "1.0.87-alpha.0",
3
+ "version": "1.0.89-alpha.0",
4
4
  "description": "Primitive components for NDLA",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "168853a36b0654ff01db41b8b78e81b1afb66768"
46
+ "gitHead": "dc0f32d958e7f1df5a4330a412ad3ce03452d300"
47
47
  }