@paygreen/pgui 3.1.4 → 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.
Files changed (33) hide show
  1. package/dist/components/card-expandable/card-expandable.d.ts +3 -1
  2. package/dist/components/data-table/hooks/use-table-styling.d.ts +15 -15
  3. package/dist/components/field-wrapper/field-wrapper.d.ts +31 -21
  4. package/dist/components/ui/toast-info-icon.d.ts +1 -0
  5. package/dist/components/ui/toaster.d.ts +2 -1
  6. package/dist/foundations/form-controls/all-controls-section.d.ts +2 -0
  7. package/dist/foundations/form-controls/chakra-native-select.d.ts +6 -0
  8. package/dist/foundations/form-controls/constants.d.ts +4 -0
  9. package/dist/foundations/form-controls/sizes-section.d.ts +2 -0
  10. package/dist/foundations/form-controls/states-section.d.ts +2 -0
  11. package/dist/index.js +5 -5
  12. package/dist/index.mjs +3148 -2776
  13. package/dist/pgui.css +1 -1
  14. package/dist/styled-system.d.ts +3 -2
  15. package/dist/theme/recipes/button-recipe.d.ts +24 -0
  16. package/dist/theme/recipes/card-recipe.d.ts +7 -2
  17. package/dist/theme/recipes/index.d.ts +24 -0
  18. package/dist/theme/recipes/toast-recipe.d.ts +3 -0
  19. package/dist/theme/semanticTokens/colors.d.ts +43 -0
  20. package/dist/theme/semanticTokens/index.d.ts +80 -0
  21. package/dist/theme/semanticTokens/shadows.d.ts +42 -0
  22. package/dist/theme/tokens/colors.d.ts +35 -0
  23. package/dist/theme/tokens/font-weights.d.ts +35 -0
  24. package/dist/theme/tokens/index.d.ts +64 -0
  25. package/dist/welcome/charter-color.d.ts +2 -0
  26. package/dist/welcome/charter-section.d.ts +8 -0
  27. package/dist/welcome/charter-snapshot.d.ts +2 -0
  28. package/dist/welcome/charter-type-shape.d.ts +2 -0
  29. package/dist/welcome/graphic-charter.d.ts +2 -0
  30. package/dist/welcome/token-chip.d.ts +7 -0
  31. package/dist/welcome/welcome-hero.d.ts +2 -0
  32. package/package.json +27 -27
  33. 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
- readonly base: "lm_cello.80";
4
- readonly _dark: "bg.muted";
3
+ _dark: string;
4
+ base: "lm_cello.80";
5
5
  } | {
6
- readonly base: "lm_orange.80";
7
- readonly _dark: "lm_orange.30/20";
6
+ _dark: string;
7
+ base: "lm_orange.80";
8
8
  } | {
9
- readonly base: "lm_gray.90";
10
- readonly _dark: "lm_gray.30/20";
9
+ _dark: string;
10
+ base: "lm_gray.90";
11
11
  };
12
12
  headerHover: {
13
13
  readonly base: "lm_cello.70";
14
- readonly _dark: "bg.emphasized";
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: "lm_gray.30/40";
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: "bg.muted";
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: "lm_gray.30/20";
30
+ readonly _dark: "bg.emphasized";
31
31
  };
32
32
  getRowHoverBg: (index: number) => {
33
33
  readonly base: "lm_cello.80";
34
- readonly _dark: "bg.muted";
34
+ readonly _dark: "lm_cello.30/20";
35
35
  } | {
36
36
  readonly base: "lm_cello.70";
37
- readonly _dark: "bg.emphasized";
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: "lm_gray.30/20";
46
+ readonly _dark: "bg.emphasized";
47
47
  } | {
48
48
  readonly base: "lm_gray.80";
49
- readonly _dark: "lm_gray.30/40";
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?: Record<string, any>;
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?: Record<string, any>;
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
- * FieldWrapper component - A wrapper for form fields with label, error message, and context
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;
@@ -1,2 +1,3 @@
1
- export declare const toaster: import('@zag-js/toast').Store<any>;
1
+ import { ReactNode } from 'react';
2
+ export declare const toaster: import('@ark-ui/react').CreateToasterReturn<ReactNode>;
2
3
  export declare const Toaster: () => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ declare const AllControlsSection: () => import("react").JSX.Element;
2
+ export default AllControlsSection;
@@ -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;
@@ -0,0 +1,4 @@
1
+ import { SelectOptionType } from '../../components/select/select';
2
+ export declare const FIELD_SIZES: readonly ["xs", "sm", "md", "lg", "xl"];
3
+ export type FieldSize = (typeof FIELD_SIZES)[number];
4
+ export declare const SELECT_OPTIONS: SelectOptionType[];
@@ -0,0 +1,2 @@
1
+ declare const SizesSection: () => import("react").JSX.Element;
2
+ export default SizesSection;
@@ -0,0 +1,2 @@
1
+ declare const StatesSection: () => import("react").JSX.Element;
2
+ export default StatesSection;