@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.
Files changed (72) hide show
  1. package/dist/components/atomic/Badge/Badge.d.ts +11 -0
  2. package/dist/components/atomic/Badge/Badge.js +31 -0
  3. package/dist/components/atomic/Badge/index.d.ts +2 -0
  4. package/dist/components/atomic/Button/Button.d.ts +3 -2
  5. package/dist/components/atomic/Button/Button.js +3 -10
  6. package/dist/components/atomic/Button/buttonVariant.d.ts +3 -0
  7. package/dist/components/atomic/Button/buttonVariant.js +10 -0
  8. package/dist/components/atomic/Button/index.d.ts +2 -1
  9. package/dist/components/atomic/Checkbox/Checkbox.d.ts +11 -0
  10. package/dist/components/atomic/Checkbox/Checkbox.js +32 -0
  11. package/dist/components/atomic/Checkbox/index.d.ts +2 -0
  12. package/dist/components/atomic/ColorInput/ColorInput.d.ts +15 -0
  13. package/dist/components/atomic/ColorInput/ColorInput.js +44 -0
  14. package/dist/components/atomic/ColorInput/colorHex.js +8 -0
  15. package/dist/components/atomic/ColorInput/index.d.ts +2 -0
  16. package/dist/components/atomic/Divider/Divider.d.ts +8 -0
  17. package/dist/components/atomic/Divider/Divider.js +12 -0
  18. package/dist/components/atomic/Divider/index.d.ts +2 -0
  19. package/dist/components/atomic/Heading/Heading.d.ts +12 -0
  20. package/dist/components/atomic/Heading/Heading.js +30 -0
  21. package/dist/components/atomic/Heading/index.d.ts +2 -0
  22. package/dist/components/atomic/IconButton/IconButton.d.ts +21 -0
  23. package/dist/components/atomic/IconButton/IconButton.js +34 -0
  24. package/dist/components/atomic/IconButton/index.d.ts +2 -0
  25. package/dist/components/atomic/Select/Select.d.ts +18 -0
  26. package/dist/components/atomic/Select/Select.js +47 -0
  27. package/dist/components/atomic/Select/index.d.ts +2 -0
  28. package/dist/components/atomic/Skeleton/Skeleton.d.ts +8 -0
  29. package/dist/components/atomic/Skeleton/Skeleton.js +17 -0
  30. package/dist/components/atomic/Skeleton/index.d.ts +2 -0
  31. package/dist/components/atomic/Spinner/Spinner.d.ts +10 -0
  32. package/dist/components/atomic/Spinner/Spinner.js +18 -0
  33. package/dist/components/atomic/Spinner/index.d.ts +2 -0
  34. package/dist/components/atomic/Switch/Switch.d.ts +11 -0
  35. package/dist/components/atomic/Switch/Switch.js +32 -0
  36. package/dist/components/atomic/Switch/index.d.ts +2 -0
  37. package/dist/components/atomic/Text/Text.d.ts +20 -0
  38. package/dist/components/atomic/Text/Text.js +33 -0
  39. package/dist/components/atomic/Text/index.d.ts +2 -0
  40. package/dist/components/atomic/TextArea/TextArea.d.ts +14 -0
  41. package/dist/components/atomic/TextArea/TextArea.js +35 -0
  42. package/dist/components/atomic/TextArea/index.d.ts +2 -0
  43. package/dist/components/atomic/TextInput/TextInput.d.ts +18 -0
  44. package/dist/components/atomic/TextInput/TextInput.js +42 -0
  45. package/dist/components/atomic/TextInput/index.d.ts +2 -0
  46. package/dist/components/layout/FormLayout/FormLayout.d.ts +9 -0
  47. package/dist/components/layout/FormLayout/FormLayout.js +15 -0
  48. package/dist/components/layout/FormLayout/index.d.ts +2 -0
  49. package/dist/components/layout/Stack/Stack.d.ts +22 -0
  50. package/dist/components/layout/Stack/Stack.js +62 -0
  51. package/dist/components/layout/Stack/index.d.ts +2 -0
  52. package/dist/components/molecule/FormField/FormField.d.ts +16 -0
  53. package/dist/components/molecule/FormField/FormField.js +47 -0
  54. package/dist/components/molecule/FormField/index.d.ts +2 -0
  55. package/dist/components/ui/badge.js +26 -0
  56. package/dist/components/ui/button.d.ts +2 -0
  57. package/dist/components/ui/button.js +1 -1
  58. package/dist/components/ui/checkbox.js +18 -0
  59. package/dist/components/ui/field.js +65 -0
  60. package/dist/components/ui/input.js +14 -0
  61. package/dist/components/ui/label.js +12 -0
  62. package/dist/components/ui/select.js +75 -0
  63. package/dist/components/ui/separator.js +13 -0
  64. package/dist/components/ui/skeleton.js +11 -0
  65. package/dist/components/ui/spinner.js +14 -0
  66. package/dist/components/ui/switch.js +18 -0
  67. package/dist/components/ui/textarea.js +12 -0
  68. package/dist/index.d.ts +36 -3
  69. package/dist/index.js +18 -1
  70. package/dist/lib/types.d.ts +16 -1
  71. package/package.json +1 -1
  72. 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 { Button, ButtonProps, ButtonVariant } from "./components/atomic/Button/Button.js";
3
- import { IconComponent, Size } from "./lib/types.js";
4
- export { Button, type ButtonProps, type ButtonVariant, type IconComponent, type Size };
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
- export { Button } from "./components/atomic/Button/Button.js";
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 };
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ashwa-io/ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Ashwa design system: locked React components on shadcn/ui (Base UI) and Tailwind v4, with per-org brand theming.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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);