@stordata/design-system 0.1.20260629080514

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.
@@ -0,0 +1,14 @@
1
+ import { ReactElement } from 'react';
2
+ import { DSCommonProps } from '../DSCommonProps.ts';
3
+ import { ComponentVariant } from '../../src/services/useTheme/defaultTheme.ts';
4
+ export interface DSCardProps extends DSCommonProps<'div'> {
5
+ variant?: DSCardVariant;
6
+ title?: string;
7
+ }
8
+ export type DSCardVariant = ComponentVariant;
9
+ /**
10
+ * DSCard Component
11
+ *
12
+ * A flexible card component that supports different variants, titles, and custom content.
13
+ */
14
+ export default function DSCard(p: DSCardProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { d as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,17 @@
1
+ import { ReactElement } from 'react';
2
+ import { CheckboxRootProps, CheckboxRootState } from '@base-ui/react/checkbox';
3
+ import { DSCommonProps } from '../DSCommonProps.ts';
4
+ export interface DSCheckboxProps extends DSCommonProps<'span', CheckboxRootState> {
5
+ disabled?: boolean;
6
+ onCheckedChange?: CheckboxRootProps['onCheckedChange'];
7
+ defaultChecked?: CheckboxRootProps['defaultChecked'];
8
+ checked?: CheckboxRootProps['checked'];
9
+ variant?: 'on-neutral' | 'on-brand';
10
+ }
11
+ /**
12
+ * DSCheckbox Component
13
+ *
14
+ * A custom checkbox component built using the base Checkbox component from '@base-ui/react/checkbox'.
15
+ * This component supports a value, a change handler, and an optional required flag.
16
+ */
17
+ export default function DSCheckbox(p: DSCheckboxProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { f as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,3 @@
1
+ import { ElementType } from 'react';
2
+ import { BaseUIComponentProps } from '@base-ui/react/internals/types';
3
+ export type DSCommonProps<Element extends ElementType, State = object> = BaseUIComponentProps<Element, State>;
@@ -0,0 +1,14 @@
1
+ import { ReactElement } from 'react';
2
+ import { DSCommonProps } from '../DSCommonProps.ts';
3
+ import { ComponentSize } from '../../src/services/useTheme/defaultTheme.ts';
4
+ export interface DSIconProps extends DSCommonProps<'span'> {
5
+ size?: DSIconSize;
6
+ }
7
+ export type DSIconSize = ComponentSize | 'extra-small' | 'extra-large';
8
+ /**
9
+ * DSIcon component
10
+ *
11
+ * This component renders an icon with a specified size.
12
+ * It applies styles based on the provided `size` prop and displays the `icon` content.
13
+ */
14
+ export default function DSIcon(p: DSIconProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { n as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,50 @@
1
+ import { FieldControlProps } from '@base-ui/react';
2
+ import { FocusEventHandler, Ref } from 'react';
3
+ export interface DSInputProps {
4
+ label?: string;
5
+ name?: string;
6
+ value?: string;
7
+ onChange?: FieldControlProps['onValueChange'];
8
+ placeholder?: string;
9
+ fullWidth?: boolean;
10
+ ghost?: boolean;
11
+ required?: boolean;
12
+ disabled?: boolean;
13
+ error?: {
14
+ message: string;
15
+ };
16
+ onBlur?: FocusEventHandler<HTMLInputElement>;
17
+ invalid?: boolean;
18
+ isTouched?: boolean;
19
+ isDirty?: boolean;
20
+ helperText?: string;
21
+ ref?: Ref<HTMLInputElement>;
22
+ }
23
+ /**
24
+ * DSInput component - Customizable input field.
25
+ *
26
+ * This component provides a styled input field with support for various props such as labels,
27
+ * error messages, helper text, and additional styling options like fullWidth and ghost styles.
28
+ * It integrates with the Field component for form handling and validation.
29
+ *
30
+ * @param {Object} props - Component props.
31
+ * @param {string} props.label - Label text for the input field.
32
+ * @param {string} props.name - Name attribute for the input field.
33
+ * @param {string} props.value - Current value of the input.
34
+ * @param {Function} props.onChange - Callback function triggered when the input value changes.
35
+ * @param {string} [props.placeholder=''] - Placeholder text shown in the input.
36
+ * @param {boolean} [props.fullWidth=false] - If `true`, the input occupies the full available width.
37
+ * @param {boolean} [props.ghost=true] - If `true`, applies a "ghost" style to the input.
38
+ * @param {boolean} [props.required=false] - If `true`, marks the input as required.
39
+ * @param {Object} [props.error] - Error object containing validation error details.
40
+ * @param {string} [props.error.message] - Error message to display when the input is invalid.
41
+ * @param {Function} [props.onBlur] - Callback function triggered when the input loses focus.
42
+ * @param {boolean} [props.invalid=false] - If `true`, marks the input as invalid.
43
+ * @param {boolean} [props.isTouched=false] - Indicates whether the input has been interacted with.
44
+ * @param {boolean} [props.isDirty=false] - Indicates whether the input value has been modified.
45
+ * @param {string} [props.helperText] - Additional helper text displayed below the input.
46
+ * @param {React.Ref} [props.inputRef] - Ref for the input element.
47
+ *
48
+ * @returns {JSX.Element} - Custom Input component.
49
+ */
50
+ export default function DSInput({ ref, ...props }: DSInputProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { p as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,19 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { Theme } from '../../src/services/useTheme/defaultTheme.ts';
3
+ export interface DSProviderProps {
4
+ theme: Theme;
5
+ children: ReactNode;
6
+ }
7
+ /**
8
+ * DSProvider component
9
+ *
10
+ * This component provides a theme context to its child components.
11
+ * It wraps the children with the `ThemeContext.Provider` and passes the `theme` prop as the context value.
12
+ *
13
+ * @param {Object} props - The props object.
14
+ * @param {Object} props.theme - The theme object to be provided to the context.
15
+ * @param {React.ReactNode} props.children - The child components to be rendered within the provider.
16
+ *
17
+ * @returns {JSX.Element} The DSProvider component.
18
+ */
19
+ export default function DSProvider({ theme: appTheme, children }: DSProviderProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../../DSProvider-DSGQ7C7X.js";
2
+ export { e as default };
@@ -0,0 +1,15 @@
1
+ import { ReactElement } from 'react';
2
+ import { RadioRootProps, RadioRootState } from '@base-ui/react';
3
+ import { DSCommonProps } from '../DSCommonProps.ts';
4
+ import { DSRadioGroupProps } from '../DSRadioGroup/index.tsx';
5
+ export interface DSRadioProps extends DSCommonProps<'span', RadioRootState> {
6
+ disabled?: boolean;
7
+ value: RadioRootProps['value'];
8
+ variant?: DSRadioGroupProps['variant'];
9
+ }
10
+ /**
11
+ * DSRadio component
12
+ *
13
+ * A customizable radio button. Always render inside a DSRadioGroup
14
+ */
15
+ export default function DSRadio(p: DSRadioProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { s as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,16 @@
1
+ import { ReactElement } from 'react';
2
+ import { RadioGroupProps, RadioGroupState } from '@base-ui/react';
3
+ import { DSCommonProps } from '../DSCommonProps.ts';
4
+ export interface DSRadioGroupProps extends DSCommonProps<'div', RadioGroupState> {
5
+ disabled?: boolean;
6
+ value?: RadioGroupProps['value'];
7
+ defaultValue?: RadioGroupProps['defaultValue'];
8
+ onValueChange?: RadioGroupProps['onValueChange'];
9
+ variant?: 'on-brand' | 'on-neutral';
10
+ }
11
+ /**
12
+ * DSRadioGroup component
13
+ *
14
+ * A wrapper for one or more radio buttons. Handles value selection.
15
+ */
16
+ export default function DSRadioGroup(p: DSRadioGroupProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { o as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,16 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { DSButtonColor, DSButtonSize } from '../DSButton/index.tsx';
3
+ import { DSCommonProps } from '../DSCommonProps.ts';
4
+ export interface DSSegmentedButtonProps extends DSCommonProps<'div'> {
5
+ size?: DSButtonSize;
6
+ color?: DSButtonColor;
7
+ startIcon?: ReactNode;
8
+ defaultValue?: string[];
9
+ disabled?: boolean;
10
+ }
11
+ /**
12
+ * DSSegmentedButtonProps component
13
+ *
14
+ * A multi-button component that supports a single selection amongst a choice of values
15
+ */
16
+ export default function DSSegmentedButton(p: DSSegmentedButtonProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { c as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,18 @@
1
+ import { SelectRootProps } from '@base-ui/react';
2
+ import { ReactElement } from 'react';
3
+ export interface DSSelectProps {
4
+ options?: DSSelectItem[];
5
+ value?: unknown;
6
+ onChange?: SelectRootProps<unknown>['onValueChange'];
7
+ name?: string;
8
+ id?: string;
9
+ required?: boolean;
10
+ placeholder?: string;
11
+ label?: string;
12
+ fullWidth?: boolean;
13
+ }
14
+ export interface DSSelectItem {
15
+ value: unknown;
16
+ label: string;
17
+ }
18
+ export default function DSSelect(props: DSSelectProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { l as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,16 @@
1
+ import { ReactElement } from 'react';
2
+ import { SwitchRootState, SwitchRootProps } from '@base-ui/react';
3
+ import { DSCommonProps } from '../DSCommonProps.ts';
4
+ export interface DSSwitchProps extends DSCommonProps<'span', SwitchRootState> {
5
+ disabled?: boolean;
6
+ checked?: SwitchRootProps['checked'];
7
+ defaultChecked?: SwitchRootProps['defaultChecked'];
8
+ onCheckedChange?: SwitchRootProps['onCheckedChange'];
9
+ variant?: 'on-neutral' | 'on-brand';
10
+ }
11
+ /**
12
+ * DSSwitch component
13
+ *
14
+ * A customizable switch button.
15
+ */
16
+ export default function DSSwitch(p: DSSwitchProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { a as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
@@ -0,0 +1,12 @@
1
+ import { ReactElement } from 'react';
2
+ import { DSCommonProps } from '../DSCommonProps.ts';
3
+ export interface DSTypographyProps extends DSCommonProps<'label'> {
4
+ variant?: DSTypographyVariant;
5
+ }
6
+ export type DSTypographyVariant = 'h1' | 'h1-display' | 'h2' | 'h3' | 'h3-bold' | 'h4' | 'display-lg' | 'display-md' | 'body-xl' | 'body-lg' | 'body-lg-medium' | 'body-lg-semibold' | 'body-lg-mono' | 'body-md' | 'body-md-medium' | 'body-md-semibold' | 'body-md-mono' | 'body-sm' | 'body-sm-medium' | 'body-sm-semibold' | 'body-sm-mono' | 'body-xs-mono' | 'label-sm' | 'label-md' | 'button-text-small' | 'button-text-medium' | 'button-text-large' | 'caption-default' | 'helper-text-default';
7
+ /**
8
+ * DSTypography component
9
+ *
10
+ * Renders a typographic element (h1, h2, p, etc.) determined by the provided variant.
11
+ */
12
+ export default function DSTypography(p: DSTypographyProps): ReactElement;
@@ -0,0 +1,2 @@
1
+ import { m as e } from "../../DSButton-BXD09god.js";
2
+ export { e as default };
package/package.json ADDED
@@ -0,0 +1,107 @@
1
+ {
2
+ "name": "@stordata/design-system",
3
+ "version":"0.1.20260629080514",
4
+ "type": "module",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "exports": {
9
+ "./style.css": "./dist/design-system.css",
10
+ "./App": {
11
+ "default": "./dist/lib/App/index.js",
12
+ "types": "./dist/lib/App/index.d.ts"
13
+ },
14
+ "./DSAccordion": {
15
+ "default": "./dist/lib/DSAccordion/index.js",
16
+ "types": "./dist/lib/DSAccordion/index.d.ts"
17
+ },
18
+ "./DSButton": {
19
+ "default": "./dist/lib/DSButton/index.js",
20
+ "types": "./dist/lib/DSButton/index.d.ts"
21
+ },
22
+ "./DSCard": {
23
+ "default": "./dist/lib/DSCard/index.js",
24
+ "types": "./dist/lib/DSCard/index.d.ts"
25
+ },
26
+ "./DSCheckbox": {
27
+ "default": "./dist/lib/DSCheckbox/index.js",
28
+ "types": "./dist/lib/DSCheckbox/index.d.ts"
29
+ },
30
+ "./DSIcon": {
31
+ "default": "./dist/lib/DSIcon/index.js",
32
+ "types": "./dist/lib/DSIcon/index.d.ts"
33
+ },
34
+ "./DSInput": {
35
+ "default": "./dist/lib/DSInput/index.js",
36
+ "types": "./dist/lib/DSInput/index.d.ts"
37
+ },
38
+ "./DSProvider": {
39
+ "default": "./dist/lib/DSProvider/index.js",
40
+ "types": "./dist/lib/DSProvider/index.d.ts"
41
+ },
42
+ "./DSRadio": {
43
+ "default": "./dist/lib/DSRadio/index.js",
44
+ "types": "./dist/lib/DSRadio/index.d.ts"
45
+ },
46
+ "./DSRadioGroup": {
47
+ "default": "./dist/lib/DSRadioGroup/index.js",
48
+ "types": "./dist/lib/DSRadioGroup/index.d.ts"
49
+ },
50
+ "./DSSegmentedButton": {
51
+ "default": "./dist/lib/DSSegmentedButton/index.js",
52
+ "types": "./dist/lib/DSSegmentedButton/index.d.ts"
53
+ },
54
+ "./DSSelect": {
55
+ "default": "./dist/lib/DSSelect/index.js",
56
+ "types": "./dist/lib/DSSelect/index.d.ts"
57
+ },
58
+ "./DSSwitch": {
59
+ "default": "./dist/lib/DSSwitch/index.js",
60
+ "types": "./dist/lib/DSSwitch/index.d.ts"
61
+ },
62
+ "./DSTypography": {
63
+ "default": "./dist/lib/DSTypography/index.js",
64
+ "types": "./dist/lib/DSTypography/index.d.ts"
65
+ }
66
+ },
67
+ "license": "UNLICENSED",
68
+ "publishConfig": {
69
+ "access": "public",
70
+ "registry": "https://registry.npmjs.org"
71
+ },
72
+ "scripts": {
73
+ "dev": "vite",
74
+ "build": "vite build",
75
+ "lint": "eslint eslint.config.js src/",
76
+ "tsc": "tsc --noEmit",
77
+ "prepublish": "npm run build"
78
+ },
79
+ "engines": {
80
+ "node": ">= 24"
81
+ },
82
+ "dependencies": {
83
+ "@base-ui/react": "1.6.0",
84
+ "@material-design-icons/svg": "0.14.15",
85
+ "classnames": "2.5.1"
86
+ },
87
+ "devDependencies": {
88
+ "@eslint/config-helpers": "0.6.0",
89
+ "@stordata/eslint-config": "2.0.20260625180643",
90
+ "@types/node": "26.0.1",
91
+ "@types/react-dom": "19.2.3",
92
+ "@vitejs/plugin-react": "6.0.3",
93
+ "@vitest/coverage-v8": "4.1.9",
94
+ "eslint-plugin-import": "2.32.0",
95
+ "eslint-plugin-react": "7.37.5",
96
+ "eslint-plugin-react-hooks": "7.1.1",
97
+ "globals": "17.7.0",
98
+ "react": "19.2.7",
99
+ "react-dom": "19.2.7",
100
+ "sass-embedded": "1.100.0",
101
+ "typescript": "6.0.3",
102
+ "typescript-eslint": "8.62.0",
103
+ "vite": "8.0.16",
104
+ "unplugin-dts": "1.0.3",
105
+ "vite-plugin-svgr": "5.2.0"
106
+ }
107
+ }