@gnist/design-system 3.8.4 → 3.9.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/components/actions/chips/ActionChip.cjs +4 -4
  3. package/dist/components/actions/chips/ActionChip.d.ts +1 -1
  4. package/dist/components/actions/chips/ActionChip.d.ts.map +1 -1
  5. package/dist/components/actions/chips/ActionChip.js +4 -4
  6. package/dist/components/actions/chips/FilterChip.cjs +4 -4
  7. package/dist/components/actions/chips/FilterChip.d.ts +1 -1
  8. package/dist/components/actions/chips/FilterChip.d.ts.map +1 -1
  9. package/dist/components/actions/chips/FilterChip.js +4 -4
  10. package/dist/components/actions/chips/TagChip.cjs +4 -4
  11. package/dist/components/actions/chips/TagChip.d.ts +1 -1
  12. package/dist/components/actions/chips/TagChip.d.ts.map +1 -1
  13. package/dist/components/actions/chips/TagChip.js +4 -4
  14. package/dist/components/actions/index.cjs +2 -0
  15. package/dist/components/actions/index.js +2 -0
  16. package/dist/components/actions/selectionControls/Checkbox.cjs +5 -5
  17. package/dist/components/actions/selectionControls/Checkbox.d.ts +5 -2
  18. package/dist/components/actions/selectionControls/Checkbox.d.ts.map +1 -1
  19. package/dist/components/actions/selectionControls/Checkbox.js +5 -5
  20. package/dist/components/actions/selectionControls/RadioButton.cjs +5 -5
  21. package/dist/components/actions/selectionControls/RadioButton.d.ts +5 -2
  22. package/dist/components/actions/selectionControls/RadioButton.d.ts.map +1 -1
  23. package/dist/components/actions/selectionControls/RadioButton.js +5 -5
  24. package/dist/components/actions/selectionControls/Switch.cjs +49 -0
  25. package/dist/components/actions/selectionControls/Switch.d.ts +17 -0
  26. package/dist/components/actions/selectionControls/Switch.d.ts.map +1 -0
  27. package/dist/components/actions/selectionControls/Switch.js +49 -0
  28. package/dist/components/actions/selectionControls/index.cjs +2 -0
  29. package/dist/components/actions/selectionControls/index.d.ts +1 -0
  30. package/dist/components/actions/selectionControls/index.d.ts.map +1 -1
  31. package/dist/components/actions/selectionControls/index.js +3 -1
  32. package/dist/components/actions/selectionControls/switch.css.cjs +165 -0
  33. package/dist/components/actions/selectionControls/switch.css.d.ts +46 -0
  34. package/dist/components/actions/selectionControls/switch.css.d.ts.map +1 -0
  35. package/dist/components/actions/selectionControls/switch.css.js +165 -0
  36. package/dist/components/index.cjs +2 -0
  37. package/dist/components/index.js +2 -0
  38. package/dist/components/inputs/dropdowns/MultiSelect.cjs +3 -4
  39. package/dist/components/inputs/dropdowns/MultiSelect.d.ts +1 -1
  40. package/dist/components/inputs/dropdowns/MultiSelect.d.ts.map +1 -1
  41. package/dist/components/inputs/dropdowns/MultiSelect.js +3 -4
  42. package/dist/components/inputs/dropdowns/SelectBase.cjs +9 -7
  43. package/dist/components/inputs/dropdowns/SelectBase.d.ts +1 -2
  44. package/dist/components/inputs/dropdowns/SelectBase.d.ts.map +1 -1
  45. package/dist/components/inputs/dropdowns/SelectBase.js +9 -7
  46. package/dist/components/inputs/dropdowns/SingleSelect.cjs +3 -4
  47. package/dist/components/inputs/dropdowns/SingleSelect.d.ts +1 -1
  48. package/dist/components/inputs/dropdowns/SingleSelect.d.ts.map +1 -1
  49. package/dist/components/inputs/dropdowns/SingleSelect.js +3 -4
  50. package/dist/components/inputs/pickers/calendar.cjs +9 -7
  51. package/dist/components/inputs/pickers/calendar.d.ts +3 -1
  52. package/dist/components/inputs/pickers/calendar.d.ts.map +1 -1
  53. package/dist/components/inputs/pickers/calendar.js +10 -8
  54. package/dist/components/inputs/textFields/TextArea.cjs +5 -5
  55. package/dist/components/inputs/textFields/TextArea.d.ts +3 -17
  56. package/dist/components/inputs/textFields/TextArea.d.ts.map +1 -1
  57. package/dist/components/inputs/textFields/TextArea.js +5 -5
  58. package/dist/components/inputs/textFields/TextField.cjs +5 -5
  59. package/dist/components/inputs/textFields/TextField.d.ts +5 -3
  60. package/dist/components/inputs/textFields/TextField.d.ts.map +1 -1
  61. package/dist/components/inputs/textFields/TextField.js +5 -5
  62. package/dist/components/surfaces/modal/Modal.cjs +10 -5
  63. package/dist/components/surfaces/modal/Modal.js +10 -5
  64. package/dist/foundation/typography/index.d.ts +2 -4
  65. package/dist/foundation/typography/index.d.ts.map +1 -1
  66. package/dist/index.cjs +2 -0
  67. package/dist/index.js +2 -0
  68. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -1,7 +1,9 @@
1
1
  "use client";
2
2
  import { Checkbox } from "./Checkbox.js";
3
3
  import { RadioButton } from "./RadioButton.js";
4
+ import { Switch } from "./Switch.js";
4
5
  export {
5
6
  Checkbox,
6
- RadioButton
7
+ RadioButton,
8
+ Switch
7
9
  };
@@ -0,0 +1,165 @@
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const atoms_css_js = require("@gnist/themes/atoms.css.js");
5
+ const tokens_css_js = require("@gnist/themes/tokens.css.js");
6
+ const recipes = require("@vanilla-extract/recipes");
7
+ const css = require("@vanilla-extract/css");
8
+ const switchContainerStyle = css.style({
9
+ display: "flex",
10
+ alignItems: "center"
11
+ });
12
+ const switchContainer = css.style([
13
+ {
14
+ position: "relative",
15
+ display: "inline-flex",
16
+ cursor: "pointer",
17
+ transition: "background-color 0.2s ease"
18
+ },
19
+ atoms_css_js.atoms({
20
+ borderRadius: "full",
21
+ width: "xxl",
22
+ height: "l"
23
+ })
24
+ ]);
25
+ const SwitchRecipe = recipes.recipe({
26
+ base: [
27
+ switchContainer,
28
+ atoms_css_js.atoms({
29
+ borderColor: "outline"
30
+ }),
31
+ {
32
+ borderWidth: "1px",
33
+ borderStyle: "solid",
34
+ boxSizing: "border-box"
35
+ },
36
+ {
37
+ selectors: {
38
+ "&:focus:not(:focus-visible)": {
39
+ outline: "none"
40
+ },
41
+ "&:has(:focus-visible)": {
42
+ outline: `${tokens_css_js.tokens.stroke.medium} solid ${tokens_css_js.tokens.color.interactive}`
43
+ }
44
+ }
45
+ }
46
+ ],
47
+ variants: {
48
+ selected: {
49
+ true: [
50
+ atoms_css_js.atoms({
51
+ backgroundColor: "success"
52
+ })
53
+ ],
54
+ false: [
55
+ atoms_css_js.atoms({
56
+ backgroundColor: "surface-variant"
57
+ })
58
+ ]
59
+ },
60
+ disabled: {
61
+ true: [
62
+ atoms_css_js.atoms({
63
+ backgroundColor: "disabled",
64
+ borderColor: "disabled"
65
+ }),
66
+ {
67
+ cursor: "not-allowed",
68
+ opacity: 0.6
69
+ }
70
+ ],
71
+ false: {}
72
+ },
73
+ validity: {
74
+ error: [
75
+ atoms_css_js.atoms({
76
+ borderColor: "error"
77
+ })
78
+ ]
79
+ }
80
+ }
81
+ });
82
+ const switchThumb = css.style({
83
+ position: "absolute",
84
+ top: "50%",
85
+ transform: "translateY(-50%)",
86
+ transition: "left 0.2s ease, background-color 0.2s ease",
87
+ borderRadius: "50%",
88
+ backgroundColor: tokens_css_js.tokens.palette.white,
89
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.3)"
90
+ });
91
+ const SwitchThumbRecipe = recipes.recipe({
92
+ base: [
93
+ switchThumb,
94
+ atoms_css_js.atoms({
95
+ width: "m",
96
+ height: "m"
97
+ })
98
+ ],
99
+ variants: {
100
+ selected: {
101
+ true: {
102
+ left: `calc(100% - ${tokens_css_js.tokens.spacing.m} - 1px)`
103
+ },
104
+ false: {
105
+ left: "1px"
106
+ }
107
+ },
108
+ disabled: {
109
+ true: [
110
+ atoms_css_js.atoms({
111
+ backgroundColor: "on-disabled"
112
+ })
113
+ ],
114
+ false: {}
115
+ }
116
+ }
117
+ });
118
+ const switchLabel = css.style([
119
+ {
120
+ userSelect: "none",
121
+ fontSize: tokens_css_js.tokens.type.small.body.fontSize,
122
+ lineHeight: tokens_css_js.tokens.type.small.body.lineHeight
123
+ },
124
+ atoms_css_js.atoms({
125
+ color: "on-surface"
126
+ })
127
+ ]);
128
+ const SwitchLabelRecipe = recipes.recipe({
129
+ base: [switchLabel],
130
+ variants: {
131
+ disabled: {
132
+ true: [
133
+ atoms_css_js.atoms({
134
+ color: "on-disabled"
135
+ })
136
+ ],
137
+ false: {}
138
+ },
139
+ side: {
140
+ left: [
141
+ atoms_css_js.atoms({
142
+ marginRight: "xxs"
143
+ })
144
+ ],
145
+ right: [
146
+ atoms_css_js.atoms({
147
+ marginLeft: "xxs"
148
+ })
149
+ ]
150
+ }
151
+ }
152
+ });
153
+ const switchDescription = css.style([
154
+ atoms_css_js.atoms({
155
+ color: "on-secondary"
156
+ })
157
+ ]);
158
+ exports.SwitchLabelRecipe = SwitchLabelRecipe;
159
+ exports.SwitchRecipe = SwitchRecipe;
160
+ exports.SwitchThumbRecipe = SwitchThumbRecipe;
161
+ exports.switchContainer = switchContainer;
162
+ exports.switchContainerStyle = switchContainerStyle;
163
+ exports.switchDescription = switchDescription;
164
+ exports.switchLabel = switchLabel;
165
+ exports.switchThumb = switchThumb;
@@ -0,0 +1,46 @@
1
+ export declare const switchContainerStyle: string;
2
+ export declare const switchContainer: string;
3
+ export declare const SwitchRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
4
+ selected: {
5
+ true: string[];
6
+ false: string[];
7
+ };
8
+ disabled: {
9
+ true: (string | {
10
+ cursor: "not-allowed";
11
+ opacity: number;
12
+ })[];
13
+ false: {};
14
+ };
15
+ validity: {
16
+ error: string[];
17
+ };
18
+ }>;
19
+ export declare const switchThumb: string;
20
+ export declare const SwitchThumbRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
21
+ selected: {
22
+ true: {
23
+ left: `calc(100% - var(--${string}) - 1px)`;
24
+ };
25
+ false: {
26
+ left: "1px";
27
+ };
28
+ };
29
+ disabled: {
30
+ true: string[];
31
+ false: {};
32
+ };
33
+ }>;
34
+ export declare const switchLabel: string;
35
+ export declare const SwitchLabelRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
36
+ disabled: {
37
+ true: string[];
38
+ false: {};
39
+ };
40
+ side: {
41
+ left: string[];
42
+ right: string[];
43
+ };
44
+ }>;
45
+ export declare const switchDescription: string;
46
+ //# sourceMappingURL=switch.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.css.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/switch.css.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,QAG/B,CAAC;AACH,eAAO,MAAM,eAAe,QAY1B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAwDvB,CAAC;AAEH,eAAO,MAAM,WAAW,QAQtB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;EA0B5B,CAAC;AAEH,eAAO,MAAM,WAAW,QAStB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;EAwB5B,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAI5B,CAAC"}
@@ -0,0 +1,165 @@
1
+ "use client";
2
+ import { atoms } from "@gnist/themes/atoms.css.js";
3
+ import { tokens } from "@gnist/themes/tokens.css.js";
4
+ import { recipe } from "@vanilla-extract/recipes";
5
+ import { style } from "@vanilla-extract/css";
6
+ const switchContainerStyle = style({
7
+ display: "flex",
8
+ alignItems: "center"
9
+ });
10
+ const switchContainer = style([
11
+ {
12
+ position: "relative",
13
+ display: "inline-flex",
14
+ cursor: "pointer",
15
+ transition: "background-color 0.2s ease"
16
+ },
17
+ atoms({
18
+ borderRadius: "full",
19
+ width: "xxl",
20
+ height: "l"
21
+ })
22
+ ]);
23
+ const SwitchRecipe = recipe({
24
+ base: [
25
+ switchContainer,
26
+ atoms({
27
+ borderColor: "outline"
28
+ }),
29
+ {
30
+ borderWidth: "1px",
31
+ borderStyle: "solid",
32
+ boxSizing: "border-box"
33
+ },
34
+ {
35
+ selectors: {
36
+ "&:focus:not(:focus-visible)": {
37
+ outline: "none"
38
+ },
39
+ "&:has(:focus-visible)": {
40
+ outline: `${tokens.stroke.medium} solid ${tokens.color.interactive}`
41
+ }
42
+ }
43
+ }
44
+ ],
45
+ variants: {
46
+ selected: {
47
+ true: [
48
+ atoms({
49
+ backgroundColor: "success"
50
+ })
51
+ ],
52
+ false: [
53
+ atoms({
54
+ backgroundColor: "surface-variant"
55
+ })
56
+ ]
57
+ },
58
+ disabled: {
59
+ true: [
60
+ atoms({
61
+ backgroundColor: "disabled",
62
+ borderColor: "disabled"
63
+ }),
64
+ {
65
+ cursor: "not-allowed",
66
+ opacity: 0.6
67
+ }
68
+ ],
69
+ false: {}
70
+ },
71
+ validity: {
72
+ error: [
73
+ atoms({
74
+ borderColor: "error"
75
+ })
76
+ ]
77
+ }
78
+ }
79
+ });
80
+ const switchThumb = style({
81
+ position: "absolute",
82
+ top: "50%",
83
+ transform: "translateY(-50%)",
84
+ transition: "left 0.2s ease, background-color 0.2s ease",
85
+ borderRadius: "50%",
86
+ backgroundColor: tokens.palette.white,
87
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.3)"
88
+ });
89
+ const SwitchThumbRecipe = recipe({
90
+ base: [
91
+ switchThumb,
92
+ atoms({
93
+ width: "m",
94
+ height: "m"
95
+ })
96
+ ],
97
+ variants: {
98
+ selected: {
99
+ true: {
100
+ left: `calc(100% - ${tokens.spacing.m} - 1px)`
101
+ },
102
+ false: {
103
+ left: "1px"
104
+ }
105
+ },
106
+ disabled: {
107
+ true: [
108
+ atoms({
109
+ backgroundColor: "on-disabled"
110
+ })
111
+ ],
112
+ false: {}
113
+ }
114
+ }
115
+ });
116
+ const switchLabel = style([
117
+ {
118
+ userSelect: "none",
119
+ fontSize: tokens.type.small.body.fontSize,
120
+ lineHeight: tokens.type.small.body.lineHeight
121
+ },
122
+ atoms({
123
+ color: "on-surface"
124
+ })
125
+ ]);
126
+ const SwitchLabelRecipe = recipe({
127
+ base: [switchLabel],
128
+ variants: {
129
+ disabled: {
130
+ true: [
131
+ atoms({
132
+ color: "on-disabled"
133
+ })
134
+ ],
135
+ false: {}
136
+ },
137
+ side: {
138
+ left: [
139
+ atoms({
140
+ marginRight: "xxs"
141
+ })
142
+ ],
143
+ right: [
144
+ atoms({
145
+ marginLeft: "xxs"
146
+ })
147
+ ]
148
+ }
149
+ }
150
+ });
151
+ const switchDescription = style([
152
+ atoms({
153
+ color: "on-secondary"
154
+ })
155
+ ]);
156
+ export {
157
+ SwitchLabelRecipe,
158
+ SwitchRecipe,
159
+ SwitchThumbRecipe,
160
+ switchContainer,
161
+ switchContainerStyle,
162
+ switchDescription,
163
+ switchLabel,
164
+ switchThumb
165
+ };
@@ -10,6 +10,7 @@ const TextButton = require("./actions/buttons/TextButton.cjs");
10
10
  const IconButton = require("./actions/buttons/IconButton.cjs");
11
11
  const Checkbox = require("./actions/selectionControls/Checkbox.cjs");
12
12
  const RadioButton = require("./actions/selectionControls/RadioButton.cjs");
13
+ const Switch = require("./actions/selectionControls/Switch.cjs");
13
14
  const ActionChip = require("./actions/chips/ActionChip.cjs");
14
15
  const FilterChip = require("./actions/chips/FilterChip.cjs");
15
16
  const TagChip = require("./actions/chips/TagChip.cjs");
@@ -39,6 +40,7 @@ exports.TextButton = TextButton.TextButton;
39
40
  exports.IconButton = IconButton.IconButton;
40
41
  exports.Checkbox = Checkbox.Checkbox;
41
42
  exports.RadioButton = RadioButton.RadioButton;
43
+ exports.Switch = Switch.Switch;
42
44
  exports.ActionChip = ActionChip.ActionChip;
43
45
  exports.FilterChip = FilterChip.FilterChip;
44
46
  exports.TagChip = TagChip.TagChip;
@@ -8,6 +8,7 @@ import { TextButton } from "./actions/buttons/TextButton.js";
8
8
  import { IconButton } from "./actions/buttons/IconButton.js";
9
9
  import { Checkbox } from "./actions/selectionControls/Checkbox.js";
10
10
  import { RadioButton } from "./actions/selectionControls/RadioButton.js";
11
+ import { Switch } from "./actions/selectionControls/Switch.js";
11
12
  import { ActionChip } from "./actions/chips/ActionChip.js";
12
13
  import { FilterChip } from "./actions/chips/FilterChip.js";
13
14
  import { TagChip } from "./actions/chips/TagChip.js";
@@ -55,6 +56,7 @@ export {
55
56
  SingleSelect,
56
57
  Spinner,
57
58
  SuccessButton,
59
+ Switch,
58
60
  TagChip,
59
61
  TextArea,
60
62
  TextButton,
@@ -1,9 +1,8 @@
1
1
  "use client";
2
2
  "use strict";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const React = require("react");
5
4
  const SelectBase = require("./SelectBase.cjs");
6
- const MultiSelect = React.forwardRef(function MultiSelect2(props, ref) {
7
- return SelectBase.SelectBase(props, true, ref);
8
- });
5
+ function MultiSelect(props) {
6
+ return SelectBase.SelectBase(props, true);
7
+ }
9
8
  exports.MultiSelect = MultiSelect;
@@ -5,5 +5,5 @@ export type MultiSelectProps = SelectBaseProps<string[]>;
5
5
 
6
6
  Documentation: [MultiSelect](https://gnist.moller.no/developers/components/latest/?path=/docs/components-inputs-dropdowns-multiselect--docs)
7
7
  */
8
- export declare const MultiSelect: React.FC<MultiSelectProps>;
8
+ export declare function MultiSelect(props: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
9
9
  //# sourceMappingURL=MultiSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/dropdowns/MultiSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC;AAEzD;;;;GAIG;AAEH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAIlD,CAAC"}
1
+ {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/dropdowns/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC;AAEzD;;;;GAIG;AAEH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAElD"}
@@ -1,9 +1,8 @@
1
1
  "use client";
2
- import { forwardRef } from "react";
3
2
  import { SelectBase } from "./SelectBase.js";
4
- const MultiSelect = forwardRef(function MultiSelect2(props, ref) {
5
- return SelectBase(props, true, ref);
6
- });
3
+ function MultiSelect(props) {
4
+ return SelectBase(props, true);
5
+ }
7
6
  export {
8
7
  MultiSelect
9
8
  };
@@ -25,10 +25,12 @@ require("../../progress/Spinner.cjs");
25
25
  require("../../actions/buttons/styles.css.cjs");
26
26
  require("../../../styles/states.css.cjs");
27
27
  const Checkbox = require("../../actions/selectionControls/Checkbox.cjs");
28
- require("../../actions/selectionControls/RadioButton.cjs");
29
- require("../../actions/chips/ActionChip.cjs");
30
- require("../../actions/chips/FilterChip.cjs");
31
- require("../../actions/chips/TagChip.cjs");
28
+ require("../../actions/selectionControls/radiobutton.css.cjs");
29
+ require("../../actions/selectionControls/shared.css.cjs");
30
+ require("../../../utilities/layout/Column.cjs");
31
+ require("../../actions/selectionControls/Switch.cjs");
32
+ require("../../../styles/animations.css.cjs");
33
+ require("../../actions/chips/styles.css.cjs");
32
34
  const inputField_css = require("../shared-styles/inputField.css.cjs");
33
35
  const inputFieldConstants_css = require("../shared-styles/inputFieldConstants.css.cjs");
34
36
  const labelStyles_css = require("../shared-styles/labelStyles.css.cjs");
@@ -37,11 +39,11 @@ const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in
37
39
  const classNames__default = /* @__PURE__ */ _interopDefaultCompat(classNames);
38
40
  const listBoxComponent = base.prepareForSlot(componentUtils.component("listBox", select_css.listBoxStyle, "div"));
39
41
  const popUpComponent = base.prepareForSlot(componentUtils.component("popUp", select_css.popUpStyle, "div"));
40
- function SelectBase(props, isMultiple, ref) {
42
+ function SelectBase(props, isMultiple) {
41
43
  const { contentProps, wrapperProps, commonInputProps } = shared.useSelectInputLogic(props);
42
44
  const { selectProps } = shared.getSelectInputProps(props);
43
45
  const [isExpanded, setIsExpanded] = React.useState(false);
44
- return jsxRuntime.jsxs("span", { ref, className: classNames__default.default(wrapperProps.className, inputField_css.wrapperStyle), children: [jsxRuntime.jsxs("label", { htmlFor: props.id, className: inputField_css.inputFieldWrapperRecipe({
46
+ return jsxRuntime.jsxs("span", { className: classNames__default.default(wrapperProps.className, inputField_css.wrapperStyle), children: [jsxRuntime.jsxs("label", { htmlFor: props.id, className: inputField_css.inputFieldWrapperRecipe({
45
47
  disabled: props.disabled,
46
48
  density: props.density,
47
49
  validityType: props.validity?.type
@@ -50,7 +52,7 @@ function SelectBase(props, isMultiple, ref) {
50
52
  [inputFieldConstants_css.preInputWidth]: wrapperProps.preInputWidth,
51
53
  [inputFieldConstants_css.postInputWidth]: wrapperProps.postInputWidth
52
54
  })
53
- }, ...commonInputProps, ...selectProps, ref, multiple: isMultiple, onListboxOpenChange: (expanded) => setIsExpanded(expanded), slots: {
55
+ }, ...commonInputProps, ...selectProps, ref: props.ref, multiple: isMultiple, onListboxOpenChange: (expanded) => setIsExpanded(expanded), slots: {
54
56
  listbox: listBoxComponent,
55
57
  popup: popUpComponent
56
58
  }, onChange: (e, value) => {
@@ -1,5 +1,4 @@
1
1
  import { SelectBaseInputProps } from "../shared.js";
2
- import { ForwardedRef } from "react";
3
2
  export interface SelectBaseProps<TVal> extends SelectBaseInputProps<TVal> {
4
3
  /**
5
4
  * Values to be listed as options
@@ -10,5 +9,5 @@ export interface SelectBaseProps<TVal> extends SelectBaseInputProps<TVal> {
10
9
  value: string;
11
10
  }[];
12
11
  }
13
- export declare function SelectBase<T>(props: SelectBaseProps<T>, isMultiple: boolean, ref: ForwardedRef<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
12
+ export declare function SelectBase<T>(props: SelectBaseProps<T>, isMultiple: boolean): import("react/jsx-runtime").JSX.Element;
14
13
  //# sourceMappingURL=SelectBase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectBase.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/dropdowns/SelectBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,oBAAoB,EAGvB,qBAAyD;AAM1D,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAqB/C,MAAM,WAAW,eAAe,CAAC,IAAI,CAAE,SAAQ,oBAAoB,CAAC,IAAI,CAAC;IACrE;;;OAGG;IACH,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C;AAOD,wBAAgB,UAAU,CAAC,CAAC,EACxB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,EACzB,UAAU,EAAE,OAAO,EACnB,GAAG,EAAE,YAAY,CAAC,iBAAiB,CAAC,2CA4HvC"}
1
+ {"version":3,"file":"SelectBase.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/dropdowns/SelectBase.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,oBAAoB,EAGvB,qBAAyD;AA2B1D,MAAM,WAAW,eAAe,CAAC,IAAI,CAAE,SAAQ,oBAAoB,CAAC,IAAI,CAAC;IACrE;;;OAGG;IACH,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C;AAOD,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,2CAwH3E"}
@@ -23,21 +23,23 @@ import "../../progress/Spinner.js";
23
23
  import "../../actions/buttons/styles.css.js";
24
24
  import "../../../styles/states.css.js";
25
25
  import { Checkbox } from "../../actions/selectionControls/Checkbox.js";
26
- import "../../actions/selectionControls/RadioButton.js";
27
- import "../../actions/chips/ActionChip.js";
28
- import "../../actions/chips/FilterChip.js";
29
- import "../../actions/chips/TagChip.js";
26
+ import "../../actions/selectionControls/radiobutton.css.js";
27
+ import "../../actions/selectionControls/shared.css.js";
28
+ import "../../../utilities/layout/Column.js";
29
+ import "../../actions/selectionControls/Switch.js";
30
+ import "../../../styles/animations.css.js";
31
+ import "../../actions/chips/styles.css.js";
30
32
  import { inputFieldWrapperRecipe, inputContentWrapper, wrapperStyle } from "../shared-styles/inputField.css.js";
31
33
  import { postInputWidth, preInputWidth } from "../shared-styles/inputFieldConstants.css.js";
32
34
  import { labelStyle } from "../shared-styles/labelStyles.css.js";
33
35
  import { listBoxStyle, popUpStyle, selectStyle, optionStyle, optionBackground, singleOptionStyle } from "./select.css.js";
34
36
  const listBoxComponent = prepareForSlot(component("listBox", listBoxStyle, "div"));
35
37
  const popUpComponent = prepareForSlot(component("popUp", popUpStyle, "div"));
36
- function SelectBase(props, isMultiple, ref) {
38
+ function SelectBase(props, isMultiple) {
37
39
  const { contentProps, wrapperProps, commonInputProps } = useSelectInputLogic(props);
38
40
  const { selectProps } = getSelectInputProps(props);
39
41
  const [isExpanded, setIsExpanded] = useState(false);
40
- return jsxs("span", { ref, className: classNames(wrapperProps.className, wrapperStyle), children: [jsxs("label", { htmlFor: props.id, className: inputFieldWrapperRecipe({
42
+ return jsxs("span", { className: classNames(wrapperProps.className, wrapperStyle), children: [jsxs("label", { htmlFor: props.id, className: inputFieldWrapperRecipe({
41
43
  disabled: props.disabled,
42
44
  density: props.density,
43
45
  validityType: props.validity?.type
@@ -46,7 +48,7 @@ function SelectBase(props, isMultiple, ref) {
46
48
  [preInputWidth]: wrapperProps.preInputWidth,
47
49
  [postInputWidth]: wrapperProps.postInputWidth
48
50
  })
49
- }, ...commonInputProps, ...selectProps, ref, multiple: isMultiple, onListboxOpenChange: (expanded) => setIsExpanded(expanded), slots: {
51
+ }, ...commonInputProps, ...selectProps, ref: props.ref, multiple: isMultiple, onListboxOpenChange: (expanded) => setIsExpanded(expanded), slots: {
50
52
  listbox: listBoxComponent,
51
53
  popup: popUpComponent
52
54
  }, onChange: (e, value) => {
@@ -1,9 +1,8 @@
1
1
  "use client";
2
2
  "use strict";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const React = require("react");
5
4
  const SelectBase = require("./SelectBase.cjs");
6
- const SingleSelect = React.forwardRef(function SingleSelect2(props, ref) {
7
- return SelectBase.SelectBase(props, false, ref);
8
- });
5
+ function SingleSelect(props) {
6
+ return SelectBase.SelectBase(props, false);
7
+ }
9
8
  exports.SingleSelect = SingleSelect;
@@ -7,5 +7,5 @@ export type SingleSelectProps = SelectBaseProps<string>;
7
7
 
8
8
  Documentation: [SingleSelect](https://gnist.moller.no/developers/components/latest/?path=/docs/components-inputs-dropdowns-singleselect--docs)
9
9
  */
10
- export declare const SingleSelect: React.FC<SingleSelectProps>;
10
+ export declare function SingleSelect(props: SingleSelectProps): import("react/jsx-runtime").JSX.Element;
11
11
  //# sourceMappingURL=SingleSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SingleSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/dropdowns/SingleSelect.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAExD;;;;;;GAMG;AAEH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAIpD,CAAC"}
1
+ {"version":3,"file":"SingleSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/dropdowns/SingleSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAExD;;;;;;GAMG;AAEH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAEpD"}
@@ -1,9 +1,8 @@
1
1
  "use client";
2
- import { forwardRef } from "react";
3
2
  import { SelectBase } from "./SelectBase.js";
4
- const SingleSelect = forwardRef(function SingleSelect2(props, ref) {
5
- return SelectBase(props, false, ref);
6
- });
3
+ function SingleSelect(props) {
4
+ return SelectBase(props, false);
5
+ }
7
6
  export {
8
7
  SingleSelect
9
8
  };
@@ -28,11 +28,13 @@ require("../../progress/Spinner.cjs");
28
28
  require("../../actions/buttons/styles.css.cjs");
29
29
  require("../../../styles/states.css.cjs");
30
30
  const IconButton = require("../../actions/buttons/IconButton.cjs");
31
- require("../../actions/selectionControls/Checkbox.cjs");
32
- require("../../actions/selectionControls/RadioButton.cjs");
33
- require("../../actions/chips/ActionChip.cjs");
34
- require("../../actions/chips/FilterChip.cjs");
35
- require("../../actions/chips/TagChip.cjs");
31
+ require("../../actions/selectionControls/checkbox.css.cjs");
32
+ require("../../actions/selectionControls/shared.css.cjs");
33
+ require("../../../utilities/layout/Column.cjs");
34
+ require("../../actions/selectionControls/radiobutton.css.cjs");
35
+ require("../../actions/selectionControls/Switch.cjs");
36
+ require("../../../styles/animations.css.cjs");
37
+ require("../../actions/chips/styles.css.cjs");
36
38
  const Calendar_css = require("./Calendar.css.cjs");
37
39
  const HeaderCell = componentUtils.component("HeaderCell", Calendar_css.headerCell, "div");
38
40
  function weekDayNumberStartingMonday(date2) {
@@ -165,7 +167,7 @@ function clampDate(date2, minDate, maxDate) {
165
167
  }
166
168
  return date2;
167
169
  }
168
- const Calendar = React.forwardRef(function Calendar2({ selected, setSelected, isDateUnavailable, minDate: origMinDate, maxDate: origMaxDate, onNavigate, isLoading }, ref) {
170
+ function Calendar({ selected, setSelected, isDateUnavailable, minDate: origMinDate, maxDate: origMaxDate, onNavigate, isLoading, ref }) {
169
171
  const minDate = origMinDate ? date.getStartOfDay(origMinDate) : void 0;
170
172
  const maxDate = origMaxDate ? date.getStartOfDay(origMaxDate) : void 0;
171
173
  const text = index.useTranslation((t) => t.components.inputs.pickers.calendar);
@@ -204,5 +206,5 @@ const Calendar = React.forwardRef(function Calendar2({ selected, setSelected, is
204
206
  }, label: text.showPreviousMonth, disabled: minDate && date.maxDayOfMonth(date.nextMonth(current, -1)) < minDate }), jsxRuntime.jsx(IconButton.IconButton, { className: Calendar_css.arrowButton, icon: "arrow_forward", onClick: () => {
205
207
  handleChangeMonth(1);
206
208
  }, label: text.showNextMonth, disabled: maxDate && date.nextMonth(current, 1) > maxDate })] })] }), jsxRuntime.jsxs("div", { className: Calendar_css.gridStyle, role: "grid", children: [jsxRuntime.jsxs("div", { className: Calendar_css.rowStyle, role: "row", style: { height: "unset" }, children: [jsxRuntime.jsx(HeaderCell, { role: "columnheader", children: days.mon }), jsxRuntime.jsx(HeaderCell, { role: "columnheader", children: days.tue }), jsxRuntime.jsx(HeaderCell, { role: "columnheader", children: days.wed }), jsxRuntime.jsx(HeaderCell, { role: "columnheader", children: days.thu }), jsxRuntime.jsx(HeaderCell, { role: "columnheader", children: days.fri }), jsxRuntime.jsx(HeaderCell, { role: "columnheader", children: days.sat }), jsxRuntime.jsx(HeaderCell, { role: "columnheader", children: days.sun })] }), jsxRuntime.jsx(DateGrid, { current, setCurrent, selected, setSelected, focused, setFocus, focusRef, isDateUnavailable, minDate, maxDate, isLoading: !!isLoading })] })] });
207
- });
209
+ }
208
210
  exports.Calendar = Calendar;