@paygreen/pgui 3.1.3 → 3.2.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/components/card-expandable/card-expandable.d.ts +3 -1
- package/dist/components/data-table/hooks/use-table-styling.d.ts +15 -15
- package/dist/components/field-wrapper/field-wrapper.d.ts +31 -21
- package/dist/components/ui/toast-info-icon.d.ts +1 -0
- package/dist/components/ui/toaster.d.ts +2 -1
- package/dist/foundations/form-controls/all-controls-section.d.ts +2 -0
- package/dist/foundations/form-controls/chakra-native-select.d.ts +6 -0
- package/dist/foundations/form-controls/constants.d.ts +4 -0
- package/dist/foundations/form-controls/sizes-section.d.ts +2 -0
- package/dist/foundations/form-controls/states-section.d.ts +2 -0
- package/dist/index.js +5 -5
- package/dist/index.mjs +3168 -2789
- package/dist/pgui.css +1 -1
- package/dist/styled-system.d.ts +3 -2
- package/dist/theme/recipes/button-recipe.d.ts +24 -0
- package/dist/theme/recipes/card-recipe.d.ts +7 -2
- package/dist/theme/recipes/index.d.ts +24 -0
- package/dist/theme/recipes/toast-recipe.d.ts +3 -0
- package/dist/theme/semanticTokens/colors.d.ts +43 -0
- package/dist/theme/semanticTokens/index.d.ts +80 -0
- package/dist/theme/semanticTokens/shadows.d.ts +42 -0
- package/dist/theme/tokens/colors.d.ts +35 -0
- package/dist/theme/tokens/font-weights.d.ts +35 -0
- package/dist/theme/tokens/index.d.ts +64 -0
- package/dist/utils/shiki-adapter.d.ts +1 -2
- package/dist/welcome/charter-color.d.ts +2 -0
- package/dist/welcome/charter-section.d.ts +8 -0
- package/dist/welcome/charter-snapshot.d.ts +2 -0
- package/dist/welcome/charter-type-shape.d.ts +2 -0
- package/dist/welcome/graphic-charter.d.ts +2 -0
- package/dist/welcome/token-chip.d.ts +7 -0
- package/dist/welcome/welcome-hero.d.ts +2 -0
- package/package.json +34 -34
- package/src/components/select/select.css +4 -0
|
@@ -3,7 +3,9 @@ import { Card } from '@chakra-ui/react';
|
|
|
3
3
|
export interface CardExpandableProps extends Omit<Card.RootProps, 'title' | 'variant' | 'colorPalette'> {
|
|
4
4
|
title?: ReactNode;
|
|
5
5
|
subtitle?: ReactNode;
|
|
6
|
+
/** Custom header. Inside the expand button — no links or nested buttons. */
|
|
6
7
|
header?: ReactNode;
|
|
8
|
+
/** Trailing chips. Same constraint as `header`: non-interactive only. */
|
|
7
9
|
tags?: ReactNode[];
|
|
8
10
|
children: ReactNode;
|
|
9
11
|
defaultExpanded?: boolean;
|
|
@@ -13,7 +15,7 @@ export interface CardExpandableProps extends Omit<Card.RootProps, 'title' | 'var
|
|
|
13
15
|
isLazy?: boolean;
|
|
14
16
|
}
|
|
15
17
|
declare const CardExpandable: {
|
|
16
|
-
({ title, subtitle, header, tags, children, defaultExpanded, onExpandChange, colorPalette, icon, isLazy, ...cardProps }: CardExpandableProps): import("react").JSX.Element;
|
|
18
|
+
({ title, subtitle, header, tags, children, defaultExpanded, onExpandChange, colorPalette, icon, isLazy, css: userCss, ...cardProps }: CardExpandableProps): import("react").JSX.Element;
|
|
17
19
|
displayName: string;
|
|
18
20
|
};
|
|
19
21
|
export { CardExpandable };
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
export declare const useTableStyling: (variant: "simple" | "striped", colorPalette?: "blue" | "orange") => {
|
|
2
2
|
headerBg: {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
_dark: string;
|
|
4
|
+
base: "lm_cello.80";
|
|
5
5
|
} | {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
_dark: string;
|
|
7
|
+
base: "lm_orange.80";
|
|
8
8
|
} | {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
_dark: string;
|
|
10
|
+
base: "lm_gray.90";
|
|
11
11
|
};
|
|
12
12
|
headerHover: {
|
|
13
13
|
readonly base: "lm_cello.70";
|
|
14
|
-
readonly _dark: "
|
|
14
|
+
readonly _dark: "lm_cello.30/40";
|
|
15
15
|
} | {
|
|
16
16
|
readonly base: "lm_orange.70";
|
|
17
17
|
readonly _dark: "lm_orange.30/40";
|
|
18
18
|
} | {
|
|
19
19
|
readonly base: "lm_gray.80";
|
|
20
|
-
readonly _dark: "
|
|
20
|
+
readonly _dark: "bg.hover";
|
|
21
21
|
};
|
|
22
|
-
getRowBg: (index: number) => "bg" | {
|
|
22
|
+
getRowBg: (index: number) => "bg.panel" | {
|
|
23
23
|
readonly base: "lm_cello.80";
|
|
24
|
-
readonly _dark: "
|
|
24
|
+
readonly _dark: "lm_cello.30/20";
|
|
25
25
|
} | {
|
|
26
26
|
readonly base: "lm_orange.80";
|
|
27
27
|
readonly _dark: "lm_orange.30/20";
|
|
28
28
|
} | {
|
|
29
29
|
readonly base: "lm_gray.90";
|
|
30
|
-
readonly _dark: "
|
|
30
|
+
readonly _dark: "bg.emphasized";
|
|
31
31
|
};
|
|
32
32
|
getRowHoverBg: (index: number) => {
|
|
33
33
|
readonly base: "lm_cello.80";
|
|
34
|
-
readonly _dark: "
|
|
34
|
+
readonly _dark: "lm_cello.30/20";
|
|
35
35
|
} | {
|
|
36
36
|
readonly base: "lm_cello.70";
|
|
37
|
-
readonly _dark: "
|
|
37
|
+
readonly _dark: "lm_cello.30/40";
|
|
38
38
|
} | {
|
|
39
39
|
readonly base: "lm_orange.80";
|
|
40
40
|
readonly _dark: "lm_orange.30/20";
|
|
@@ -43,9 +43,9 @@ export declare const useTableStyling: (variant: "simple" | "striped", colorPalet
|
|
|
43
43
|
readonly _dark: "lm_orange.30/40";
|
|
44
44
|
} | {
|
|
45
45
|
readonly base: "lm_gray.90";
|
|
46
|
-
readonly _dark: "
|
|
46
|
+
readonly _dark: "bg.emphasized";
|
|
47
47
|
} | {
|
|
48
48
|
readonly base: "lm_gray.80";
|
|
49
|
-
readonly _dark: "
|
|
49
|
+
readonly _dark: "bg.hover";
|
|
50
50
|
};
|
|
51
51
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { Field, BoxProps } from '@chakra-ui/react';
|
|
2
3
|
interface FieldContextType {
|
|
3
4
|
/** Whether the field is invalid */
|
|
4
5
|
invalid?: boolean;
|
|
@@ -6,7 +7,16 @@ interface FieldContextType {
|
|
|
6
7
|
required?: boolean;
|
|
7
8
|
/** Whether the field is disabled */
|
|
8
9
|
disabled?: boolean;
|
|
10
|
+
/** Shared id used to associate the visible label with the control */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Visible FieldWrapper label, when set */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** Space-separated ids of helper / error text */
|
|
15
|
+
describedBy?: string;
|
|
16
|
+
/** Id of the visible error message, when invalid */
|
|
17
|
+
errorId?: string;
|
|
9
18
|
}
|
|
19
|
+
declare const useField: () => FieldContextType;
|
|
10
20
|
export interface FieldWrapperProps {
|
|
11
21
|
/** The field label */
|
|
12
22
|
label?: string;
|
|
@@ -22,29 +32,29 @@ export interface FieldWrapperProps {
|
|
|
22
32
|
helperText?: string;
|
|
23
33
|
/** The field content (input, select, etc.) */
|
|
24
34
|
children: ReactNode;
|
|
25
|
-
/** Additional props for the field root */
|
|
26
|
-
fieldRootProps?:
|
|
35
|
+
/** Additional props for the field root. `required` is announced on the control, not the group. */
|
|
36
|
+
fieldRootProps?: Omit<Field.RootProps, 'invalid' | 'required' | 'disabled' | 'children'>;
|
|
27
37
|
/** Additional props for the field container */
|
|
28
|
-
containerProps?:
|
|
38
|
+
containerProps?: BoxProps;
|
|
39
|
+
}
|
|
40
|
+
export interface ControlFieldProps {
|
|
41
|
+
id?: string;
|
|
42
|
+
'aria-label'?: string;
|
|
43
|
+
'aria-labelledby'?: string;
|
|
44
|
+
'aria-describedby'?: string;
|
|
45
|
+
fallbackLabel?: string;
|
|
29
46
|
}
|
|
47
|
+
export declare const asAriaString: (value: unknown) => string | undefined;
|
|
48
|
+
/** Maps FieldWrapper context onto a control, unless the consumer set aria-label. */
|
|
49
|
+
declare const useControlFieldProps: (options?: ControlFieldProps) => {
|
|
50
|
+
id: string | undefined;
|
|
51
|
+
'aria-label': string | undefined;
|
|
52
|
+
'aria-labelledby': string | undefined;
|
|
53
|
+
'aria-describedby': string | undefined;
|
|
54
|
+
errorId: string | undefined;
|
|
55
|
+
};
|
|
30
56
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```tsx
|
|
35
|
-
* <FieldWrapper
|
|
36
|
-
* label="Email"
|
|
37
|
-
* errorMessage="Please enter a valid email"
|
|
38
|
-
* invalid={hasError}
|
|
39
|
-
* required
|
|
40
|
-
* >
|
|
41
|
-
* <Input type="email" />
|
|
42
|
-
* </FieldWrapper>
|
|
43
|
-
* ```
|
|
57
|
+
* Field wrapper: label, error, helper, and shared field context.
|
|
44
58
|
*/
|
|
45
59
|
declare const FieldWrapper: import('react').ForwardRefExoticComponent<FieldWrapperProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
46
|
-
|
|
47
|
-
* Hook to access the field context
|
|
48
|
-
*/
|
|
49
|
-
declare const useField: () => FieldContextType;
|
|
50
|
-
export { FieldWrapper, useField };
|
|
60
|
+
export { FieldWrapper, useControlFieldProps, useField };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ToastInfoIcon: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FieldSize } from './constants';
|
|
2
|
+
type ChakraNativeSelectProps = {
|
|
3
|
+
size?: FieldSize;
|
|
4
|
+
} & Record<string, unknown>;
|
|
5
|
+
declare const ChakraNativeSelect: ({ size, ...rootProps }: ChakraNativeSelectProps) => import("react").JSX.Element;
|
|
6
|
+
export default ChakraNativeSelect;
|