@ashwa-io/ui 0.0.2 → 0.0.4
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/atomic/Badge/Badge.d.ts +11 -0
- package/dist/components/atomic/Badge/Badge.js +31 -0
- package/dist/components/atomic/Badge/index.d.ts +2 -0
- package/dist/components/atomic/Button/Button.d.ts +3 -2
- package/dist/components/atomic/Button/Button.js +3 -10
- package/dist/components/atomic/Button/buttonVariant.d.ts +3 -0
- package/dist/components/atomic/Button/buttonVariant.js +10 -0
- package/dist/components/atomic/Button/index.d.ts +2 -1
- package/dist/components/atomic/Checkbox/Checkbox.d.ts +11 -0
- package/dist/components/atomic/Checkbox/Checkbox.js +32 -0
- package/dist/components/atomic/Checkbox/index.d.ts +2 -0
- package/dist/components/atomic/ColorInput/ColorInput.d.ts +15 -0
- package/dist/components/atomic/ColorInput/ColorInput.js +44 -0
- package/dist/components/atomic/ColorInput/colorHex.js +8 -0
- package/dist/components/atomic/ColorInput/index.d.ts +2 -0
- package/dist/components/atomic/Divider/Divider.d.ts +8 -0
- package/dist/components/atomic/Divider/Divider.js +12 -0
- package/dist/components/atomic/Divider/index.d.ts +2 -0
- package/dist/components/atomic/Heading/Heading.d.ts +12 -0
- package/dist/components/atomic/Heading/Heading.js +30 -0
- package/dist/components/atomic/Heading/index.d.ts +2 -0
- package/dist/components/atomic/IconButton/IconButton.d.ts +21 -0
- package/dist/components/atomic/IconButton/IconButton.js +34 -0
- package/dist/components/atomic/IconButton/index.d.ts +2 -0
- package/dist/components/atomic/Select/Select.d.ts +18 -0
- package/dist/components/atomic/Select/Select.js +47 -0
- package/dist/components/atomic/Select/index.d.ts +2 -0
- package/dist/components/atomic/Skeleton/Skeleton.d.ts +8 -0
- package/dist/components/atomic/Skeleton/Skeleton.js +17 -0
- package/dist/components/atomic/Skeleton/index.d.ts +2 -0
- package/dist/components/atomic/Spinner/Spinner.d.ts +10 -0
- package/dist/components/atomic/Spinner/Spinner.js +18 -0
- package/dist/components/atomic/Spinner/index.d.ts +2 -0
- package/dist/components/atomic/Switch/Switch.d.ts +11 -0
- package/dist/components/atomic/Switch/Switch.js +32 -0
- package/dist/components/atomic/Switch/index.d.ts +2 -0
- package/dist/components/atomic/Text/Text.d.ts +20 -0
- package/dist/components/atomic/Text/Text.js +33 -0
- package/dist/components/atomic/Text/index.d.ts +2 -0
- package/dist/components/atomic/TextArea/TextArea.d.ts +14 -0
- package/dist/components/atomic/TextArea/TextArea.js +35 -0
- package/dist/components/atomic/TextArea/index.d.ts +2 -0
- package/dist/components/atomic/TextInput/TextInput.d.ts +18 -0
- package/dist/components/atomic/TextInput/TextInput.js +42 -0
- package/dist/components/atomic/TextInput/index.d.ts +2 -0
- package/dist/components/layout/FormLayout/FormLayout.d.ts +9 -0
- package/dist/components/layout/FormLayout/FormLayout.js +15 -0
- package/dist/components/layout/FormLayout/index.d.ts +2 -0
- package/dist/components/layout/Stack/Stack.d.ts +22 -0
- package/dist/components/layout/Stack/Stack.js +62 -0
- package/dist/components/layout/Stack/index.d.ts +2 -0
- package/dist/components/molecule/FormField/FormField.d.ts +16 -0
- package/dist/components/molecule/FormField/FormField.js +47 -0
- package/dist/components/molecule/FormField/index.d.ts +2 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/button.d.ts +2 -0
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/checkbox.js +18 -0
- package/dist/components/ui/field.js +65 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/label.js +12 -0
- package/dist/components/ui/select.js +75 -0
- package/dist/components/ui/separator.js +13 -0
- package/dist/components/ui/skeleton.js +11 -0
- package/dist/components/ui/spinner.js +14 -0
- package/dist/components/ui/switch.js +18 -0
- package/dist/components/ui/textarea.js +12 -0
- package/dist/index.d.ts +36 -3
- package/dist/index.js +18 -1
- package/dist/lib/types.d.ts +16 -1
- package/package.json +1 -1
- package/src/styles/index.css +11 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
|
+
import "./components/atomic/Badge/index.js";
|
|
2
|
+
import { Badge, BadgeProps } from "./components/atomic/Badge/Badge.js";
|
|
1
3
|
import "./components/atomic/Button/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
4
|
+
import { ButtonVariant } from "./components/atomic/Button/buttonVariant.js";
|
|
5
|
+
import { Button, ButtonProps } from "./components/atomic/Button/Button.js";
|
|
6
|
+
import "./components/atomic/Checkbox/index.js";
|
|
7
|
+
import { Checkbox, CheckboxProps } from "./components/atomic/Checkbox/Checkbox.js";
|
|
8
|
+
import "./components/atomic/ColorInput/index.js";
|
|
9
|
+
import { ColorInput, ColorInputProps } from "./components/atomic/ColorInput/ColorInput.js";
|
|
10
|
+
import "./components/atomic/Divider/index.js";
|
|
11
|
+
import { Divider, DividerProps } from "./components/atomic/Divider/Divider.js";
|
|
12
|
+
import "./components/atomic/Heading/index.js";
|
|
13
|
+
import { Heading, HeadingLevel, HeadingProps } from "./components/atomic/Heading/Heading.js";
|
|
14
|
+
import "./components/atomic/Switch/index.js";
|
|
15
|
+
import { Switch, SwitchProps } from "./components/atomic/Switch/Switch.js";
|
|
16
|
+
import "./components/atomic/Text/index.js";
|
|
17
|
+
import { Text, TextProps, TextSize, TextTone, TextWeight } from "./components/atomic/Text/Text.js";
|
|
18
|
+
import "./components/atomic/TextArea/index.js";
|
|
19
|
+
import { TextArea, TextAreaProps } from "./components/atomic/TextArea/TextArea.js";
|
|
20
|
+
import "./components/atomic/TextInput/index.js";
|
|
21
|
+
import { TextInput, TextInputProps, TextInputType } from "./components/atomic/TextInput/TextInput.js";
|
|
22
|
+
import "./components/atomic/IconButton/index.js";
|
|
23
|
+
import { IconButton, IconButtonProps, IconButtonVariant } from "./components/atomic/IconButton/IconButton.js";
|
|
24
|
+
import "./components/atomic/Select/index.js";
|
|
25
|
+
import { Select, SelectOption, SelectProps } from "./components/atomic/Select/Select.js";
|
|
26
|
+
import "./components/atomic/Skeleton/index.js";
|
|
27
|
+
import { Skeleton, SkeletonProps, SkeletonShape } from "./components/atomic/Skeleton/Skeleton.js";
|
|
28
|
+
import "./components/atomic/Spinner/index.js";
|
|
29
|
+
import { Spinner, SpinnerProps } from "./components/atomic/Spinner/Spinner.js";
|
|
30
|
+
import "./components/layout/FormLayout/index.js";
|
|
31
|
+
import { FormLayout, FormLayoutDirection, FormLayoutProps } from "./components/layout/FormLayout/FormLayout.js";
|
|
32
|
+
import "./components/molecule/FormField/index.js";
|
|
33
|
+
import { FormField, FormFieldControlProps, FormFieldProps } from "./components/molecule/FormField/FormField.js";
|
|
34
|
+
import "./components/layout/Stack/index.js";
|
|
35
|
+
import { HStack, HStackProps, Stack, StackAlign, StackGap, StackJustify, StackProps, VStack, VStackProps } from "./components/layout/Stack/Stack.js";
|
|
36
|
+
import { FieldBaseProps, IconComponent, Size, Tone } from "./lib/types.js";
|
|
37
|
+
export { Badge, type BadgeProps, Button, type ButtonProps, type ButtonVariant, Checkbox, type CheckboxProps, ColorInput, type ColorInputProps, Divider, type DividerProps, type FieldBaseProps, FormField, type FormFieldControlProps, type FormFieldProps, FormLayout, type FormLayoutDirection, type FormLayoutProps, HStack, type HStackProps, Heading, type HeadingLevel, type HeadingProps, IconButton, type IconButtonProps, type IconButtonVariant, type IconComponent, Select, type SelectOption, type SelectProps, type Size, Skeleton, type SkeletonProps, type SkeletonShape, Spinner, type SpinnerProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextInputType, type TextProps, type TextSize, type TextTone, type TextWeight, type Tone, VStack, type VStackProps };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { Badge } from "./components/atomic/Badge/Badge.js";
|
|
2
|
+
import { Button } from "./components/atomic/Button/Button.js";
|
|
3
|
+
import { Checkbox } from "./components/atomic/Checkbox/Checkbox.js";
|
|
4
|
+
import { ColorInput } from "./components/atomic/ColorInput/ColorInput.js";
|
|
5
|
+
import { Divider } from "./components/atomic/Divider/Divider.js";
|
|
6
|
+
import { Heading } from "./components/atomic/Heading/Heading.js";
|
|
7
|
+
import { Switch } from "./components/atomic/Switch/Switch.js";
|
|
8
|
+
import { Text } from "./components/atomic/Text/Text.js";
|
|
9
|
+
import { TextArea } from "./components/atomic/TextArea/TextArea.js";
|
|
10
|
+
import { TextInput } from "./components/atomic/TextInput/TextInput.js";
|
|
11
|
+
import { IconButton } from "./components/atomic/IconButton/IconButton.js";
|
|
12
|
+
import { Select } from "./components/atomic/Select/Select.js";
|
|
13
|
+
import { Skeleton } from "./components/atomic/Skeleton/Skeleton.js";
|
|
14
|
+
import { Spinner } from "./components/atomic/Spinner/Spinner.js";
|
|
15
|
+
import { FormLayout } from "./components/layout/FormLayout/FormLayout.js";
|
|
16
|
+
import { FormField } from "./components/molecule/FormField/FormField.js";
|
|
17
|
+
import { HStack, Stack, VStack } from "./components/layout/Stack/Stack.js";
|
|
18
|
+
export { Badge, Button, Checkbox, ColorInput, Divider, FormField, FormLayout, HStack, Heading, IconButton, Select, Skeleton, Spinner, Stack, Switch, Text, TextArea, TextInput, VStack };
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
/** Shared size scale for every public component. */
|
|
3
3
|
export type Size = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type Tone = 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info';
|
|
4
5
|
/** An icon component (lucide-react, svgr): the design system controls its size and colour. */
|
|
5
6
|
export type IconComponent = React.ComponentType<{
|
|
6
7
|
className?: string;
|
|
7
8
|
'aria-hidden'?: boolean;
|
|
8
9
|
'data-icon'?: string;
|
|
9
|
-
}>;
|
|
10
|
+
}>;
|
|
11
|
+
/** Label, help and error props every form input shares (rendered by FormField). */
|
|
12
|
+
export interface FieldBaseProps {
|
|
13
|
+
/** Accessible name; always required, even when hidden. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Hides the label visually; screen readers still announce it. */
|
|
16
|
+
hideLabel?: boolean;
|
|
17
|
+
description?: string;
|
|
18
|
+
/** Message shown under the field; also sets aria-invalid. */
|
|
19
|
+
error?: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
id?: string;
|
|
23
|
+
'data-testid'?: string;
|
|
24
|
+
}
|
package/package.json
CHANGED
package/src/styles/index.css
CHANGED
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
--color-input: var(--input);
|
|
30
30
|
--color-border: var(--border);
|
|
31
31
|
--color-destructive: var(--destructive);
|
|
32
|
+
--color-success: var(--success);
|
|
33
|
+
--color-warning: var(--warning);
|
|
34
|
+
--color-info: var(--info);
|
|
32
35
|
--color-accent-foreground: var(--accent-foreground);
|
|
33
36
|
--color-accent: var(--accent);
|
|
34
37
|
--color-muted-foreground: var(--muted-foreground);
|
|
@@ -85,6 +88,11 @@
|
|
|
85
88
|
/* Tailwind red-700, darker than base-nova's red-600: destructive text on its 10% tint
|
|
86
89
|
(Button destructive) must reach WCAG AA 4.5:1; red-600 only reached 4:1. */
|
|
87
90
|
--destructive: oklch(0.505 0.213 27.518);
|
|
91
|
+
/* Status text colours (Tailwind green-800, amber-800, blue-700): readable as text and on their
|
|
92
|
+
10% tints (Badge). Fixed, never per org. */
|
|
93
|
+
--success: oklch(0.448 0.119 151.328);
|
|
94
|
+
--warning: oklch(0.473 0.137 46.201);
|
|
95
|
+
--info: oklch(0.488 0.243 264.376);
|
|
88
96
|
--border: oklch(0.922 0 0);
|
|
89
97
|
--input: oklch(0.922 0 0);
|
|
90
98
|
--ring: var(--brand);
|
|
@@ -125,6 +133,9 @@
|
|
|
125
133
|
--accent: oklch(0.269 0 0);
|
|
126
134
|
--accent-foreground: oklch(0.985 0 0);
|
|
127
135
|
--destructive: oklch(0.704 0.191 22.216);
|
|
136
|
+
--success: oklch(0.792 0.209 151.711);
|
|
137
|
+
--warning: oklch(0.828 0.189 84.429);
|
|
138
|
+
--info: oklch(0.707 0.165 254.624);
|
|
128
139
|
--border: oklch(1 0 0 / 10%);
|
|
129
140
|
--input: oklch(1 0 0 / 15%);
|
|
130
141
|
--chart-2: oklch(0.556 0 0);
|