@qasa/qds-ui 0.11.0 → 0.13.0-next.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/dist/index.d.mts +5416 -0
- package/dist/index.d.ts +14 -12
- package/dist/index.js +819 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +703 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +16 -15
- package/dist/cjs/index.js +0 -9237
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/types/components/_internal/form-parts.d.ts +0 -10
- package/dist/cjs/types/components/_internal/index.d.ts +0 -1
- package/dist/cjs/types/components/avatar/avatar.d.ts +0 -32
- package/dist/cjs/types/components/avatar/index.d.ts +0 -1
- package/dist/cjs/types/components/button/button-icon.d.ts +0 -10
- package/dist/cjs/types/components/button/button-styles.d.ts +0 -907
- package/dist/cjs/types/components/button/button-types.d.ts +0 -44
- package/dist/cjs/types/components/button/button.d.ts +0 -6
- package/dist/cjs/types/components/button/index.d.ts +0 -1
- package/dist/cjs/types/components/checkbox/checkbox.d.ts +0 -78
- package/dist/cjs/types/components/checkbox/index.d.ts +0 -1
- package/dist/cjs/types/components/display-text/display-text.d.ts +0 -30
- package/dist/cjs/types/components/display-text/index.d.ts +0 -1
- package/dist/cjs/types/components/divider/divider.d.ts +0 -14
- package/dist/cjs/types/components/divider/index.d.ts +0 -1
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu-content.d.ts +0 -67
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu-divider.d.ts +0 -4
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu-item.d.ts +0 -28
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu-trigger.d.ts +0 -5
- package/dist/cjs/types/components/dropdown-menu/dropdown-menu.d.ts +0 -29
- package/dist/cjs/types/components/dropdown-menu/index.d.ts +0 -1
- package/dist/cjs/types/components/heading/heading.d.ts +0 -32
- package/dist/cjs/types/components/heading/index.d.ts +0 -1
- package/dist/cjs/types/components/hint-box/hint-box.d.ts +0 -10
- package/dist/cjs/types/components/hint-box/index.d.ts +0 -1
- package/dist/cjs/types/components/icon/create-icon.d.ts +0 -41
- package/dist/cjs/types/components/icon/create-lucide-icon.d.ts +0 -4
- package/dist/cjs/types/components/icon/icon.types.d.ts +0 -22
- package/dist/cjs/types/components/icon/icons.d.ts +0 -47
- package/dist/cjs/types/components/icon/index.d.ts +0 -4
- package/dist/cjs/types/components/icon-button/icon-button-styles.d.ts +0 -880
- package/dist/cjs/types/components/icon-button/icon-button.d.ts +0 -32
- package/dist/cjs/types/components/icon-button/index.d.ts +0 -1
- package/dist/cjs/types/components/index.d.ts +0 -23
- package/dist/cjs/types/components/label/index.d.ts +0 -1
- package/dist/cjs/types/components/label/label.d.ts +0 -444
- package/dist/cjs/types/components/link/index.d.ts +0 -1
- package/dist/cjs/types/components/link/link.d.ts +0 -15
- package/dist/cjs/types/components/loading-dots/index.d.ts +0 -1
- package/dist/cjs/types/components/loading-dots/loading-dots.d.ts +0 -424
- package/dist/cjs/types/components/paragraph/index.d.ts +0 -1
- package/dist/cjs/types/components/paragraph/paragraph.d.ts +0 -475
- package/dist/cjs/types/components/primitives/index.d.ts +0 -3
- package/dist/cjs/types/components/primitives/input-base/index.d.ts +0 -1
- package/dist/cjs/types/components/primitives/input-base/input-base.d.ts +0 -21
- package/dist/cjs/types/components/primitives/select-base/index.d.ts +0 -1
- package/dist/cjs/types/components/primitives/select-base/select-base.d.ts +0 -30
- package/dist/cjs/types/components/primitives/textarea-base/index.d.ts +0 -1
- package/dist/cjs/types/components/primitives/textarea-base/textarea-base.d.ts +0 -36
- package/dist/cjs/types/components/radio-group/index.d.ts +0 -1
- package/dist/cjs/types/components/radio-group/radio-card.d.ts +0 -26
- package/dist/cjs/types/components/radio-group/radio-group-context.d.ts +0 -16
- package/dist/cjs/types/components/radio-group/radio-group-label.d.ts +0 -4
- package/dist/cjs/types/components/radio-group/radio-group.d.ts +0 -50
- package/dist/cjs/types/components/radio-group/radio-indicator.d.ts +0 -10
- package/dist/cjs/types/components/select/index.d.ts +0 -1
- package/dist/cjs/types/components/select/select-option.d.ts +0 -10
- package/dist/cjs/types/components/select/select.d.ts +0 -25
- package/dist/cjs/types/components/spacer/index.d.ts +0 -1
- package/dist/cjs/types/components/spacer/spacer.d.ts +0 -12
- package/dist/cjs/types/components/stack/index.d.ts +0 -1
- package/dist/cjs/types/components/stack/stack.d.ts +0 -44
- package/dist/cjs/types/components/stack/stack.types.d.ts +0 -4
- package/dist/cjs/types/components/stack/stack.utils.d.ts +0 -6
- package/dist/cjs/types/components/switch/index.d.ts +0 -1
- package/dist/cjs/types/components/switch/switch.d.ts +0 -35
- package/dist/cjs/types/components/text-field/index.d.ts +0 -1
- package/dist/cjs/types/components/text-field/text-field.d.ts +0 -32
- package/dist/cjs/types/components/textarea/index.d.ts +0 -1
- package/dist/cjs/types/components/textarea/textarea.d.ts +0 -27
- package/dist/cjs/types/components/toast/index.d.ts +0 -1
- package/dist/cjs/types/components/toast/toast-provider.d.ts +0 -4
- package/dist/cjs/types/components/toast/toast-store.d.ts +0 -44
- package/dist/cjs/types/components/toast/toast-styles.d.ts +0 -416
- package/dist/cjs/types/components/toast/toast.d.ts +0 -12
- package/dist/cjs/types/hooks/index.d.ts +0 -6
- package/dist/cjs/types/hooks/use-breakpoint-value.d.ts +0 -16
- package/dist/cjs/types/hooks/use-breakpoint.d.ts +0 -15
- package/dist/cjs/types/hooks/use-form-field.d.ts +0 -49
- package/dist/cjs/types/hooks/use-image.d.ts +0 -10
- package/dist/cjs/types/hooks/use-responsive-prop.d.ts +0 -16
- package/dist/cjs/types/hooks/use-safe-layout-effect.d.ts +0 -9
- package/dist/cjs/types/hooks/use-stable-id.d.ts +0 -4
- package/dist/cjs/types/i18n/locale-context.d.ts +0 -12
- package/dist/cjs/types/i18n/locales.d.ts +0 -8
- package/dist/cjs/types/i18n/use-translation.d.ts +0 -6
- package/dist/cjs/types/index.d.ts +0 -6
- package/dist/cjs/types/qds-provider.d.ts +0 -12
- package/dist/cjs/types/styles/common-styles.d.ts +0 -450
- package/dist/cjs/types/styles/css-reset.d.ts +0 -4
- package/dist/cjs/types/styles/css-utils.d.ts +0 -19
- package/dist/cjs/types/styles/global-styles.d.ts +0 -4
- package/dist/cjs/types/styles/index.d.ts +0 -3
- package/dist/cjs/types/theme/foundations/breakpoints.d.ts +0 -8
- package/dist/cjs/types/theme/foundations/colors.d.ts +0 -116
- package/dist/cjs/types/theme/foundations/index.d.ts +0 -410
- package/dist/cjs/types/theme/foundations/radius.d.ts +0 -20
- package/dist/cjs/types/theme/foundations/shadows.d.ts +0 -7
- package/dist/cjs/types/theme/foundations/sizes.d.ts +0 -34
- package/dist/cjs/types/theme/foundations/spacing.d.ts +0 -30
- package/dist/cjs/types/theme/foundations/typography.d.ts +0 -189
- package/dist/cjs/types/theme/foundations/z-index.d.ts +0 -28
- package/dist/cjs/types/theme/index.d.ts +0 -2
- package/dist/cjs/types/theme/theme-tools.d.ts +0 -420
- package/dist/cjs/types/theme/theme.d.ts +0 -406
- package/dist/cjs/types/types.d.ts +0 -5
- package/dist/cjs/types/utils/html-attributes.d.ts +0 -4
- package/dist/cjs/types/utils/merge-refs.d.ts +0 -5
- package/dist/cjs/types/utils/object.d.ts +0 -1
- package/dist/cjs/types/utils/polymorphic.d.ts +0 -41
- package/dist/esm/index.js +0 -9237
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/_internal/form-parts.d.ts +0 -10
- package/dist/esm/types/components/_internal/index.d.ts +0 -1
- package/dist/esm/types/components/avatar/avatar.d.ts +0 -32
- package/dist/esm/types/components/avatar/index.d.ts +0 -1
- package/dist/esm/types/components/button/button-icon.d.ts +0 -10
- package/dist/esm/types/components/button/button-styles.d.ts +0 -907
- package/dist/esm/types/components/button/button-types.d.ts +0 -44
- package/dist/esm/types/components/button/button.d.ts +0 -6
- package/dist/esm/types/components/button/index.d.ts +0 -1
- package/dist/esm/types/components/checkbox/checkbox.d.ts +0 -78
- package/dist/esm/types/components/checkbox/index.d.ts +0 -1
- package/dist/esm/types/components/display-text/display-text.d.ts +0 -30
- package/dist/esm/types/components/display-text/index.d.ts +0 -1
- package/dist/esm/types/components/divider/divider.d.ts +0 -14
- package/dist/esm/types/components/divider/index.d.ts +0 -1
- package/dist/esm/types/components/dropdown-menu/dropdown-menu-content.d.ts +0 -67
- package/dist/esm/types/components/dropdown-menu/dropdown-menu-divider.d.ts +0 -4
- package/dist/esm/types/components/dropdown-menu/dropdown-menu-item.d.ts +0 -28
- package/dist/esm/types/components/dropdown-menu/dropdown-menu-trigger.d.ts +0 -5
- package/dist/esm/types/components/dropdown-menu/dropdown-menu.d.ts +0 -29
- package/dist/esm/types/components/dropdown-menu/index.d.ts +0 -1
- package/dist/esm/types/components/heading/heading.d.ts +0 -32
- package/dist/esm/types/components/heading/index.d.ts +0 -1
- package/dist/esm/types/components/hint-box/hint-box.d.ts +0 -10
- package/dist/esm/types/components/hint-box/index.d.ts +0 -1
- package/dist/esm/types/components/icon/create-icon.d.ts +0 -41
- package/dist/esm/types/components/icon/create-lucide-icon.d.ts +0 -4
- package/dist/esm/types/components/icon/icon.types.d.ts +0 -22
- package/dist/esm/types/components/icon/icons.d.ts +0 -47
- package/dist/esm/types/components/icon/index.d.ts +0 -4
- package/dist/esm/types/components/icon-button/icon-button-styles.d.ts +0 -880
- package/dist/esm/types/components/icon-button/icon-button.d.ts +0 -32
- package/dist/esm/types/components/icon-button/index.d.ts +0 -1
- package/dist/esm/types/components/index.d.ts +0 -23
- package/dist/esm/types/components/label/index.d.ts +0 -1
- package/dist/esm/types/components/label/label.d.ts +0 -444
- package/dist/esm/types/components/link/index.d.ts +0 -1
- package/dist/esm/types/components/link/link.d.ts +0 -15
- package/dist/esm/types/components/loading-dots/index.d.ts +0 -1
- package/dist/esm/types/components/loading-dots/loading-dots.d.ts +0 -424
- package/dist/esm/types/components/paragraph/index.d.ts +0 -1
- package/dist/esm/types/components/paragraph/paragraph.d.ts +0 -475
- package/dist/esm/types/components/primitives/index.d.ts +0 -3
- package/dist/esm/types/components/primitives/input-base/index.d.ts +0 -1
- package/dist/esm/types/components/primitives/input-base/input-base.d.ts +0 -21
- package/dist/esm/types/components/primitives/select-base/index.d.ts +0 -1
- package/dist/esm/types/components/primitives/select-base/select-base.d.ts +0 -30
- package/dist/esm/types/components/primitives/textarea-base/index.d.ts +0 -1
- package/dist/esm/types/components/primitives/textarea-base/textarea-base.d.ts +0 -36
- package/dist/esm/types/components/radio-group/index.d.ts +0 -1
- package/dist/esm/types/components/radio-group/radio-card.d.ts +0 -26
- package/dist/esm/types/components/radio-group/radio-group-context.d.ts +0 -16
- package/dist/esm/types/components/radio-group/radio-group-label.d.ts +0 -4
- package/dist/esm/types/components/radio-group/radio-group.d.ts +0 -50
- package/dist/esm/types/components/radio-group/radio-indicator.d.ts +0 -10
- package/dist/esm/types/components/select/index.d.ts +0 -1
- package/dist/esm/types/components/select/select-option.d.ts +0 -10
- package/dist/esm/types/components/select/select.d.ts +0 -25
- package/dist/esm/types/components/spacer/index.d.ts +0 -1
- package/dist/esm/types/components/spacer/spacer.d.ts +0 -12
- package/dist/esm/types/components/stack/index.d.ts +0 -1
- package/dist/esm/types/components/stack/stack.d.ts +0 -44
- package/dist/esm/types/components/stack/stack.types.d.ts +0 -4
- package/dist/esm/types/components/stack/stack.utils.d.ts +0 -6
- package/dist/esm/types/components/switch/index.d.ts +0 -1
- package/dist/esm/types/components/switch/switch.d.ts +0 -35
- package/dist/esm/types/components/text-field/index.d.ts +0 -1
- package/dist/esm/types/components/text-field/text-field.d.ts +0 -32
- package/dist/esm/types/components/textarea/index.d.ts +0 -1
- package/dist/esm/types/components/textarea/textarea.d.ts +0 -27
- package/dist/esm/types/components/toast/index.d.ts +0 -1
- package/dist/esm/types/components/toast/toast-provider.d.ts +0 -4
- package/dist/esm/types/components/toast/toast-store.d.ts +0 -44
- package/dist/esm/types/components/toast/toast-styles.d.ts +0 -416
- package/dist/esm/types/components/toast/toast.d.ts +0 -12
- package/dist/esm/types/hooks/index.d.ts +0 -6
- package/dist/esm/types/hooks/use-breakpoint-value.d.ts +0 -16
- package/dist/esm/types/hooks/use-breakpoint.d.ts +0 -15
- package/dist/esm/types/hooks/use-form-field.d.ts +0 -49
- package/dist/esm/types/hooks/use-image.d.ts +0 -10
- package/dist/esm/types/hooks/use-responsive-prop.d.ts +0 -16
- package/dist/esm/types/hooks/use-safe-layout-effect.d.ts +0 -9
- package/dist/esm/types/hooks/use-stable-id.d.ts +0 -4
- package/dist/esm/types/i18n/locale-context.d.ts +0 -12
- package/dist/esm/types/i18n/locales.d.ts +0 -8
- package/dist/esm/types/i18n/use-translation.d.ts +0 -6
- package/dist/esm/types/index.d.ts +0 -6
- package/dist/esm/types/qds-provider.d.ts +0 -12
- package/dist/esm/types/styles/common-styles.d.ts +0 -450
- package/dist/esm/types/styles/css-reset.d.ts +0 -4
- package/dist/esm/types/styles/css-utils.d.ts +0 -19
- package/dist/esm/types/styles/global-styles.d.ts +0 -4
- package/dist/esm/types/styles/index.d.ts +0 -3
- package/dist/esm/types/theme/foundations/breakpoints.d.ts +0 -8
- package/dist/esm/types/theme/foundations/colors.d.ts +0 -116
- package/dist/esm/types/theme/foundations/index.d.ts +0 -410
- package/dist/esm/types/theme/foundations/radius.d.ts +0 -20
- package/dist/esm/types/theme/foundations/shadows.d.ts +0 -7
- package/dist/esm/types/theme/foundations/sizes.d.ts +0 -34
- package/dist/esm/types/theme/foundations/spacing.d.ts +0 -30
- package/dist/esm/types/theme/foundations/typography.d.ts +0 -189
- package/dist/esm/types/theme/foundations/z-index.d.ts +0 -28
- package/dist/esm/types/theme/index.d.ts +0 -2
- package/dist/esm/types/theme/theme-tools.d.ts +0 -420
- package/dist/esm/types/theme/theme.d.ts +0 -406
- package/dist/esm/types/types.d.ts +0 -5
- package/dist/esm/types/utils/html-attributes.d.ts +0 -4
- package/dist/esm/types/utils/merge-refs.d.ts +0 -5
- package/dist/esm/types/utils/object.d.ts +0 -1
- package/dist/esm/types/utils/polymorphic.d.ts +0 -41
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as ToastPrimitive from '@radix-ui/react-toast';
|
|
2
|
-
import type { HTMLQdsProps } from '../../types';
|
|
3
|
-
import type { ToastVariant } from './toast-styles';
|
|
4
|
-
interface ToastOptions {
|
|
5
|
-
text: string;
|
|
6
|
-
variant?: ToastVariant;
|
|
7
|
-
}
|
|
8
|
-
type OmittedProps = 'children';
|
|
9
|
-
interface ToastProps extends Omit<HTMLQdsProps<'div'>, OmittedProps>, ToastOptions {
|
|
10
|
-
}
|
|
11
|
-
export declare function Toast(props: ToastProps & ToastPrimitive.ToastProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Theme } from '../theme';
|
|
2
|
-
import type { PartialRecord } from '../types';
|
|
3
|
-
import type { UseBreakpointOptions } from './use-breakpoint';
|
|
4
|
-
type Breakpoints = Theme['breakpoints'];
|
|
5
|
-
type BreakpointsConfig<T> = PartialRecord<keyof Breakpoints, T> & {
|
|
6
|
-
base: T;
|
|
7
|
-
};
|
|
8
|
-
export type UseBreakpointValueProps<T> = BreakpointsConfig<T>;
|
|
9
|
-
/**
|
|
10
|
-
* Hook for getting a value based on the current breakpoint.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* const width = useBreakpointValue({ base: '150px', md: '250px' })
|
|
14
|
-
*/
|
|
15
|
-
export declare function useBreakpointValue<T>(values: UseBreakpointValueProps<T>, options?: UseBreakpointOptions): T;
|
|
16
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface UseBreakpointOptions {
|
|
2
|
-
/**
|
|
3
|
-
* If `true` the initial value will be `base` instead of the current breakpoint.
|
|
4
|
-
* This is to support hydration when using server side rendering.
|
|
5
|
-
*
|
|
6
|
-
* @default false
|
|
7
|
-
*/
|
|
8
|
-
ssr?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Hook for getting the current breakpoint.
|
|
12
|
-
*/
|
|
13
|
-
export declare function useBreakpoint(params?: UseBreakpointOptions): {
|
|
14
|
-
currentBreakpoint: "2xl" | "base" | "xl" | "lg" | "md" | "sm";
|
|
15
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ElementType } from 'react';
|
|
2
|
-
import type { HTMLQdsProps, LegitimateAny } from '../types';
|
|
3
|
-
type FormFieldElement = 'input' | 'select' | 'textarea';
|
|
4
|
-
type PropGetter<T extends ElementType = LegitimateAny> = (props?: HTMLQdsProps<T>) => Record<string, unknown>;
|
|
5
|
-
interface FormFieldOptions {
|
|
6
|
-
/**
|
|
7
|
-
* The label for the form field
|
|
8
|
-
*/
|
|
9
|
-
label: string;
|
|
10
|
-
/**
|
|
11
|
-
* The error message to display if `isInvalid` is `true`
|
|
12
|
-
*/
|
|
13
|
-
errorMessage?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Text that provides additional guidance to the user
|
|
16
|
-
*/
|
|
17
|
-
helperText?: string;
|
|
18
|
-
/**
|
|
19
|
-
* If `true`, the form field will be invalid
|
|
20
|
-
*/
|
|
21
|
-
isInvalid?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* If `true`, the form field will be disabled
|
|
24
|
-
*/
|
|
25
|
-
isDisabled?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* If `true` the form field will be required
|
|
28
|
-
*/
|
|
29
|
-
isRequired?: boolean;
|
|
30
|
-
}
|
|
31
|
-
type OmittedProps = 'children' | 'readOnly' | 'size';
|
|
32
|
-
export type UseFormFieldProps<T extends FormFieldElement> = Omit<HTMLQdsProps<T>, OmittedProps> & FormFieldOptions;
|
|
33
|
-
/**
|
|
34
|
-
* Custom hook that returns props for a form field's label, input, helper text and error message.
|
|
35
|
-
* Meant to be used in conjunction with the `Input`, `Select` or `Textarea` component.
|
|
36
|
-
*
|
|
37
|
-
* Used internally by `TextField`, `Select` and `Textarea`.
|
|
38
|
-
*/
|
|
39
|
-
export declare const useFormField: <T extends FormFieldElement>(props: UseFormFieldProps<T>) => {
|
|
40
|
-
getLabelProps: PropGetter<"label">;
|
|
41
|
-
/**
|
|
42
|
-
* Props to be spread on the input, select or textarea element.
|
|
43
|
-
* Function accepts an optional object of props to be merged with the returned props.
|
|
44
|
-
*/
|
|
45
|
-
getFieldProps: PropGetter<T>;
|
|
46
|
-
getHelperTextProps: PropGetter<"div">;
|
|
47
|
-
getErrorMessageProps: PropGetter<"div">;
|
|
48
|
-
};
|
|
49
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { HTMLQdsProps } from '../types';
|
|
2
|
-
type LoadingStatus = 'loading' | 'loaded' | 'error' | 'pending';
|
|
3
|
-
export interface UseImageProps {
|
|
4
|
-
src?: string;
|
|
5
|
-
loading?: HTMLQdsProps<'img'>['loading'];
|
|
6
|
-
}
|
|
7
|
-
export declare const useImage: ({ src, loading }: UseImageProps) => {
|
|
8
|
-
loadingStatus: LoadingStatus;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type Theme } from '../theme';
|
|
2
|
-
import { type PartialRecord } from '../types';
|
|
3
|
-
type Breakpoints = Theme['breakpoints'];
|
|
4
|
-
type BreakpointsConfig<T> = PartialRecord<keyof Breakpoints, T> & {
|
|
5
|
-
base: T;
|
|
6
|
-
};
|
|
7
|
-
export type ResponsiveProp<T> = T | BreakpointsConfig<T>;
|
|
8
|
-
/**
|
|
9
|
-
* Hook for responsive props that returns correct value for current breakpoint or static value
|
|
10
|
-
* if user didn't input responsive options
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* const size = useResponsiveProp({ base: 'sm', md: 'lg' })
|
|
14
|
-
*/
|
|
15
|
-
export declare function useResponsiveProp<T>(prop: ResponsiveProp<T>): T | (undefined & T);
|
|
16
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
4
|
-
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
5
|
-
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
6
|
-
*
|
|
7
|
-
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
8
|
-
*/
|
|
9
|
-
export declare const useSafeLayoutEffect: typeof useLayoutEffect;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { LanguageCode } from './locales';
|
|
3
|
-
interface LocaleContextValue {
|
|
4
|
-
currentLanguage: LanguageCode;
|
|
5
|
-
}
|
|
6
|
-
interface LocaleProviderProps {
|
|
7
|
-
language: LanguageCode;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare function LocaleProvider({ language, children }: LocaleProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare function useLocale(): LocaleContextValue;
|
|
12
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const SUPPORTED_LANGUAGE_CODES: readonly ["en", "sv", "fi", "fr"];
|
|
2
|
-
export type LanguageCode = (typeof SUPPORTED_LANGUAGE_CODES)[number];
|
|
3
|
-
export interface Resource {
|
|
4
|
-
close: string;
|
|
5
|
-
optional: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const locales: Record<LanguageCode, Resource>;
|
|
8
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { Options as EmotionCacheOptions } from '@emotion/cache';
|
|
3
|
-
import type { ThemeOverrides } from './theme';
|
|
4
|
-
import type { LanguageCode } from './i18n/locales';
|
|
5
|
-
interface QdsProviderProps {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
themeOverrides?: ThemeOverrides;
|
|
8
|
-
cacheOptions?: Partial<EmotionCacheOptions>;
|
|
9
|
-
locale: LanguageCode;
|
|
10
|
-
}
|
|
11
|
-
export declare function QdsProvider({ children, themeOverrides, cacheOptions, locale }: QdsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,450 +0,0 @@
|
|
|
1
|
-
export declare const getFormFieldBaseStyles: (theme: {
|
|
2
|
-
mediaQueries: {
|
|
3
|
-
readonly smUp: "@media(min-width: 480px)";
|
|
4
|
-
readonly mdUp: "@media(min-width: 768px)";
|
|
5
|
-
readonly lgUp: "@media(min-width: 1024px)";
|
|
6
|
-
readonly xlUp: "@media(min-width: 1280px)";
|
|
7
|
-
readonly '2xlUp': "@media(min-width: 1536px)";
|
|
8
|
-
};
|
|
9
|
-
spacing: {
|
|
10
|
-
'0x': string;
|
|
11
|
-
'1x': string;
|
|
12
|
-
'2x': string;
|
|
13
|
-
'3x': string;
|
|
14
|
-
'4x': string;
|
|
15
|
-
'5x': string;
|
|
16
|
-
'6x': string;
|
|
17
|
-
'8x': string;
|
|
18
|
-
'10x': string;
|
|
19
|
-
'12x': string;
|
|
20
|
-
'14x': string;
|
|
21
|
-
'16x': string;
|
|
22
|
-
'20x': string;
|
|
23
|
-
'24x': string;
|
|
24
|
-
};
|
|
25
|
-
breakpoints: {
|
|
26
|
-
readonly base: 0;
|
|
27
|
-
readonly sm: 480;
|
|
28
|
-
readonly md: 768;
|
|
29
|
-
readonly lg: 1024;
|
|
30
|
-
readonly xl: 1280;
|
|
31
|
-
readonly '2xl': 1536;
|
|
32
|
-
};
|
|
33
|
-
zIndices: {
|
|
34
|
-
hide: number;
|
|
35
|
-
auto: string;
|
|
36
|
-
base: number;
|
|
37
|
-
docked: number;
|
|
38
|
-
dropdown: number;
|
|
39
|
-
sticky: number;
|
|
40
|
-
banner: number;
|
|
41
|
-
overlay: number;
|
|
42
|
-
modal: number;
|
|
43
|
-
popover: number;
|
|
44
|
-
skipLink: number;
|
|
45
|
-
toast: number;
|
|
46
|
-
tooltip: number;
|
|
47
|
-
};
|
|
48
|
-
colors: {
|
|
49
|
-
core: {
|
|
50
|
-
black: string;
|
|
51
|
-
white: string;
|
|
52
|
-
gray90: string;
|
|
53
|
-
gray80: string;
|
|
54
|
-
gray70: string;
|
|
55
|
-
gray60: string;
|
|
56
|
-
gray50: string;
|
|
57
|
-
gray40: string;
|
|
58
|
-
gray30: string;
|
|
59
|
-
gray20: string;
|
|
60
|
-
gray10: string;
|
|
61
|
-
pink: string;
|
|
62
|
-
uiPink: string;
|
|
63
|
-
uiPinkDark: string;
|
|
64
|
-
uiPinkLight: string;
|
|
65
|
-
brown: string;
|
|
66
|
-
brownDark: string;
|
|
67
|
-
brownLight: string;
|
|
68
|
-
offWhite: string;
|
|
69
|
-
offWhiteDark: string;
|
|
70
|
-
offWhiteLight: string;
|
|
71
|
-
softPink: string;
|
|
72
|
-
warmYellow: string;
|
|
73
|
-
softYellow: string;
|
|
74
|
-
red90: string;
|
|
75
|
-
red80: string;
|
|
76
|
-
red70: string;
|
|
77
|
-
red60: string;
|
|
78
|
-
red50: string;
|
|
79
|
-
red40: string;
|
|
80
|
-
red30: string;
|
|
81
|
-
red20: string;
|
|
82
|
-
red10: string;
|
|
83
|
-
green90: string;
|
|
84
|
-
green80: string;
|
|
85
|
-
green70: string;
|
|
86
|
-
green60: string;
|
|
87
|
-
green50: string;
|
|
88
|
-
green40: string;
|
|
89
|
-
green30: string;
|
|
90
|
-
green20: string;
|
|
91
|
-
green10: string;
|
|
92
|
-
blue90: string;
|
|
93
|
-
blue80: string;
|
|
94
|
-
blue70: string;
|
|
95
|
-
blue60: string;
|
|
96
|
-
blue50: string;
|
|
97
|
-
blue40: string;
|
|
98
|
-
blue30: string;
|
|
99
|
-
blue20: string;
|
|
100
|
-
blue10: string;
|
|
101
|
-
yellow90: string;
|
|
102
|
-
yellow80: string;
|
|
103
|
-
yellow70: string;
|
|
104
|
-
yellow60: string;
|
|
105
|
-
yellow50: string;
|
|
106
|
-
yellow40: string;
|
|
107
|
-
yellow30: string;
|
|
108
|
-
yellow20: string;
|
|
109
|
-
yellow10: string;
|
|
110
|
-
blackAlpha20: string;
|
|
111
|
-
};
|
|
112
|
-
bg: {
|
|
113
|
-
default: string;
|
|
114
|
-
brandPrimary: string;
|
|
115
|
-
brandPrimaryHover: string;
|
|
116
|
-
brandPrimaryActive: string;
|
|
117
|
-
brandSecondary: string;
|
|
118
|
-
brandSecondaryHover: string;
|
|
119
|
-
brandSecondaryActive: string;
|
|
120
|
-
brandTertiary: string;
|
|
121
|
-
brandTertiaryHover: string;
|
|
122
|
-
brandTertiaryActive: string;
|
|
123
|
-
negative: string;
|
|
124
|
-
warning: string;
|
|
125
|
-
positive: string;
|
|
126
|
-
inset: string;
|
|
127
|
-
backdrop: string;
|
|
128
|
-
};
|
|
129
|
-
text: {
|
|
130
|
-
strong: string;
|
|
131
|
-
default: string;
|
|
132
|
-
subtle: string;
|
|
133
|
-
disabled: string;
|
|
134
|
-
negative: string;
|
|
135
|
-
warning: string;
|
|
136
|
-
positive: string;
|
|
137
|
-
onBrandPrimary: string;
|
|
138
|
-
onBrandSecondary: string;
|
|
139
|
-
onBrandTertiary: string;
|
|
140
|
-
};
|
|
141
|
-
icon: {
|
|
142
|
-
default: string;
|
|
143
|
-
strong: string;
|
|
144
|
-
subtle: string;
|
|
145
|
-
disabled: string;
|
|
146
|
-
negative: string;
|
|
147
|
-
warning: string;
|
|
148
|
-
positive: string;
|
|
149
|
-
onBrandPrimary: string;
|
|
150
|
-
onBrandSecondary: string;
|
|
151
|
-
onBrandTertiary: string;
|
|
152
|
-
};
|
|
153
|
-
border: {
|
|
154
|
-
default: string;
|
|
155
|
-
defaultHover: string;
|
|
156
|
-
defaultSelected: string;
|
|
157
|
-
strong: string;
|
|
158
|
-
subtle: string;
|
|
159
|
-
negative: string;
|
|
160
|
-
warning: string;
|
|
161
|
-
positive: string;
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
sizes: {
|
|
165
|
-
112: string;
|
|
166
|
-
128: string;
|
|
167
|
-
144: string;
|
|
168
|
-
160: string;
|
|
169
|
-
176: string;
|
|
170
|
-
192: string;
|
|
171
|
-
224: string;
|
|
172
|
-
256: string;
|
|
173
|
-
288: string;
|
|
174
|
-
320: string;
|
|
175
|
-
384: string;
|
|
176
|
-
448: string;
|
|
177
|
-
512: string;
|
|
178
|
-
576: string;
|
|
179
|
-
672: string;
|
|
180
|
-
768: string;
|
|
181
|
-
896: string;
|
|
182
|
-
1024: string;
|
|
183
|
-
'0x': string;
|
|
184
|
-
'1x': string;
|
|
185
|
-
'2x': string;
|
|
186
|
-
'3x': string;
|
|
187
|
-
'4x': string;
|
|
188
|
-
'5x': string;
|
|
189
|
-
'6x': string;
|
|
190
|
-
'8x': string;
|
|
191
|
-
'10x': string;
|
|
192
|
-
'12x': string;
|
|
193
|
-
'14x': string;
|
|
194
|
-
'16x': string;
|
|
195
|
-
'20x': string;
|
|
196
|
-
'24x': string;
|
|
197
|
-
};
|
|
198
|
-
radii: {
|
|
199
|
-
none: string;
|
|
200
|
-
'2xs': string;
|
|
201
|
-
xs: string;
|
|
202
|
-
sm: string;
|
|
203
|
-
md: string;
|
|
204
|
-
lg: string;
|
|
205
|
-
xl: string;
|
|
206
|
-
'2xl': string;
|
|
207
|
-
full: string;
|
|
208
|
-
};
|
|
209
|
-
shadows: {
|
|
210
|
-
none: string;
|
|
211
|
-
sm: string;
|
|
212
|
-
md: string;
|
|
213
|
-
lg: string;
|
|
214
|
-
xl: string;
|
|
215
|
-
};
|
|
216
|
-
typography: {
|
|
217
|
-
display: {
|
|
218
|
-
'3xl': {
|
|
219
|
-
fontFamily: string;
|
|
220
|
-
fontWeight: string;
|
|
221
|
-
fontSize: string;
|
|
222
|
-
lineHeight: string;
|
|
223
|
-
letterSpacing: string;
|
|
224
|
-
fontFeatureSettings: string;
|
|
225
|
-
};
|
|
226
|
-
'2xl': {
|
|
227
|
-
fontFamily: string;
|
|
228
|
-
fontWeight: string;
|
|
229
|
-
fontSize: string;
|
|
230
|
-
lineHeight: string;
|
|
231
|
-
letterSpacing: string;
|
|
232
|
-
fontFeatureSettings: string;
|
|
233
|
-
};
|
|
234
|
-
xl: {
|
|
235
|
-
fontFamily: string;
|
|
236
|
-
fontWeight: string;
|
|
237
|
-
fontSize: string;
|
|
238
|
-
lineHeight: string;
|
|
239
|
-
letterSpacing: string;
|
|
240
|
-
fontFeatureSettings: string;
|
|
241
|
-
};
|
|
242
|
-
lg: {
|
|
243
|
-
fontFamily: string;
|
|
244
|
-
fontWeight: string;
|
|
245
|
-
fontSize: string;
|
|
246
|
-
lineHeight: string;
|
|
247
|
-
letterSpacing: string;
|
|
248
|
-
fontFeatureSettings: string;
|
|
249
|
-
};
|
|
250
|
-
md: {
|
|
251
|
-
fontFamily: string;
|
|
252
|
-
fontWeight: string;
|
|
253
|
-
fontSize: string;
|
|
254
|
-
lineHeight: string;
|
|
255
|
-
letterSpacing: string;
|
|
256
|
-
fontFeatureSettings: string;
|
|
257
|
-
};
|
|
258
|
-
sm: {
|
|
259
|
-
fontFamily: string;
|
|
260
|
-
fontWeight: string;
|
|
261
|
-
fontSize: string;
|
|
262
|
-
lineHeight: string;
|
|
263
|
-
letterSpacing: string;
|
|
264
|
-
fontFeatureSettings: string;
|
|
265
|
-
};
|
|
266
|
-
xs: {
|
|
267
|
-
fontFamily: string;
|
|
268
|
-
fontWeight: string;
|
|
269
|
-
fontSize: string;
|
|
270
|
-
lineHeight: string;
|
|
271
|
-
letterSpacing: string;
|
|
272
|
-
fontFeatureSettings: string;
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
|
-
title: {
|
|
276
|
-
lg: {
|
|
277
|
-
fontFamily: string;
|
|
278
|
-
fontWeight: string;
|
|
279
|
-
fontSize: string;
|
|
280
|
-
lineHeight: string;
|
|
281
|
-
letterSpacing: string;
|
|
282
|
-
};
|
|
283
|
-
md: {
|
|
284
|
-
fontFamily: string;
|
|
285
|
-
fontWeight: string;
|
|
286
|
-
fontSize: string;
|
|
287
|
-
lineHeight: string;
|
|
288
|
-
letterSpacing: string;
|
|
289
|
-
};
|
|
290
|
-
sm: {
|
|
291
|
-
fontFamily: string;
|
|
292
|
-
fontWeight: string;
|
|
293
|
-
fontSize: string;
|
|
294
|
-
lineHeight: string;
|
|
295
|
-
letterSpacing: string;
|
|
296
|
-
};
|
|
297
|
-
xs: {
|
|
298
|
-
fontFamily: string;
|
|
299
|
-
fontWeight: string;
|
|
300
|
-
fontSize: string;
|
|
301
|
-
lineHeight: string;
|
|
302
|
-
letterSpacing: string;
|
|
303
|
-
};
|
|
304
|
-
'2xs': {
|
|
305
|
-
fontFamily: string;
|
|
306
|
-
fontWeight: string;
|
|
307
|
-
fontSize: string;
|
|
308
|
-
lineHeight: string;
|
|
309
|
-
letterSpacing: string;
|
|
310
|
-
};
|
|
311
|
-
'3xs': {
|
|
312
|
-
fontFamily: string;
|
|
313
|
-
fontWeight: string;
|
|
314
|
-
fontSize: string;
|
|
315
|
-
lineHeight: string;
|
|
316
|
-
letterSpacing: string;
|
|
317
|
-
};
|
|
318
|
-
};
|
|
319
|
-
body: {
|
|
320
|
-
xl: {
|
|
321
|
-
fontFamily: string;
|
|
322
|
-
fontWeight: string;
|
|
323
|
-
fontSize: string;
|
|
324
|
-
lineHeight: string;
|
|
325
|
-
letterSpacing: string;
|
|
326
|
-
};
|
|
327
|
-
lg: {
|
|
328
|
-
fontFamily: string;
|
|
329
|
-
fontWeight: string;
|
|
330
|
-
fontSize: string;
|
|
331
|
-
lineHeight: string;
|
|
332
|
-
letterSpacing: string;
|
|
333
|
-
};
|
|
334
|
-
md: {
|
|
335
|
-
fontFamily: string;
|
|
336
|
-
fontWeight: string;
|
|
337
|
-
fontSize: string;
|
|
338
|
-
lineHeight: string;
|
|
339
|
-
letterSpacing: string;
|
|
340
|
-
};
|
|
341
|
-
sm: {
|
|
342
|
-
fontFamily: string;
|
|
343
|
-
fontWeight: string;
|
|
344
|
-
fontSize: string;
|
|
345
|
-
lineHeight: string;
|
|
346
|
-
letterSpacing: string;
|
|
347
|
-
};
|
|
348
|
-
xs: {
|
|
349
|
-
fontFamily: string;
|
|
350
|
-
fontWeight: string;
|
|
351
|
-
fontSize: string;
|
|
352
|
-
lineHeight: string;
|
|
353
|
-
letterSpacing: string;
|
|
354
|
-
};
|
|
355
|
-
};
|
|
356
|
-
label: {
|
|
357
|
-
md: {
|
|
358
|
-
fontFamily: string;
|
|
359
|
-
fontWeight: string;
|
|
360
|
-
fontSize: string;
|
|
361
|
-
lineHeight: string;
|
|
362
|
-
letterSpacing: string;
|
|
363
|
-
};
|
|
364
|
-
sm: {
|
|
365
|
-
fontFamily: string;
|
|
366
|
-
fontWeight: string;
|
|
367
|
-
fontSize: string;
|
|
368
|
-
lineHeight: string;
|
|
369
|
-
letterSpacing: string;
|
|
370
|
-
};
|
|
371
|
-
};
|
|
372
|
-
button: {
|
|
373
|
-
md: {
|
|
374
|
-
fontFamily: string;
|
|
375
|
-
fontWeight: string;
|
|
376
|
-
fontSize: string;
|
|
377
|
-
lineHeight: string;
|
|
378
|
-
letterSpacing: string;
|
|
379
|
-
};
|
|
380
|
-
sm: {
|
|
381
|
-
fontFamily: string;
|
|
382
|
-
fontWeight: string;
|
|
383
|
-
fontSize: string;
|
|
384
|
-
lineHeight: string;
|
|
385
|
-
letterSpacing: string;
|
|
386
|
-
};
|
|
387
|
-
};
|
|
388
|
-
caption: {
|
|
389
|
-
md: {
|
|
390
|
-
fontFamily: string;
|
|
391
|
-
fontWeight: string;
|
|
392
|
-
fontSize: string;
|
|
393
|
-
lineHeight: string;
|
|
394
|
-
letterSpacing: string;
|
|
395
|
-
};
|
|
396
|
-
sm: {
|
|
397
|
-
fontFamily: string;
|
|
398
|
-
fontWeight: string;
|
|
399
|
-
fontSize: string;
|
|
400
|
-
lineHeight: string;
|
|
401
|
-
letterSpacing: string;
|
|
402
|
-
};
|
|
403
|
-
};
|
|
404
|
-
};
|
|
405
|
-
}) => {
|
|
406
|
-
'&::placeholder': {
|
|
407
|
-
color: string;
|
|
408
|
-
};
|
|
409
|
-
'&:hover': {
|
|
410
|
-
borderColor: string;
|
|
411
|
-
};
|
|
412
|
-
'&:focus': {
|
|
413
|
-
outline: number;
|
|
414
|
-
borderColor: string;
|
|
415
|
-
boxShadow: `0 0 0 1px ${string}`;
|
|
416
|
-
};
|
|
417
|
-
'&[aria-invalid="true"]': {
|
|
418
|
-
borderColor: string;
|
|
419
|
-
'&:focus': {
|
|
420
|
-
boxShadow: `0 0 0 1px ${string}`;
|
|
421
|
-
};
|
|
422
|
-
};
|
|
423
|
-
'&[disabled], &:disabled, &[data-disabled]': {
|
|
424
|
-
opacity: number;
|
|
425
|
-
borderColor: string;
|
|
426
|
-
};
|
|
427
|
-
transitionProperty: "opacity, border-color, box-shadow";
|
|
428
|
-
transitionDuration: "120ms";
|
|
429
|
-
transitionTimingFunction: "ease";
|
|
430
|
-
fontFamily: string;
|
|
431
|
-
fontWeight: string;
|
|
432
|
-
fontSize: string;
|
|
433
|
-
lineHeight: string;
|
|
434
|
-
letterSpacing: string;
|
|
435
|
-
width: string;
|
|
436
|
-
minWidth: number;
|
|
437
|
-
appearance: "none";
|
|
438
|
-
paddingLeft: string;
|
|
439
|
-
paddingRight: string;
|
|
440
|
-
border: string;
|
|
441
|
-
borderRadius: string;
|
|
442
|
-
backgroundColor: string;
|
|
443
|
-
color: string;
|
|
444
|
-
WebkitTouchCallout: "none";
|
|
445
|
-
WebkitTapHighlightColor: "transparent";
|
|
446
|
-
'&::-webkit-date-and-time-value': {
|
|
447
|
-
textAlign: "left";
|
|
448
|
-
};
|
|
449
|
-
alignItems: "center";
|
|
450
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { CSSObject } from '@emotion/react';
|
|
2
|
-
import type { Theme } from '../theme';
|
|
3
|
-
type NamedStyles = Record<string, CSSObject>;
|
|
4
|
-
type StyleInterpolation<T> = (theme: Theme) => T;
|
|
5
|
-
/**
|
|
6
|
-
* Creates a collection of named style rules.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createStyleVariants<T extends NamedStyles>(styles: StyleInterpolation<T>): (theme: Theme) => T;
|
|
9
|
-
/**
|
|
10
|
-
* Create a style object. Useful for creating styles that depend on the theme.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createStyle<T extends CSSObject>(styles: StyleInterpolation<T>): (theme: Theme) => T;
|
|
13
|
-
export type VariantProps<T extends ReturnType<typeof createStyle | typeof createStyleVariants>> = keyof ReturnType<T>;
|
|
14
|
-
/**
|
|
15
|
-
* Converts css `px` unit to `rem`.
|
|
16
|
-
* Assumes the root font size is 16px.
|
|
17
|
-
*/
|
|
18
|
-
export declare const pxToRem: (px: number) => string;
|
|
19
|
-
export {};
|