@vygruppen/spor-react 12.0.1 → 12.0.3
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/.turbo/turbo-build.log +10 -11
- package/.turbo/turbo-typegen.log +3 -2
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +576 -576
- package/dist/index.d.ts +576 -576
- package/dist/index.js +8643 -8613
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8848 -8818
- package/dist/index.mjs.map +1 -1
- package/eslint.config.mjs +9 -0
- package/package.json +9 -6
- package/src/accordion/Accordion.tsx +5 -4
- package/src/accordion/Expandable.tsx +2 -1
- package/src/accordion/types.ts +3 -2
- package/src/alert/Alert.tsx +5 -3
- package/src/alert/AlertIcon.tsx +2 -1
- package/src/alert/ExpandableAlert.tsx +6 -4
- package/src/alert/ServiceAlert.tsx +5 -4
- package/src/alert/index.ts +1 -1
- package/src/breadcrumb/Breadcrumb.tsx +3 -3
- package/src/button/Button.tsx +4 -3
- package/src/button/ButtonGroup.tsx +3 -2
- package/src/button/Clipboard.tsx +5 -3
- package/src/button/CloseButton.tsx +1 -0
- package/src/button/FloatingActionButton.tsx +1 -0
- package/src/button/IconButton.tsx +1 -0
- package/src/button/index.tsx +1 -1
- package/src/color-mode/color-mode.tsx +1 -1
- package/src/datepicker/Calendar.tsx +5 -3
- package/src/datepicker/CalendarCell.tsx +2 -1
- package/src/datepicker/CalendarGrid.tsx +4 -3
- package/src/datepicker/CalendarHeader.tsx +1 -0
- package/src/datepicker/CalendarNavigationButton.tsx +1 -0
- package/src/datepicker/CalendarTriggerButton.tsx +1 -0
- package/src/datepicker/DateField.tsx +5 -4
- package/src/datepicker/DatePicker.tsx +4 -2
- package/src/datepicker/DateRangePicker.tsx +7 -7
- package/src/datepicker/DateTimeSegment.tsx +3 -2
- package/src/datepicker/RangeCalendar.tsx +5 -3
- package/src/datepicker/StyledField.tsx +2 -1
- package/src/datepicker/TimeField.tsx +2 -1
- package/src/datepicker/TimePicker.tsx +4 -2
- package/src/datepicker/index.tsx +1 -1
- package/src/datepicker/utils.ts +1 -0
- package/src/dialog/Dialog.tsx +1 -0
- package/src/dialog/Drawer.tsx +2 -1
- package/src/dialog/index.ts +1 -1
- package/src/dialog/types.ts +3 -2
- package/src/image/index.tsx +1 -1
- package/src/index.tsx +5 -5
- package/src/input/AttachedInputs.tsx +3 -1
- package/src/input/CardSelect.tsx +3 -2
- package/src/input/Checkbox.tsx +2 -1
- package/src/input/ChoiceChip.tsx +2 -1
- package/src/input/Combobox.tsx +1 -0
- package/src/input/CountryCodeSelect.tsx +2 -1
- package/src/input/Field.tsx +1 -0
- package/src/input/Input.tsx +5 -3
- package/src/input/InputGroup.tsx +2 -1
- package/src/input/ListBox.tsx +5 -4
- package/src/input/NativeSelect.tsx +2 -1
- package/src/input/NumericStepper.tsx +1 -0
- package/src/input/PasswordInput.tsx +1 -0
- package/src/input/PhoneNumberInput.tsx +2 -1
- package/src/input/Radio.tsx +3 -2
- package/src/input/SearchInput.tsx +1 -0
- package/src/input/Select.tsx +5 -4
- package/src/input/Switch.tsx +2 -1
- package/src/input/Textarea.tsx +3 -2
- package/src/input/index.ts +1 -1
- package/src/layout/PressableCard.tsx +2 -1
- package/src/layout/RadioCard.tsx +1 -0
- package/src/layout/Separator.tsx +2 -1
- package/src/layout/StaticCard.tsx +2 -1
- package/src/layout/index.tsx +16 -16
- package/src/linjetag/InfoTag.tsx +2 -1
- package/src/linjetag/LineIcon.tsx +1 -0
- package/src/linjetag/TravelTag.tsx +2 -1
- package/src/linjetag/icons.tsx +1 -0
- package/src/link/TextLink.tsx +1 -0
- package/src/loader/ClientOnly.tsx +1 -0
- package/src/loader/ColorInlineLoader.tsx +1 -0
- package/src/loader/ColorSpinner.tsx +1 -0
- package/src/loader/ContentLoader.tsx +1 -0
- package/src/loader/DarkFullScreenLoader.tsx +1 -0
- package/src/loader/DarkInlineLoader.tsx +1 -0
- package/src/loader/DarkSpinner.tsx +1 -0
- package/src/loader/LightFullScreenLoader.tsx +1 -0
- package/src/loader/LightInlineLoader.tsx +1 -0
- package/src/loader/LightSpinner.tsx +1 -0
- package/src/loader/Lottie.tsx +1 -2
- package/src/loader/ProgressBar.tsx +2 -1
- package/src/loader/ProgressLoader.tsx +3 -2
- package/src/loader/Skeleton.tsx +4 -3
- package/src/loader/useHydrated.tsx +1 -1
- package/src/logo/VyLogo.tsx +1 -0
- package/src/logo/VyLogoPride.tsx +1 -0
- package/src/logo/index.tsx +1 -1
- package/src/media-controller/JumpButton.tsx +3 -2
- package/src/media-controller/PlayPauseButton.tsx +3 -2
- package/src/media-controller/SkipButton.tsx +3 -2
- package/src/nudge/Nudge.tsx +14 -14
- package/src/pagination/Pagination.tsx +4 -3
- package/src/pagination/types.ts +2 -1
- package/src/popover/index.tsx +4 -3
- package/src/progress-indicator/ProgressDot.tsx +2 -1
- package/src/progress-indicator/ProgressIndicator.tsx +2 -1
- package/src/provider/SporProvider.tsx +4 -5
- package/src/stepper/Stepper.tsx +2 -1
- package/src/stepper/StepperStep.tsx +1 -0
- package/src/tab/Tabs.tsx +2 -1
- package/src/table/Table.tsx +2 -1
- package/src/table/index.tsx +14 -14
- package/src/theme/index.ts +7 -6
- package/src/theme/recipes/close-button.ts +1 -0
- package/src/theme/recipes/code.ts +1 -0
- package/src/theme/recipes/link.ts +1 -0
- package/src/theme/recipes/pressable-card.ts +2 -1
- package/src/theme/recipes/textarea.ts +1 -0
- package/src/theme/semantic-tokens/colors.ts +1 -1
- package/src/theme/semantic-tokens/index.ts +1 -1
- package/src/theme/slot-recipes/accordion.ts +2 -1
- package/src/theme/slot-recipes/alert-expandable.ts +2 -1
- package/src/theme/slot-recipes/alert-service.ts +1 -0
- package/src/theme/slot-recipes/alert.ts +1 -0
- package/src/theme/slot-recipes/breadcrumb.ts +2 -1
- package/src/theme/slot-recipes/checkbox.ts +1 -0
- package/src/theme/slot-recipes/datepicker.ts +1 -0
- package/src/theme/slot-recipes/dialog.ts +1 -0
- package/src/theme/slot-recipes/drawer.ts +1 -0
- package/src/theme/slot-recipes/field.ts +1 -0
- package/src/theme/slot-recipes/floating-action-button.ts +1 -0
- package/src/theme/slot-recipes/index.ts +2 -2
- package/src/theme/slot-recipes/info-tag.ts +3 -2
- package/src/theme/slot-recipes/line-icon.ts +1 -0
- package/src/theme/slot-recipes/list.ts +1 -0
- package/src/theme/slot-recipes/listbox.ts +1 -0
- package/src/theme/slot-recipes/media-controller-button.ts +1 -0
- package/src/theme/slot-recipes/native-select.ts +3 -2
- package/src/theme/slot-recipes/numeric-stepper.ts +1 -0
- package/src/theme/slot-recipes/pagination.ts +1 -0
- package/src/theme/slot-recipes/popover.ts +2 -1
- package/src/theme/slot-recipes/progress-bar.ts +1 -0
- package/src/theme/slot-recipes/radio-card.ts +2 -1
- package/src/theme/slot-recipes/radio.ts +1 -0
- package/src/theme/slot-recipes/select.ts +1 -0
- package/src/theme/slot-recipes/stepper.ts +1 -0
- package/src/theme/slot-recipes/switch.ts +2 -1
- package/src/theme/slot-recipes/table.ts +3 -0
- package/src/theme/slot-recipes/tabs.ts +1 -0
- package/src/theme/slot-recipes/toast.ts +1 -0
- package/src/theme/slot-recipes/travel-tag.ts +1 -0
- package/src/theme/tokens/colors.ts +1 -1
- package/src/theme/tokens/index.ts +4 -4
- package/src/theme/tokens/sizes.ts +1 -0
- package/src/theme/utils/input-utils.ts +1 -1
- package/src/toast/toast.tsx +6 -6
- package/src/transition/index.ts +1 -1
- package/src/typography/Badge.tsx +1 -2
- package/src/typography/Code.tsx +2 -1
- package/src/typography/Heading.tsx +2 -1
- package/src/typography/index.ts +1 -1
- package/src/util/externals.tsx +11 -11
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vygruppen/spor-react",
|
3
|
-
"version": "12.0.
|
3
|
+
"version": "12.0.3",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -13,9 +13,9 @@
|
|
13
13
|
"directory": "packages/spor-react"
|
14
14
|
},
|
15
15
|
"dependencies": {
|
16
|
-
"@chakra-ui/react": "^3.9.0",
|
17
16
|
"@ark-ui/react": "^4.9.2",
|
18
17
|
"@chakra-ui/anatomy": "^2.3.4",
|
18
|
+
"@chakra-ui/react": "^3.9.0",
|
19
19
|
"@chakra-ui/react-use-size": "^2.1.0",
|
20
20
|
"@chakra-ui/styled-system": "^2.12.0",
|
21
21
|
"@chakra-ui/system": "^2.6.2",
|
@@ -35,9 +35,9 @@
|
|
35
35
|
"react-stately": "^3.31.1",
|
36
36
|
"react-swipeable": "^7.0.1",
|
37
37
|
"usehooks-ts": "^3.1.0",
|
38
|
-
"@vygruppen/spor-design-tokens": "4.0.
|
39
|
-
"@vygruppen/spor-
|
40
|
-
"@vygruppen/spor-
|
38
|
+
"@vygruppen/spor-design-tokens": "4.0.1",
|
39
|
+
"@vygruppen/spor-icon-react": "4.0.2",
|
40
|
+
"@vygruppen/spor-loader": "0.6.0"
|
41
41
|
},
|
42
42
|
"devDependencies": {
|
43
43
|
"@chakra-ui/cli": "^3.8.0",
|
@@ -48,6 +48,7 @@
|
|
48
48
|
"@types/node": "^22.13.4",
|
49
49
|
"@types/react": "^18.3.3",
|
50
50
|
"@types/react-dom": "^18.3.0",
|
51
|
+
"eslint": "^9.25.1",
|
51
52
|
"react": "^18.3.1",
|
52
53
|
"react-dom": "^18.3.1",
|
53
54
|
"tsup": "^7.2.0",
|
@@ -55,6 +56,7 @@
|
|
55
56
|
"vitest": "^0.26.3",
|
56
57
|
"vitest-axe": "^0.1.0",
|
57
58
|
"vitest-canvas-mock": "^0.2.2",
|
59
|
+
"@vygruppen/eslint-config": "1.0.0",
|
58
60
|
"@vygruppen/tsconfig": "0.1.0"
|
59
61
|
},
|
60
62
|
"peerDependencies": {
|
@@ -66,6 +68,7 @@
|
|
66
68
|
"dev": "tsup --watch",
|
67
69
|
"typegen": "npx @chakra-ui/cli typegen src/theme/index.ts",
|
68
70
|
"typegen:watch": "npx @chakra-ui/cli typegen src/theme/index.ts --watch",
|
69
|
-
"typegen:strict": "npx @chakra-ui/cli typegen /src/theme/index.ts --strict"
|
71
|
+
"typegen:strict": "npx @chakra-ui/cli typegen /src/theme/index.ts --strict",
|
72
|
+
"lint": "eslint ."
|
70
73
|
}
|
71
74
|
}
|
@@ -1,20 +1,21 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
import {
|
4
|
-
Box,
|
5
4
|
Accordion as ChakraAccordion,
|
5
|
+
Box,
|
6
6
|
HStack,
|
7
7
|
Stack,
|
8
8
|
useSlotRecipe,
|
9
9
|
} from "@chakra-ui/react";
|
10
10
|
import { DropdownDownFill24Icon } from "@vygruppen/spor-icon-react";
|
11
11
|
import React, { forwardRef } from "react";
|
12
|
+
|
13
|
+
import { warnAboutMismatchingIcon } from "./helpers";
|
12
14
|
import {
|
13
|
-
AccordionProps,
|
14
|
-
AccordionItemTriggerProps,
|
15
15
|
AccordionItemContentProps,
|
16
|
+
AccordionItemTriggerProps,
|
17
|
+
AccordionProps,
|
16
18
|
} from "./types";
|
17
|
-
import { warnAboutMismatchingIcon } from "./helpers";
|
18
19
|
|
19
20
|
/*
|
20
21
|
* Wraps a set of AccordionItem or AccordionItem components.
|
@@ -1,14 +1,15 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
import React, { forwardRef } from "react";
|
4
|
+
|
4
5
|
import {
|
5
6
|
Accordion,
|
6
7
|
AccordionItem,
|
7
8
|
AccordionItemContent,
|
8
9
|
AccordionItemTrigger,
|
9
10
|
} from "./Accordion";
|
10
|
-
import { ExpandableItemProps, ExpandableProps } from "./types";
|
11
11
|
import { warnAboutMismatchingIcon } from "./helpers";
|
12
|
+
import { ExpandableItemProps, ExpandableProps } from "./types";
|
12
13
|
|
13
14
|
/**
|
14
15
|
* A standalone expandable component.
|
package/src/accordion/types.ts
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
import { accordionSlotRecipe } from "@/theme/slot-recipes/accordion";
|
2
1
|
import { RecipeVariantProps } from "@chakra-ui/react";
|
3
2
|
import {
|
4
|
-
AccordionRootProps as ChakraAccordionProps,
|
5
3
|
Accordion as ChakraAccordion,
|
4
|
+
AccordionRootProps as ChakraAccordionProps,
|
6
5
|
} from "@chakra-ui/react";
|
7
6
|
import { PropsWithChildren } from "react";
|
8
7
|
|
8
|
+
import { accordionSlotRecipe } from "@/theme/slot-recipes/accordion";
|
9
|
+
|
9
10
|
export type AccordionVariantProps = RecipeVariantProps<
|
10
11
|
typeof accordionSlotRecipe
|
11
12
|
>;
|
package/src/alert/Alert.tsx
CHANGED
@@ -2,14 +2,16 @@
|
|
2
2
|
|
3
3
|
import {
|
4
4
|
Alert as ChakraAlert,
|
5
|
-
useDisclosure,
|
6
5
|
HStack,
|
6
|
+
useDisclosure,
|
7
7
|
useSlotRecipe,
|
8
8
|
} from "@chakra-ui/react";
|
9
|
+
import { IconComponent } from "@vygruppen/spor-icon-react";
|
9
10
|
import React, { forwardRef } from "react";
|
10
|
-
|
11
|
+
|
11
12
|
import { CloseButton } from "@/button";
|
12
|
-
|
13
|
+
|
14
|
+
import { AlertIcon } from "./AlertIcon";
|
13
15
|
|
14
16
|
export type AlertProps = Omit<ChakraAlert.RootProps, "colorPalette"> & {
|
15
17
|
/** Whether or not to show the alert icon */
|
package/src/alert/AlertIcon.tsx
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
|
+
import { Alert as ChakraAlert, Box, useSlotRecipe } from "@chakra-ui/react";
|
3
4
|
import {
|
4
5
|
AltTransportFill24Icon,
|
5
6
|
ErrorFill24Icon,
|
@@ -12,9 +13,9 @@ import {
|
|
12
13
|
WarningFill24Icon,
|
13
14
|
} from "@vygruppen/spor-icon-react";
|
14
15
|
import React, { PropsWithChildren } from "react";
|
16
|
+
|
15
17
|
import { createTexts, useTranslation } from "../i18n";
|
16
18
|
import { AlertProps } from "./Alert";
|
17
|
-
import { Box, useSlotRecipe, Alert as ChakraAlert } from "@chakra-ui/react";
|
18
19
|
|
19
20
|
type AlertIconProps = {
|
20
21
|
variant: ChakraAlert.RootProps["variant"];
|
@@ -9,12 +9,14 @@ import {
|
|
9
9
|
Span,
|
10
10
|
useSlotRecipe,
|
11
11
|
} from "@chakra-ui/react";
|
12
|
-
import React, { forwardRef, PropsWithChildren } from "react";
|
13
|
-
import { AlertIcon } from "./AlertIcon";
|
14
|
-
import { AlertProps } from "./Alert";
|
15
|
-
import { alertExpandableSlotRecipe } from "@/theme/slot-recipes/alert-expandable";
|
16
12
|
import { DropdownDownFill18Icon } from "@vygruppen/spor-icon-react";
|
13
|
+
import React, { forwardRef, PropsWithChildren } from "react";
|
14
|
+
|
17
15
|
import { AccordionItemContent } from "@/accordion";
|
16
|
+
import { alertExpandableSlotRecipe } from "@/theme/slot-recipes/alert-expandable";
|
17
|
+
|
18
|
+
import { AlertProps } from "./Alert";
|
19
|
+
import { AlertIcon } from "./AlertIcon";
|
18
20
|
|
19
21
|
type ExpandableAlertVariantProps = RecipeVariantProps<
|
20
22
|
typeof alertExpandableSlotRecipe
|
@@ -10,15 +10,16 @@ import {
|
|
10
10
|
Text,
|
11
11
|
useSlotRecipe,
|
12
12
|
} from "@chakra-ui/react";
|
13
|
-
import React, { forwardRef, PropsWithChildren } from "react";
|
14
|
-
import { AlertProps } from "./Alert";
|
15
|
-
import { createTexts, useTranslation } from "../i18n";
|
16
|
-
import { alertServiceSlotRecipe } from "../theme/slot-recipes/alert-service";
|
17
13
|
import {
|
18
14
|
DropdownDownFill24Icon,
|
19
15
|
ServiceFill24Icon,
|
20
16
|
WarningFill24Icon,
|
21
17
|
} from "@vygruppen/spor-icon-react";
|
18
|
+
import React, { forwardRef, PropsWithChildren } from "react";
|
19
|
+
|
20
|
+
import { createTexts, useTranslation } from "../i18n";
|
21
|
+
import { alertServiceSlotRecipe } from "../theme/slot-recipes/alert-service";
|
22
|
+
import { AlertProps } from "./Alert";
|
22
23
|
|
23
24
|
type ServiceAlertVariantProps = RecipeVariantProps<
|
24
25
|
typeof alertServiceSlotRecipe
|
package/src/alert/index.ts
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
|
-
import React, { forwardRef } from "react";
|
4
3
|
import {
|
5
4
|
Breadcrumb as ChakraBreadcrumb,
|
6
|
-
BreadcrumbRootProps,
|
7
|
-
BreadcrumbLink as ChakraBreadcrumbLink,
|
8
5
|
BreadcrumbCurrentLink as ChakraBreadcrumbCurrentLink,
|
9
6
|
BreadcrumbEllipsis as ChakraBreadcrumbEllipsis,
|
7
|
+
BreadcrumbLink as ChakraBreadcrumbLink,
|
8
|
+
BreadcrumbRootProps,
|
10
9
|
} from "@chakra-ui/react";
|
11
10
|
import { DropdownRightFill18Icon } from "@vygruppen/spor-icon-react";
|
11
|
+
import React, { forwardRef } from "react";
|
12
12
|
/**
|
13
13
|
* A breadcrumb component.
|
14
14
|
*
|
package/src/button/Button.tsx
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
import {
|
2
2
|
Box,
|
3
|
-
Center,
|
4
3
|
Button as ChakraButton,
|
5
|
-
Flex,
|
6
|
-
Span,
|
7
4
|
type ButtonProps as ChakraButtonProps,
|
5
|
+
Center,
|
6
|
+
Flex,
|
8
7
|
type RecipeVariantProps,
|
8
|
+
Span,
|
9
9
|
} from "@chakra-ui/react";
|
10
10
|
import React, { forwardRef, PropsWithChildren } from "react";
|
11
|
+
|
11
12
|
import { createTexts, useTranslation } from "../i18n";
|
12
13
|
import { ColorInlineLoader } from "../loader";
|
13
14
|
import { buttonRecipe } from "../theme/recipes/button";
|
@@ -1,12 +1,13 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
import {
|
4
|
-
|
4
|
+
chakra,
|
5
5
|
Group as ChakraGroup,
|
6
|
+
type GroupProps as ChakraGroupProps,
|
6
7
|
type RecipeVariantProps,
|
7
|
-
chakra,
|
8
8
|
} from "@chakra-ui/react";
|
9
9
|
import React, { forwardRef, PropsWithChildren } from "react";
|
10
|
+
|
10
11
|
import { groupRecipe } from "../theme/recipes/group";
|
11
12
|
|
12
13
|
export type GroupVariantProps = RecipeVariantProps<typeof groupRecipe>;
|
package/src/button/Clipboard.tsx
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
import { Clipboard as ChakraClipboard } from "@chakra-ui/react";
|
2
|
-
import * as React from "react";
|
3
|
-
import { createTexts, useTranslation } from "@/i18n";
|
4
2
|
import {
|
5
3
|
CheckmarkFill18Icon,
|
6
4
|
CopyOutline18Icon,
|
7
5
|
} from "@vygruppen/spor-icon-react";
|
8
|
-
import
|
6
|
+
import * as React from "react";
|
7
|
+
|
8
|
+
import { createTexts, useTranslation } from "@/i18n";
|
9
9
|
import { Text } from "@/typography";
|
10
10
|
|
11
|
+
import { Button, ButtonProps } from "./Button";
|
12
|
+
|
11
13
|
/**
|
12
14
|
*
|
13
15
|
* Creates a button that copies text to the clipboard.
|
@@ -8,6 +8,7 @@ import {
|
|
8
8
|
useSlotRecipe,
|
9
9
|
} from "@chakra-ui/react";
|
10
10
|
import React, { forwardRef, PropsWithChildren, useEffect } from "react";
|
11
|
+
|
11
12
|
import { floatingActionButtonSlotRecipe } from "../theme/slot-recipes/floating-action-button";
|
12
13
|
|
13
14
|
type FloatingActionButtonVariantProps = RecipeVariantProps<
|
package/src/button/index.tsx
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
import type { IconButtonProps } from "@chakra-ui/react";
|
4
4
|
import { ClientOnly, IconButton, Skeleton } from "@chakra-ui/react";
|
5
|
-
import { ThemeProvider, useTheme } from "next-themes";
|
6
5
|
import type { ThemeProviderProps } from "next-themes";
|
6
|
+
import { ThemeProvider, useTheme } from "next-themes";
|
7
7
|
import * as React from "react";
|
8
8
|
import { LuMoon, LuSun } from "react-icons/lu";
|
9
9
|
|
@@ -5,16 +5,18 @@ import { createCalendar } from "@internationalized/date";
|
|
5
5
|
import React from "react";
|
6
6
|
import {
|
7
7
|
CalendarProps as ReactAriaCalendarProps,
|
8
|
-
useCalendar,
|
9
8
|
DateValue,
|
9
|
+
useCalendar,
|
10
10
|
} from "react-aria";
|
11
11
|
import { useCalendarState } from "react-stately";
|
12
|
+
|
13
|
+
import { datePickerSlotRecipe } from "@/theme/slot-recipes/datepicker";
|
14
|
+
|
12
15
|
import { createTexts, useTranslation } from "../i18n";
|
13
16
|
import { CalendarGrid } from "./CalendarGrid";
|
14
17
|
import { CalendarHeader } from "./CalendarHeader";
|
15
|
-
import { useCurrentLocale } from "./utils";
|
16
18
|
import { CalendarVariants } from "./types";
|
17
|
-
import {
|
19
|
+
import { useCurrentLocale } from "./utils";
|
18
20
|
|
19
21
|
type CalendarProps = ReactAriaCalendarProps<DateValue> &
|
20
22
|
CalendarVariants & {
|
@@ -10,8 +10,9 @@ import {
|
|
10
10
|
import React, { PropsWithChildren, useEffect, useRef } from "react";
|
11
11
|
import { useCalendarCell } from "react-aria";
|
12
12
|
import { CalendarState, RangeCalendarState } from "react-stately";
|
13
|
-
|
13
|
+
|
14
14
|
import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
|
15
|
+
import { DatePickerVariantProps } from "./DatePicker";
|
15
16
|
import { CalendarVariants } from "./types";
|
16
17
|
|
17
18
|
type CalendarCellProps = PropsWithChildren<DatePickerVariantProps> &
|
@@ -1,16 +1,17 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
|
+
import { Box, useSlotRecipe } from "@chakra-ui/react";
|
3
4
|
import { endOfMonth, getWeeksInMonth } from "@internationalized/date";
|
4
5
|
import React from "react";
|
5
6
|
import { AriaCalendarGridProps, useCalendarGrid } from "react-aria";
|
6
7
|
import { CalendarState, RangeCalendarState } from "react-stately";
|
8
|
+
|
7
9
|
import { Language, useTranslation } from "../i18n";
|
10
|
+
import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
|
8
11
|
import { Text } from "../typography";
|
9
12
|
import { CalendarCell } from "./CalendarCell";
|
10
|
-
import { useCurrentLocale } from "./utils";
|
11
|
-
import { Box, useSlotRecipe } from "@chakra-ui/react";
|
12
|
-
import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
|
13
13
|
import { CalendarVariants } from "./types";
|
14
|
+
import { useCurrentLocale } from "./utils";
|
14
15
|
|
15
16
|
const weekDays: Record<Language, string[]> = {
|
16
17
|
nb: ["Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"],
|
@@ -7,6 +7,7 @@ import {
|
|
7
7
|
} from "@vygruppen/spor-icon-react";
|
8
8
|
import React from "react";
|
9
9
|
import { CalendarState, RangeCalendarState } from "react-stately";
|
10
|
+
|
10
11
|
import { createTexts, useTranslation } from "../i18n";
|
11
12
|
import { CalendarNavigationButton } from "./CalendarNavigationButton";
|
12
13
|
import { useCurrentLocale } from "./utils";
|
@@ -4,6 +4,7 @@ import { BoxProps, PopoverAnchor, useSlotRecipe } from "@chakra-ui/react";
|
|
4
4
|
import { CalendarOutline24Icon } from "@vygruppen/spor-icon-react";
|
5
5
|
import React, { forwardRef, PropsWithChildren } from "react";
|
6
6
|
import { AriaButtonProps } from "react-aria";
|
7
|
+
|
7
8
|
import {
|
8
9
|
createTexts,
|
9
10
|
DatePickerVariantProps,
|
@@ -2,14 +2,15 @@
|
|
2
2
|
import { Box, Flex, useSlotRecipe } from "@chakra-ui/react";
|
3
3
|
import { DateValue, GregorianCalendar } from "@internationalized/date";
|
4
4
|
import { DOMAttributes, FocusableElement } from "@react-types/shared";
|
5
|
-
import React, { PropsWithChildren, RefObject,
|
5
|
+
import React, { forwardRef, PropsWithChildren, RefObject, useRef } from "react";
|
6
6
|
import { AriaDateFieldProps, useDateField } from "react-aria";
|
7
7
|
import { DateSegment, useDateFieldState } from "react-stately";
|
8
|
-
|
9
|
-
import { useCurrentLocale } from "./utils";
|
8
|
+
|
10
9
|
import { createTexts, useTranslation } from "../i18n";
|
11
|
-
import { DatePickerVariantProps } from "./DatePicker";
|
12
10
|
import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
|
11
|
+
import { DatePickerVariantProps } from "./DatePicker";
|
12
|
+
import { DateTimeSegment } from "./DateTimeSegment";
|
13
|
+
import { useCurrentLocale } from "./utils";
|
13
14
|
|
14
15
|
function createCalendar(identifier: string) {
|
15
16
|
switch (identifier) {
|
@@ -1,5 +1,4 @@
|
|
1
1
|
"use client";
|
2
|
-
import { Field } from "@/input/Field";
|
3
2
|
import {
|
4
3
|
Box,
|
5
4
|
BoxProps,
|
@@ -11,9 +10,9 @@ import {
|
|
11
10
|
useSlotRecipe,
|
12
11
|
} from "@chakra-ui/react";
|
13
12
|
import React, {
|
13
|
+
forwardRef,
|
14
14
|
PropsWithChildren,
|
15
15
|
ReactNode,
|
16
|
-
forwardRef,
|
17
16
|
useId,
|
18
17
|
useRef,
|
19
18
|
} from "react";
|
@@ -24,6 +23,9 @@ import {
|
|
24
23
|
useDatePicker,
|
25
24
|
} from "react-aria";
|
26
25
|
import { useDatePickerState } from "react-stately";
|
26
|
+
|
27
|
+
import { Field } from "@/input/Field";
|
28
|
+
|
27
29
|
import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
|
28
30
|
import { Calendar } from "./Calendar";
|
29
31
|
import { CalendarTriggerButton } from "./CalendarTriggerButton";
|
@@ -2,8 +2,8 @@
|
|
2
2
|
import {
|
3
3
|
Box,
|
4
4
|
BoxProps,
|
5
|
-
PopoverAnchor,
|
6
5
|
Popover as ChakraPopover,
|
6
|
+
PopoverAnchor,
|
7
7
|
Portal,
|
8
8
|
useFieldContext,
|
9
9
|
useSlotRecipe,
|
@@ -17,16 +17,16 @@ import {
|
|
17
17
|
useId,
|
18
18
|
} from "react-aria";
|
19
19
|
import { useDateRangePickerState } from "react-stately";
|
20
|
-
import { DateField } from "./DateField";
|
21
|
-
import { RangeCalendar } from "./RangeCalendar";
|
22
|
-
import { StyledField } from "./StyledField";
|
23
|
-
import { useCurrentLocale } from "./utils";
|
24
20
|
|
25
21
|
import { Field } from "../input/Field";
|
26
|
-
import { DatePickerVariantProps } from "./DatePicker";
|
27
22
|
import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
|
28
|
-
import { CalendarVariants } from "./types";
|
29
23
|
import { CalendarTriggerButton } from "./CalendarTriggerButton";
|
24
|
+
import { DateField } from "./DateField";
|
25
|
+
import { DatePickerVariantProps } from "./DatePicker";
|
26
|
+
import { RangeCalendar } from "./RangeCalendar";
|
27
|
+
import { StyledField } from "./StyledField";
|
28
|
+
import { CalendarVariants } from "./types";
|
29
|
+
import { useCurrentLocale } from "./utils";
|
30
30
|
|
31
31
|
type DateRangePickerProps = Omit<
|
32
32
|
AriaDateRangePickerProps<DateValue>,
|
@@ -1,10 +1,11 @@
|
|
1
1
|
"use client";
|
2
2
|
import { Box, useSlotRecipe } from "@chakra-ui/react";
|
3
|
-
import React, { PropsWithChildren, RefObject,
|
3
|
+
import React, { forwardRef, PropsWithChildren, RefObject, useRef } from "react";
|
4
4
|
import { useDateSegment } from "react-aria";
|
5
5
|
import { DateFieldState, DateSegment } from "react-stately";
|
6
|
-
|
6
|
+
|
7
7
|
import { DatePickerVariantProps } from "..";
|
8
|
+
import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
|
8
9
|
|
9
10
|
type DateTimeSegmentProps = PropsWithChildren<DatePickerVariantProps> & {
|
10
11
|
segment: DateSegment;
|
@@ -1,17 +1,19 @@
|
|
1
1
|
"use client";
|
2
2
|
import { Box, useSlotRecipe } from "@chakra-ui/react";
|
3
|
-
import {
|
3
|
+
import { createCalendar, DateValue } from "@internationalized/date";
|
4
4
|
import React, { useRef } from "react";
|
5
5
|
import {
|
6
6
|
RangeCalendarProps as ReactAriaRangeCalendarProps,
|
7
7
|
useRangeCalendar,
|
8
8
|
} from "react-aria";
|
9
9
|
import { useRangeCalendarState } from "react-stately";
|
10
|
+
|
11
|
+
import { datePickerSlotRecipe } from "@/theme/slot-recipes/datepicker";
|
12
|
+
|
10
13
|
import { CalendarGrid } from "./CalendarGrid";
|
11
14
|
import { CalendarHeader } from "./CalendarHeader";
|
12
|
-
import { useCurrentLocale } from "./utils";
|
13
15
|
import { CalendarVariants } from "./types";
|
14
|
-
import {
|
16
|
+
import { useCurrentLocale } from "./utils";
|
15
17
|
|
16
18
|
type RangeCalendarProps = ReactAriaRangeCalendarProps<DateValue> &
|
17
19
|
CalendarVariants;
|
@@ -6,8 +6,9 @@ import {
|
|
6
6
|
useSlotRecipe,
|
7
7
|
} from "@chakra-ui/react";
|
8
8
|
import React, { forwardRef, PropsWithChildren } from "react";
|
9
|
-
|
9
|
+
|
10
10
|
import { datePickerSlotRecipe } from "../theme/slot-recipes/datepicker";
|
11
|
+
import { DatePickerVariantProps } from "./DatePicker";
|
11
12
|
import { CalendarVariants } from "./types";
|
12
13
|
|
13
14
|
type StyledFieldProps = BoxProps &
|
@@ -1,9 +1,10 @@
|
|
1
1
|
"use client";
|
2
2
|
import { Box, Flex } from "@chakra-ui/react";
|
3
3
|
import { CalendarDateTime, Time } from "@internationalized/date";
|
4
|
+
import { TimeFieldState } from "@react-stately/datepicker";
|
4
5
|
import React, { useRef } from "react";
|
5
6
|
import { AriaTimeFieldProps, useTimeField } from "react-aria";
|
6
|
-
|
7
|
+
|
7
8
|
import { DateTimeSegment } from "./DateTimeSegment";
|
8
9
|
import { getTimestampFromTime } from "./utils";
|
9
10
|
|
@@ -8,11 +8,13 @@ import {
|
|
8
8
|
} from "@vygruppen/spor-icon-react";
|
9
9
|
import React from "react";
|
10
10
|
import { useTimeFieldState } from "react-stately";
|
11
|
-
|
11
|
+
|
12
|
+
import { Field } from "@/input/Field";
|
13
|
+
|
14
|
+
import { createTexts, IconButton, useTranslation } from "..";
|
12
15
|
import { StyledField } from "./StyledField";
|
13
16
|
import { TimeField } from "./TimeField";
|
14
17
|
import { getCurrentTime, useCurrentLocale } from "./utils";
|
15
|
-
import { Field } from "@/input/Field";
|
16
18
|
|
17
19
|
type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
|
18
20
|
/** The label. Defaults to a localized version of "Time" */
|
package/src/datepicker/index.tsx
CHANGED
package/src/datepicker/utils.ts
CHANGED
package/src/dialog/Dialog.tsx
CHANGED
package/src/dialog/Drawer.tsx
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
import {
|
4
4
|
Box,
|
5
|
-
Drawer as ChakraDrawer,
|
6
5
|
createContext,
|
6
|
+
Drawer as ChakraDrawer,
|
7
7
|
Grid,
|
8
8
|
GridItem,
|
9
9
|
Portal,
|
@@ -13,6 +13,7 @@ import {
|
|
13
13
|
CloseFill24Icon,
|
14
14
|
} from "@vygruppen/spor-icon-react";
|
15
15
|
import React, { forwardRef } from "react";
|
16
|
+
|
16
17
|
import { Button, CloseButton } from "../button";
|
17
18
|
import { createTexts, useTranslation } from "../i18n";
|
18
19
|
import {
|
package/src/dialog/index.ts
CHANGED
package/src/dialog/types.ts
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
import {
|
2
|
-
import { RecipeVariantProps, Drawer as ChakraDrawer } from "@chakra-ui/react";
|
1
|
+
import { Drawer as ChakraDrawer, RecipeVariantProps } from "@chakra-ui/react";
|
3
2
|
import { PropsWithChildren } from "react";
|
4
3
|
|
4
|
+
import { drawerSlotRecipe } from "@/theme/slot-recipes/drawer";
|
5
|
+
|
5
6
|
export type DrawerVariantProps = RecipeVariantProps<typeof drawerSlotRecipe>;
|
6
7
|
|
7
8
|
export type DrawerContentProps = ChakraDrawer.ContentProps &
|
package/src/image/index.tsx
CHANGED