@vygruppen/spor-react 8.2.1 → 9.0.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 (67) hide show
  1. package/.turbo/turbo-build.log +10 -12
  2. package/CHANGELOG.md +34 -0
  3. package/dist/{CountryCodeSelect-NEASN3EC.mjs → CountryCodeSelect-LFDBAHV7.mjs} +1 -1
  4. package/dist/{chunk-AKOJGLTQ.mjs → chunk-BWLVKMWU.mjs} +1262 -1785
  5. package/dist/index.d.mts +1664 -813
  6. package/dist/index.d.ts +1664 -813
  7. package/dist/index.js +1551 -2011
  8. package/dist/index.mjs +1 -1
  9. package/package.json +1 -1
  10. package/src/accordion/Expandable.tsx +22 -2
  11. package/src/breadcrumb/Breadcrumb.tsx +4 -2
  12. package/src/datepicker/DateRangePicker.tsx +1 -0
  13. package/src/input/ChoiceChip.tsx +3 -3
  14. package/src/input/NumericStepper.tsx +7 -49
  15. package/src/input/PasswordInput.tsx +2 -0
  16. package/src/input/PhoneNumberInput.tsx +1 -1
  17. package/src/input/Switch.tsx +4 -7
  18. package/src/loader/ProgressBar.tsx +7 -24
  19. package/src/tab/Tabs.tsx +4 -5
  20. package/src/theme/components/accordion.ts +12 -16
  21. package/src/theme/components/alert-expandable.ts +10 -21
  22. package/src/theme/components/breadcrumb.ts +60 -5
  23. package/src/theme/components/button.ts +40 -75
  24. package/src/theme/components/card-select.ts +14 -56
  25. package/src/theme/components/card.ts +56 -63
  26. package/src/theme/components/checkbox.ts +20 -20
  27. package/src/theme/components/choice-chip.ts +28 -43
  28. package/src/theme/components/close-button.ts +1 -1
  29. package/src/theme/components/datepicker.ts +48 -166
  30. package/src/theme/components/drawer.ts +6 -4
  31. package/src/theme/components/fab.ts +35 -62
  32. package/src/theme/components/index.ts +3 -1
  33. package/src/theme/components/info-select.ts +5 -9
  34. package/src/theme/components/input.ts +17 -32
  35. package/src/theme/components/link.ts +8 -8
  36. package/src/theme/components/listbox.ts +5 -7
  37. package/src/theme/components/media-controller-button.ts +20 -25
  38. package/src/theme/components/modal.ts +8 -6
  39. package/src/theme/components/numeric-stepper.ts +65 -0
  40. package/src/theme/components/popover.ts +7 -8
  41. package/src/theme/components/progress-bar.ts +43 -0
  42. package/src/theme/components/progress-indicator.ts +5 -2
  43. package/src/theme/components/radio.ts +15 -12
  44. package/src/theme/components/select.ts +2 -2
  45. package/src/theme/components/stepper.ts +10 -7
  46. package/src/theme/components/switch.ts +35 -82
  47. package/src/theme/components/table.ts +10 -12
  48. package/src/theme/components/tabs.ts +55 -261
  49. package/src/theme/components/travel-tag.ts +3 -6
  50. package/src/theme/foundations/colors.ts +3 -1
  51. package/src/theme/foundations/fonts.ts +2 -2
  52. package/src/theme/index.ts +9 -6
  53. package/src/theme/utils/accent-utils.ts +54 -0
  54. package/src/theme/utils/base-utils.ts +94 -0
  55. package/src/theme/utils/bg-utils.ts +19 -0
  56. package/src/theme/utils/brand-utils.ts +42 -0
  57. package/src/theme/utils/floating-utils.ts +64 -0
  58. package/src/theme/utils/{focus-util.ts → focus-utils.ts} +1 -1
  59. package/src/theme/utils/ghost-utils.ts +40 -0
  60. package/src/theme/utils/surface-utils.ts +35 -0
  61. package/src/tooltip/Tooltip.tsx +17 -20
  62. package/src/typography/Heading.tsx +7 -2
  63. package/src/util/externals.tsx +0 -1
  64. package/src/theme/utils/background-utils.ts +0 -179
  65. package/src/theme/utils/border-utils.ts +0 -176
  66. package/src/theme/utils/box-shadow-utils.ts +0 -44
  67. package/src/theme/utils/text-utils.ts +0 -60
@@ -1,176 +0,0 @@
1
- import { mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
2
- import { getBoxShadowString } from "./box-shadow-utils";
3
- import { State, Subset } from "./types";
4
-
5
- type BorderState = Subset<
6
- State,
7
- "hover" | "focus" | "disabled" | "selected" | "invalid" | "default"
8
- >;
9
-
10
- export function baseBorder(state: BorderState, props: StyleFunctionProps) {
11
- switch (state) {
12
- case "hover":
13
- return {
14
- boxShadow: getBoxShadowString({
15
- borderColor: mode("darkGrey", "white")(props),
16
- borderWidth: 2,
17
- }),
18
- };
19
- case "focus": {
20
- return {
21
- boxShadow: getBoxShadowString({
22
- borderColor: mode("greenHaze", "azure")(props),
23
- borderWidth: 2,
24
- }),
25
- };
26
- }
27
- case "disabled": {
28
- return {
29
- boxShadow: getBoxShadowString({
30
- borderColor: mode("platinum", "whiteAlpha.400")(props),
31
- }),
32
- };
33
- }
34
- case "selected":
35
- return {
36
- boxShadow: getBoxShadowString({
37
- borderColor: mode("greenHaze", "azure")(props),
38
- }),
39
- };
40
- case "invalid": {
41
- return {
42
- boxShadow: getBoxShadowString({
43
- borderColor: "brightRed",
44
- borderWidth: 2,
45
- }),
46
- };
47
- }
48
- case "default":
49
- default:
50
- return {
51
- boxShadow: getBoxShadowString({
52
- borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
53
- }),
54
- };
55
- }
56
- }
57
-
58
- type FloatingBorderState = Subset<
59
- State,
60
- "default" | "hover" | "focus" | "active" | "selected"
61
- >;
62
- export function floatingBorder(
63
- state: FloatingBorderState,
64
- props: StyleFunctionProps,
65
- ) {
66
- switch (state) {
67
- case "hover":
68
- return {
69
- boxShadow: getBoxShadowString({
70
- borderColor: mode("grey.300", "white")(props),
71
- }),
72
- };
73
- case "selected":
74
- case "focus":
75
- return {
76
- boxShadow: getBoxShadowString({
77
- borderColor: mode("greenHaze", "azure")(props),
78
- borderWidth: 2,
79
- }),
80
- };
81
- case "active":
82
- case "default":
83
- default:
84
- return {
85
- boxShadow: getBoxShadowString({
86
- borderColor: mode("grey.200", "whiteAlpha.400")(props),
87
- baseShadow: "sm",
88
- }),
89
- };
90
- }
91
- }
92
-
93
- type AccentBorderState = Subset<
94
- State,
95
- "default" | "hover" | "focus" | "active" | "selected"
96
- >;
97
- export function accentBorder(
98
- state: AccentBorderState,
99
- props: StyleFunctionProps,
100
- ) {
101
- switch (state) {
102
- case "selected":
103
- return {
104
- boxShadow: getBoxShadowString({
105
- borderColor: mode("primaryGreen", "coralGreen")(props),
106
- borderWidth: 2,
107
- }),
108
- };
109
- case "active":
110
- return {
111
- boxShadow: getBoxShadowString({
112
- borderColor: mode("mint", "darkTeal")(props),
113
- borderWidth: 2,
114
- }),
115
- };
116
- case "hover":
117
- return {
118
- boxShadow: getBoxShadowString({
119
- borderColor: mode("coralGreen", "greenHaze")(props),
120
- borderWidth: 2,
121
- }),
122
- };
123
- case "focus":
124
- return {
125
- boxShadow: getBoxShadowString({
126
- borderColor: mode("greenHaze", "azure")(props),
127
- borderWidth: 2,
128
- }),
129
- };
130
- case "default":
131
- default:
132
- return {
133
- boxShadow: getBoxShadowString({
134
- borderColor: mode("seaMist", "pine")(props),
135
- borderWidth: 2,
136
- }),
137
- };
138
- }
139
- }
140
-
141
- type BrandBorderState = Subset<
142
- State,
143
- "default" | "hover" | "focus" | "active" | "selected"
144
- >;
145
-
146
- export function brandBorder(
147
- state: BrandBorderState,
148
- props: StyleFunctionProps,
149
- ) {
150
- switch (state) {
151
- case "selected":
152
- case "active":
153
- return {
154
- boxShadow: getBoxShadowString({
155
- borderColor: mode("greenHaze", "seaMist")(props),
156
- borderWidth: 2,
157
- }),
158
- };
159
- case "hover":
160
- return {
161
- boxShadow: getBoxShadowString({
162
- borderColor: mode("darkTeal", "blueGreen")(props),
163
- borderWidth: 2,
164
- }),
165
- };
166
- case "focus":
167
- case "default":
168
- default:
169
- return {
170
- boxShadow: getBoxShadowString({
171
- borderColor: mode("pine", "coralGreen")(props),
172
- borderWidth: 2,
173
- }),
174
- };
175
- }
176
- }
@@ -1,44 +0,0 @@
1
- import { colors, ColorsType } from "../foundations/colors";
2
- import { shadows } from "../foundations/shadows";
3
-
4
- type GetBoxShadowStringArgs = {
5
- baseShadow?: keyof typeof shadows;
6
- borderColor?: keyof typeof colors | string;
7
- borderWidth?: number;
8
- isInset?: boolean;
9
- };
10
- /**
11
- * A utility for creating box shadow strings
12
- */
13
- export const getBoxShadowString = (
14
- args: GetBoxShadowStringArgs | GetBoxShadowStringArgs[],
15
- ): string => {
16
- if (Array.isArray(args)) {
17
- return args.map((arg) => getBoxShadowString(arg)).join(", ");
18
- }
19
-
20
- const { baseShadow, borderColor, borderWidth = 1, isInset = true } = args;
21
- const allShadows: string[] = [];
22
-
23
- if (borderColor) {
24
- let color = borderColor;
25
- if (borderColor in colors) {
26
- color = colors[borderColor as keyof typeof colors] as string;
27
- } else {
28
- const [subgroup, value] = borderColor.split(".");
29
- const subgroupValue = (colors[subgroup as keyof ColorsType] as any)?.[
30
- value
31
- ];
32
- if (subgroupValue) {
33
- color = subgroupValue;
34
- }
35
- }
36
- allShadows.push(
37
- `${isInset ? "inset " : ""}0 0 0 ${borderWidth}px ${color}`,
38
- );
39
- }
40
- if (baseShadow) {
41
- allShadows.push(shadows[baseShadow]);
42
- }
43
- return allShadows.join(", ");
44
- };
@@ -1,60 +0,0 @@
1
- import { mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
2
- import { State, Subset } from "./types";
3
- import { colors } from "../foundations";
4
-
5
- type BaseTextState = Subset<State, "default" | "selected" | "disabled">;
6
- export function baseText(state: BaseTextState, props: StyleFunctionProps) {
7
- switch (state) {
8
- case "selected":
9
- return {
10
- color: mode("white", "darkTeal")(props),
11
- };
12
- case "disabled":
13
- return {
14
- color: mode(
15
- "white",
16
- `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 40%)`,
17
- )(props),
18
- };
19
- default:
20
- return {
21
- color: mode("darkGrey", "white")(props),
22
- };
23
- }
24
- }
25
-
26
- type AccentTextState = Subset<State, "default" | "selected">;
27
-
28
- export function accentText(state: AccentTextState, props: StyleFunctionProps) {
29
- switch (state) {
30
- case "selected":
31
- return {
32
- color: mode("white", "darkTeal")(props),
33
- };
34
- case "default":
35
- default:
36
- return {
37
- color: mode("darkTeal", "seaMist")(props),
38
- };
39
- }
40
- }
41
-
42
- type BrandTextState = Subset<State, "hover" | "active" | "default">;
43
-
44
- export function brandText(state: BrandTextState, props: StyleFunctionProps) {
45
- switch (state) {
46
- case "hover":
47
- return {
48
- color: mode("white", "darkTeal")(props),
49
- };
50
- case "active":
51
- return {
52
- color: mode("white", "darkTeal")(props),
53
- };
54
- case "default":
55
- default:
56
- return {
57
- color: mode("pine", "coralGreen")(props),
58
- };
59
- }
60
- }