@mich8060/unified-design-system 0.2.6 → 0.2.8
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/README.md +3 -0
- package/dist/design-system/components/Accordion/Accordion.d.ts +2 -9
- package/dist/design-system/components/Accordion/Accordion.types.d.ts +11 -2
- package/dist/design-system/components/Avatar/Avatar.d.ts +7 -1
- package/dist/design-system/components/Avatar/Avatar.types.d.ts +9 -5
- package/dist/design-system/components/Code/Code.d.ts +9 -0
- package/dist/design-system/components/Code/Code.types.d.ts +6 -0
- package/dist/design-system/components/Code/index.d.ts +3 -0
- package/dist/design-system/components/Flex/Flex.types.d.ts +3 -2
- package/dist/design-system/components/Menu/Menu.d.ts +5 -2
- package/dist/design-system/components/Menu/Menu.types.d.ts +1 -0
- package/dist/design-system/components/Table/Table.d.ts +1 -1
- package/dist/design-system/components/Table/Table.types.d.ts +2 -0
- package/dist/design-system/components/TextInput/TextInput.d.ts +1 -1
- package/dist/design-system/components/TextInput/TextInput.types.d.ts +6 -0
- package/dist/design-system/components/Toggle/Toggle.d.ts +1 -2
- package/dist/design-system/components/Toggle/Toggle.types.d.ts +0 -1
- package/dist/design-system/index.d.ts +1 -0
- package/dist/index.cjs +31 -23
- package/dist/index.js +4528 -2830
- package/dist/unified-design-system.css +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -31,6 +31,9 @@ npm run dev
|
|
|
31
31
|
See `/docs` for the full methodology and governance model.
|
|
32
32
|
|
|
33
33
|
- [Claude Rules](docs/claude-rules.md) – conventions and constraints for AI-assisted development in this repo
|
|
34
|
+
- [AI Implementation Learnings](docs/08-ai-implementation-learnings.md) – validated integration guidance and corrected component API assumptions
|
|
35
|
+
- [Project Learnings Log](docs/09-project-learnings-log.md) – living, prompt-by-prompt implementation constraints and guardrails
|
|
36
|
+
- [Consumer Project Setup](docs/10-consumer-project-setup.md) – copy-paste setup guide for integrating UDS in a new app
|
|
34
37
|
|
|
35
38
|
## NPM package quick start
|
|
36
39
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./_accordion.scss";
|
|
2
|
-
import type { AccordionProps } from "./Accordion.types";
|
|
2
|
+
import type { AccordionItemProps, AccordionProps } from "./Accordion.types";
|
|
3
3
|
/**
|
|
4
4
|
* AccordionItem component - individual accordion item
|
|
5
5
|
* @param {string} label - The label text for the accordion item
|
|
@@ -9,14 +9,7 @@ import type { AccordionProps } from "./Accordion.types";
|
|
|
9
9
|
* @param {function} onToggle - Callback when item is toggled (receives new expanded state)
|
|
10
10
|
* @param {object} props - Additional props to pass to the accordion item
|
|
11
11
|
*/
|
|
12
|
-
export declare function AccordionItem({ label, defaultExpanded, children, className, onToggle, ...props }:
|
|
13
|
-
[x: string]: any;
|
|
14
|
-
label: any;
|
|
15
|
-
defaultExpanded?: boolean | undefined;
|
|
16
|
-
children: any;
|
|
17
|
-
className?: string | undefined;
|
|
18
|
-
onToggle: any;
|
|
19
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function AccordionItem({ label, defaultExpanded, children, className, onToggle, id, ...props }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
20
13
|
/**
|
|
21
14
|
* Accordion component - container for accordion items
|
|
22
15
|
* @param {React.ReactNode} children - AccordionItem components
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type AccordionVariant = "default" | "secondary";
|
|
3
|
+
export interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
children?: ReactNode;
|
|
4
5
|
className?: string;
|
|
6
|
+
variant?: AccordionVariant;
|
|
7
|
+
}
|
|
8
|
+
export interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
label: string;
|
|
10
|
+
defaultExpanded?: boolean;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
onToggle?: (expanded: boolean) => void;
|
|
5
14
|
}
|
|
@@ -6,8 +6,14 @@ import type { AvatarProps } from "./Avatar.types";
|
|
|
6
6
|
* @param {string} initials - Initials to display (e.g., "EB", "JD")
|
|
7
7
|
* @param {boolean} status - Whether to show the status indicator (green dot)
|
|
8
8
|
* @param {string} size - Size of the avatar: 'small', 'default', 'large' (default: 'default')
|
|
9
|
+
* - small: 36x36
|
|
10
|
+
* - default: 48x48
|
|
11
|
+
* - large: 64x64
|
|
9
12
|
* @param {string} className - Additional CSS classes
|
|
10
13
|
* @param {string} alt - Alt text for the image
|
|
14
|
+
* @param {boolean} showCameraButton - Whether to show the camera action button overlay
|
|
15
|
+
* @param {string} cameraButtonAriaLabel - Accessible label for camera action button
|
|
16
|
+
* @param {function} onCameraClick - Callback for camera action button click
|
|
11
17
|
* @param {object} props - Additional props to pass to the avatar container
|
|
12
18
|
*/
|
|
13
|
-
export default function Avatar({ src, initials, status, size, className, alt, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default function Avatar({ src, initials, status, size, showCameraButton, cameraButtonAriaLabel, onCameraClick, className, alt, name, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface AvatarProps extends
|
|
3
|
-
src?:
|
|
4
|
-
initials?:
|
|
1
|
+
import type { HTMLAttributes, MouseEvent } from "react";
|
|
2
|
+
export interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
src?: string;
|
|
4
|
+
initials?: string;
|
|
5
|
+
name?: string;
|
|
5
6
|
status?: boolean;
|
|
6
|
-
size?:
|
|
7
|
+
size?: "small" | "default" | "large";
|
|
8
|
+
showCameraButton?: boolean;
|
|
9
|
+
cameraButtonAriaLabel?: string;
|
|
10
|
+
onCameraClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
7
11
|
className?: string;
|
|
8
12
|
alt?: string;
|
|
9
13
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "prismjs/components/prism-bash";
|
|
2
|
+
import "prismjs/components/prism-json";
|
|
3
|
+
import "prismjs/components/prism-sql";
|
|
4
|
+
import "prismjs/components/prism-typescript";
|
|
5
|
+
import "prismjs/components/prism-jsx";
|
|
6
|
+
import "prismjs/components/prism-tsx";
|
|
7
|
+
import "./_code.scss";
|
|
8
|
+
import type { CodeProps } from "./Code.types";
|
|
9
|
+
export default function Code({ code, language, inline, className, ...rest }: CodeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,14 +3,15 @@ export type FlexDirection = "row" | "column";
|
|
|
3
3
|
export type FlexJustifyContent = "flex-start" | "center" | "flex-end" | "space-between" | "space-around" | "space-evenly";
|
|
4
4
|
export type FlexAlignItems = "stretch" | "flex-start" | "center" | "flex-end" | "baseline";
|
|
5
5
|
export type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
|
|
6
|
-
export type FlexGapToken = "0" | "2" | "4" | "8" | "12" | "16" | "24" | "32";
|
|
6
|
+
export type FlexGapToken = "0" | "2" | "4" | "6" | "8" | "10" | "12" | "14" | "16" | "18" | "24" | "32" | "48" | "64" | "80";
|
|
7
|
+
export type FlexGapTokenName = `spacing-${FlexGapToken}`;
|
|
7
8
|
export interface FlexProps extends React.HTMLAttributes<HTMLElement> {
|
|
8
9
|
as?: React.ElementType;
|
|
9
10
|
direction?: FlexDirection;
|
|
10
11
|
justifyContent?: FlexJustifyContent;
|
|
11
12
|
alignItems?: FlexAlignItems;
|
|
12
13
|
wrap?: boolean | FlexWrap;
|
|
13
|
-
gap?: FlexGapToken | string;
|
|
14
|
+
gap?: FlexGapToken | FlexGapTokenName | number | string;
|
|
14
15
|
fullWidth?: boolean;
|
|
15
16
|
inline?: boolean;
|
|
16
17
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import PropTypes from "prop-types";
|
|
2
3
|
import "./_menu.scss";
|
|
3
4
|
import type { MenuProps } from "./Menu.types";
|
|
4
|
-
declare function Menu({ title, className, navItems, brands, activeBrand, onBrandChange, activeMode, onModeChange, showBrand, showSearch, showBrandSwitcher, showNav, showModeToggle, showUser, userName, userInitials, userAvatarSrc, identity, }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function Menu({ title, className, navItems, brands, activeBrand, onBrandChange, activeMode, onModeChange, showBrand, showSearch, showBrandSwitcher, showNav, showModeToggle, showUser, userName, userInitials, userAvatarSrc, accountMenuItems, identity, }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
declare namespace Menu {
|
|
6
7
|
var propTypes: {
|
|
7
8
|
title: PropTypes.Requireable<string>;
|
|
@@ -29,9 +30,11 @@ declare namespace Menu {
|
|
|
29
30
|
userName: PropTypes.Requireable<string>;
|
|
30
31
|
userInitials: PropTypes.Requireable<string>;
|
|
31
32
|
userAvatarSrc: PropTypes.Requireable<string>;
|
|
33
|
+
accountMenuItems: PropTypes.Requireable<any[]>;
|
|
32
34
|
};
|
|
33
35
|
var defaultProps: {
|
|
34
36
|
title: string;
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
declare const _default: React.MemoExoticComponent<typeof Menu>;
|
|
40
|
+
export default _default;
|
|
@@ -7,7 +7,7 @@ import type { TableProps } from "./Table.types";
|
|
|
7
7
|
* @param {string} className - Additional CSS classes
|
|
8
8
|
* @param {object} props - Additional props to pass to the table element
|
|
9
9
|
*/
|
|
10
|
-
declare function Table({ columns, data, className, ...props }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function Table({ columns, data, className, bodyWeight, ...props }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare namespace Table {
|
|
12
12
|
var Cell: typeof TableCell;
|
|
13
13
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { HTMLAttributes } from "react";
|
|
2
|
+
export type TableBodyWeight = "regular" | "medium" | "semibold" | "bold";
|
|
2
3
|
export interface TableProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
columns?: unknown[];
|
|
4
5
|
data?: unknown[];
|
|
5
6
|
className?: string;
|
|
7
|
+
bodyWeight?: TableBodyWeight;
|
|
6
8
|
}
|
|
@@ -17,4 +17,4 @@ import type { TextInputProps } from "./TextInput.types";
|
|
|
17
17
|
* @param {string} className - Additional CSS classes
|
|
18
18
|
* @param {object} props - Additional props to pass to the input element
|
|
19
19
|
*/
|
|
20
|
-
export default function Input({ value, onChange, placeholder, type, size, state, disabled, icon, iconPosition, onIconClick, id, className, ...props }: TextInputProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default function Input({ value, onChange, placeholder, type, size, state, disabled, icon, iconPosition, onIconClick, id, label, helperText, errorText, className, "aria-describedby": ariaDescribedBy, ...props }: TextInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -36,4 +36,10 @@ export interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElemen
|
|
|
36
36
|
iconPosition?: TextInputIconPosition;
|
|
37
37
|
/** Optional click handler for icon button mode. */
|
|
38
38
|
onIconClick?: MouseEventHandler<HTMLButtonElement>;
|
|
39
|
+
/** Optional visible label rendered with htmlFor/id linkage. */
|
|
40
|
+
label?: ReactNode;
|
|
41
|
+
/** Helper text rendered below the input. */
|
|
42
|
+
helperText?: ReactNode;
|
|
43
|
+
/** Error text rendered below the input when in error state. */
|
|
44
|
+
errorText?: ReactNode;
|
|
39
45
|
}
|
|
@@ -5,11 +5,10 @@ import type { ToggleProps } from "./Toggle.types";
|
|
|
5
5
|
* @param {boolean} checked - Whether the toggle is checked (on/off)
|
|
6
6
|
* @param {string} state - Toggle state: 'off', 'on', or 'indeterminate' (default: 'off')
|
|
7
7
|
* @param {string} size - Toggle size: 'large' or 'small' (default: 'large')
|
|
8
|
-
* @param {boolean} bordered - Whether to show border (default: false)
|
|
9
8
|
* @param {function} onChange - Callback function when toggle state changes
|
|
10
9
|
* @param {boolean} disabled - Whether the toggle is disabled
|
|
11
10
|
* @param {string} id - Unique identifier for the toggle input
|
|
12
11
|
* @param {string} className - Additional CSS classes
|
|
13
12
|
* @param {object} props - Additional props to pass to the toggle
|
|
14
13
|
*/
|
|
15
|
-
export default function Toggle({ checked, state, size,
|
|
14
|
+
export default function Toggle({ checked, state, size, onChange, disabled, id, className, ...props }: ToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,6 @@ export interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
3
3
|
checked?: boolean;
|
|
4
4
|
state?: "off" | "on" | "indeterminate";
|
|
5
5
|
size?: "large" | "small";
|
|
6
|
-
bordered?: boolean;
|
|
7
6
|
onChange?: (checked: boolean) => void;
|
|
8
7
|
disabled?: boolean;
|
|
9
8
|
id?: string;
|
|
@@ -10,6 +10,7 @@ export * from "./components/Calendar";
|
|
|
10
10
|
export * from "./components/Card";
|
|
11
11
|
export * from "./components/Checkbox";
|
|
12
12
|
export * from "./components/Chip";
|
|
13
|
+
export * from "./components/Code";
|
|
13
14
|
export * from "./components/Datepicker";
|
|
14
15
|
export * from "./components/Dialog";
|
|
15
16
|
export * from "./components/Divider";
|