@kazee-ds/react 0.0.0-stage → 0.4.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 (58) hide show
  1. package/dist/index.js +2736 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/types/Alert.d.ts +12 -0
  4. package/dist/types/Badge.d.ts +7 -0
  5. package/dist/types/Breadcrumb.d.ts +8 -0
  6. package/dist/types/Button.d.ts +53 -0
  7. package/dist/types/ButtonGroup.d.ts +18 -0
  8. package/dist/types/Card.d.ts +14 -0
  9. package/dist/types/Chart.d.ts +15 -0
  10. package/dist/types/Checkbox.d.ts +16 -0
  11. package/dist/types/Combobox.d.ts +27 -0
  12. package/dist/types/DataTable.d.ts +18 -0
  13. package/dist/types/DateRangePicker.d.ts +12 -0
  14. package/dist/types/Dialog.d.ts +29 -0
  15. package/dist/types/DropdownMenu.d.ts +25 -0
  16. package/dist/types/Empty.d.ts +10 -0
  17. package/dist/types/FieldComponent.d.ts +33 -0
  18. package/dist/types/Form.d.ts +17 -0
  19. package/dist/types/Input.d.ts +47 -0
  20. package/dist/types/Label.d.ts +8 -0
  21. package/dist/types/Listbox.d.ts +17 -0
  22. package/dist/types/NumberField.d.ts +24 -0
  23. package/dist/types/OverlayDirection.d.ts +5 -0
  24. package/dist/types/Pagination.d.ts +16 -0
  25. package/dist/types/Popover.d.ts +14 -0
  26. package/dist/types/RadioGroup.d.ts +20 -0
  27. package/dist/types/Select.d.ts +50 -0
  28. package/dist/types/SelectGroup.d.ts +13 -0
  29. package/dist/types/SelectionValidation.d.ts +8 -0
  30. package/dist/types/Separator.d.ts +6 -0
  31. package/dist/types/Sidebar.d.ts +13 -0
  32. package/dist/types/Skeleton.d.ts +7 -0
  33. package/dist/types/Spinner.d.ts +10 -0
  34. package/dist/types/Switch.d.ts +13 -0
  35. package/dist/types/Table.d.ts +5 -0
  36. package/dist/types/Tabs.d.ts +33 -0
  37. package/dist/types/Textarea.d.ts +24 -0
  38. package/dist/types/ToggleButton.d.ts +23 -0
  39. package/dist/types/ToggleButtonGroup.d.ts +30 -0
  40. package/dist/types/ToggleGroup.d.ts +33 -0
  41. package/dist/types/Tooltip.d.ts +16 -0
  42. package/dist/types/chart-model.d.ts +12 -0
  43. package/dist/types/dashboard-types.d.ts +27 -0
  44. package/dist/types/data-table-types.d.ts +13 -0
  45. package/dist/types/date-range-model.d.ts +69 -0
  46. package/dist/types/field.d.ts +9 -0
  47. package/dist/types/form-context.d.ts +3 -0
  48. package/dist/types/icons.d.ts +7 -0
  49. package/dist/types/index.d.ts +83 -0
  50. package/dist/types/listbox-selection.d.ts +8 -0
  51. package/dist/types/overlay-model.d.ts +14 -0
  52. package/dist/types/pagination-model.d.ts +5 -0
  53. package/dist/types/selection-options.d.ts +8 -0
  54. package/dist/types/tabs-indicator.d.ts +1 -0
  55. package/dist/types/toggle-group-model.d.ts +9 -0
  56. package/dist/types/useDisclosure.d.ts +4 -0
  57. package/package.json +56 -3
  58. package/README.md +0 -3
@@ -0,0 +1,30 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ButtonSize } from './Button.js';
3
+ import { ButtonGroupSeparator } from './ButtonGroup.js';
4
+ interface Common {
5
+ label: string;
6
+ children: ReactNode;
7
+ size?: ButtonSize;
8
+ isDisabled?: boolean;
9
+ isDetached?: boolean;
10
+ fullWidth?: boolean;
11
+ orientation?: 'horizontal' | 'vertical';
12
+ dir?: 'ltr' | 'rtl';
13
+ disallowEmptySelection?: boolean;
14
+ }
15
+ export type ToggleButtonGroupProps = Common & ({
16
+ selectionMode?: 'single';
17
+ value?: string | null;
18
+ defaultValue?: string | null;
19
+ onChange?: (value: string | null) => void;
20
+ } | {
21
+ selectionMode: 'multiple';
22
+ value?: string[];
23
+ defaultValue?: string[];
24
+ onChange?: (value: string[]) => void;
25
+ });
26
+ declare function Root(props: ToggleButtonGroupProps): import("react").JSX.Element;
27
+ export declare const ToggleButtonGroup: typeof Root & {
28
+ Separator: typeof ButtonGroupSeparator;
29
+ };
30
+ export {};
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ToggleGroupItem, type ToggleGroupVariant } from './toggle-group-model.js';
3
+ import type { ButtonSize } from './Button.js';
4
+ export type { ToggleGroupItem, ToggleGroupMode, ToggleGroupVariant } from './toggle-group-model.js';
5
+ interface ToggleGroupCommonProps {
6
+ label: string;
7
+ items: ToggleGroupItem[];
8
+ isDisabled?: boolean;
9
+ isIconOnly?: boolean;
10
+ renderIcon?: (item: ToggleGroupItem) => ReactNode;
11
+ disallowEmptySelection?: boolean;
12
+ variant?: ToggleGroupVariant;
13
+ size?: ButtonSize;
14
+ orientation?: 'horizontal' | 'vertical';
15
+ dir?: 'ltr' | 'rtl';
16
+ }
17
+ export type ToggleGroupProps = ToggleGroupCommonProps & ({
18
+ selectionMode?: 'single';
19
+ value?: string | null;
20
+ defaultValue?: string | null;
21
+ onChange?: (value: string | null) => void;
22
+ } | {
23
+ selectionMode: 'multiple';
24
+ value?: string[];
25
+ defaultValue?: string[];
26
+ onChange?: (value: string[]) => void;
27
+ });
28
+ export declare function ToggleGroup(props: Extract<ToggleGroupProps, {
29
+ selectionMode: 'multiple';
30
+ }>): ReactNode;
31
+ export declare function ToggleGroup(props: Exclude<ToggleGroupProps, {
32
+ selectionMode: 'multiple';
33
+ }>): ReactNode;
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ButtonVariant, ButtonSize } from './Button.js';
3
+ export interface TooltipProps {
4
+ triggerLabel: string;
5
+ text: string;
6
+ triggerContent?: ReactNode;
7
+ triggerIconOnly?: boolean;
8
+ triggerVariant?: ButtonVariant;
9
+ triggerSize?: ButtonSize;
10
+ open?: boolean;
11
+ defaultOpen?: boolean;
12
+ onOpenChange?: (open: boolean) => void;
13
+ isDisabled?: boolean;
14
+ dir?: 'ltr' | 'rtl';
15
+ }
16
+ export declare function Tooltip({ triggerLabel, text, triggerContent, triggerIconOnly, triggerVariant, triggerSize, open, defaultOpen, onOpenChange, isDisabled, dir, }: TooltipProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { ChartDatum } from './dashboard-types.js';
2
+ export declare function chartModel(data: ChartDatum[]): {
3
+ items: {
4
+ x: number;
5
+ y: number;
6
+ id: string;
7
+ label: string;
8
+ value: number;
9
+ }[];
10
+ baseline: number;
11
+ barWidth: number;
12
+ };
@@ -0,0 +1,27 @@
1
+ export interface NavigationItem {
2
+ id: string;
3
+ label: string;
4
+ href: string;
5
+ isDisabled?: boolean;
6
+ }
7
+ export interface BreadcrumbItem {
8
+ label: string;
9
+ href?: string;
10
+ }
11
+ export interface ChartDatum {
12
+ id: string;
13
+ label: string;
14
+ value: number;
15
+ }
16
+ export interface DropdownMenuItem {
17
+ id: string;
18
+ label: string;
19
+ isDisabled?: boolean;
20
+ tone?: 'default' | 'danger';
21
+ description?: string;
22
+ /** Display hint only; the application handles keyboard shortcuts. */
23
+ shortcut?: string;
24
+ section?: string;
25
+ separatorBefore?: boolean;
26
+ children?: DropdownMenuItem[];
27
+ }
@@ -0,0 +1,13 @@
1
+ export interface DataTableColumn {
2
+ id: string;
3
+ label: string;
4
+ sortable?: boolean;
5
+ }
6
+ export interface DataTableRow {
7
+ id: string;
8
+ cells: Record<string, string | number | null | undefined>;
9
+ }
10
+ export interface TableSort {
11
+ columnId: string;
12
+ direction: 'ascending' | 'descending';
13
+ }
@@ -0,0 +1,69 @@
1
+ export interface DateRange {
2
+ start: string;
3
+ end: string;
4
+ }
5
+ export interface DateRangePreset {
6
+ id: string;
7
+ label: string;
8
+ value: DateRange;
9
+ }
10
+ export interface DateRangeConstraints {
11
+ minDate?: string;
12
+ maxDate?: string;
13
+ minDays?: number;
14
+ maxDays?: number;
15
+ isDateUnavailable?: (date: string) => boolean;
16
+ }
17
+ export type DateRangeSize = 'sm' | 'md' | 'lg';
18
+ export type DateRangeVariant = 'primary' | 'secondary' | 'outline';
19
+ export interface DateRangeOptions extends DateRangeConstraints {
20
+ label: string;
21
+ defaultValue?: DateRange | null;
22
+ size?: DateRangeSize;
23
+ variant?: DateRangeVariant;
24
+ hideLabel?: boolean;
25
+ fullWidth?: boolean;
26
+ locale?: string;
27
+ dir?: 'ltr' | 'rtl';
28
+ visibleMonths?: 1 | 2;
29
+ weekStartsOn?: 0 | 1;
30
+ display?: 'popover' | 'inline';
31
+ showInputs?: boolean;
32
+ showMonthYearPicker?: boolean;
33
+ triggerDisplay?: 'text' | 'icon';
34
+ presets?: DateRangePreset[];
35
+ labels?: Partial<DateRangeLabels>;
36
+ formatRange?: (value: DateRange, locale: string) => string;
37
+ description?: string;
38
+ errorMessage?: string;
39
+ name?: string;
40
+ referenceDate?: string;
41
+ open?: boolean;
42
+ defaultOpen?: boolean;
43
+ }
44
+ export type DateRangeError = 'incomplete' | 'order' | 'bounds' | 'unavailable' | 'length';
45
+ export interface DateRangeLabels {
46
+ title: string;
47
+ start: string;
48
+ end: string;
49
+ apply: string;
50
+ cancel: string;
51
+ clear: string;
52
+ previousMonth: string;
53
+ nextMonth: string;
54
+ presets: string;
55
+ placeholder: string;
56
+ incomplete: string;
57
+ order: string;
58
+ bounds: string;
59
+ unavailable: string;
60
+ length: string;
61
+ required: string;
62
+ }
63
+ export declare function dateRangeLabels(locale?: string): DateRangeLabels;
64
+ export declare function validDate(value: string): boolean;
65
+ export declare function asDate(value?: string): import("@internationalized/date").CalendarDate | undefined;
66
+ export declare function currentDate(): string;
67
+ export declare function rangeError(value: DateRange | null, constraints?: DateRangeConstraints): DateRangeError | null;
68
+ export declare function rangeText(value: DateRange | null, locale?: string): string;
69
+ export declare function createDateRangePresets(referenceDate?: string, locale?: string, weekStartsOn?: 0 | 1): DateRangePreset[];
@@ -0,0 +1,9 @@
1
+ export interface FieldFeedbackProps {
2
+ description?: string;
3
+ errorMessage?: string;
4
+ isInvalid?: boolean;
5
+ }
6
+ export declare function useFeedback({ description, errorMessage, isInvalid }: FieldFeedbackProps): {
7
+ describedBy: string | undefined;
8
+ feedback: import("react").JSX.Element;
9
+ };
@@ -0,0 +1,3 @@
1
+ /** Application-owned errors, keyed by the Field name. Clear entries explicitly. */
2
+ export type ValidationErrors = Readonly<Record<string, string | undefined>>;
3
+ export declare const FormErrorsContext: import("react").Context<Readonly<Record<string, string | undefined>>>;
@@ -0,0 +1,7 @@
1
+ interface IconProps {
2
+ className?: string;
3
+ }
4
+ export declare function ChevronIcon({ className }: IconProps): import("react").JSX.Element;
5
+ export declare function CheckIcon({ className }: IconProps): import("react").JSX.Element;
6
+ export declare function CloseIcon({ className }: IconProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,83 @@
1
+ export { Button } from './Button.js';
2
+ export { ButtonGroup, ButtonGroupSeparator } from './ButtonGroup.js';
3
+ export type { ButtonGroupProps } from './ButtonGroup.js';
4
+ export { ToggleButton } from './ToggleButton.js';
5
+ export type { ToggleButtonProps, ToggleButtonVariant, ToggleButtonRenderProps, } from './ToggleButton.js';
6
+ export { ToggleButtonGroup } from './ToggleButtonGroup.js';
7
+ export type { ToggleButtonGroupProps } from './ToggleButtonGroup.js';
8
+ export type { ButtonPressEvent, ButtonProps, ButtonRenderProps, ButtonSize, ButtonVariant, } from './Button.js';
9
+ export { Select } from './Select.js';
10
+ export type { SelectOption, SelectProps, SelectSize, SelectVariant } from './Select.js';
11
+ export { SelectGroup } from './SelectGroup.js';
12
+ export type { SelectGroupProps } from './SelectGroup.js';
13
+ export { Input } from './Input.js';
14
+ export type { InputProps, InputSize, InputType, InputVariant, InputMode, InputEnterKeyHint, } from './Input.js';
15
+ export { Textarea } from './Textarea.js';
16
+ export type { TextareaProps } from './Textarea.js';
17
+ export { Label } from './Label.js';
18
+ export type { LabelProps } from './Label.js';
19
+ export { Checkbox } from './Checkbox.js';
20
+ export type { CheckboxProps } from './Checkbox.js';
21
+ export { RadioGroup } from './RadioGroup.js';
22
+ export type { RadioGroupProps } from './RadioGroup.js';
23
+ export { Switch } from './Switch.js';
24
+ export type { SwitchProps } from './Switch.js';
25
+ export type { RadioOption } from './RadioGroup.js';
26
+ export { Field } from './FieldComponent.js';
27
+ export type { FieldProps, FieldControlProps, FieldRenderProps } from './FieldComponent.js';
28
+ export { Form } from './Form.js';
29
+ export type { FormProps } from './Form.js';
30
+ export type { ValidationErrors } from './form-context.js';
31
+ export { Listbox } from './Listbox.js';
32
+ export type { ListboxProps } from './Listbox.js';
33
+ export type { ListboxOption, ListboxSelectionMode } from './listbox-selection.js';
34
+ export { NumberField } from './NumberField.js';
35
+ export type { NumberFieldProps } from './NumberField.js';
36
+ export { Card } from './Card.js';
37
+ export type { CardProps } from './Card.js';
38
+ export { Badge } from './Badge.js';
39
+ export type { BadgeProps, BadgeTone } from './Badge.js';
40
+ export { Skeleton } from './Skeleton.js';
41
+ export type { SkeletonProps } from './Skeleton.js';
42
+ export { Separator } from './Separator.js';
43
+ export type { SeparatorProps } from './Separator.js';
44
+ export { Tabs } from './Tabs.js';
45
+ export type { TabsProps, TabItem, TabsVariant } from './Tabs.js';
46
+ export { Pagination } from './Pagination.js';
47
+ export type { PaginationProps } from './Pagination.js';
48
+ export { Table } from './Table.js';
49
+ export type { TableProps } from './Table.js';
50
+ export { DataTable } from './DataTable.js';
51
+ export type { DataTableProps } from './DataTable.js';
52
+ export type { DataTableColumn, DataTableRow, TableSort } from './data-table-types.js';
53
+ export { Alert } from './Alert.js';
54
+ export type { AlertProps } from './Alert.js';
55
+ export { Empty } from './Empty.js';
56
+ export type { EmptyProps } from './Empty.js';
57
+ export { Breadcrumb } from './Breadcrumb.js';
58
+ export type { BreadcrumbProps } from './Breadcrumb.js';
59
+ export { Sidebar } from './Sidebar.js';
60
+ export type { SidebarProps } from './Sidebar.js';
61
+ export { Chart } from './Chart.js';
62
+ export type { ChartProps } from './Chart.js';
63
+ export { Dialog } from './Dialog.js';
64
+ export type { DialogProps } from './Dialog.js';
65
+ export { DropdownMenu } from './DropdownMenu.js';
66
+ export type { DropdownMenuProps } from './DropdownMenu.js';
67
+ export { Popover } from './Popover.js';
68
+ export type { PopoverProps } from './Popover.js';
69
+ export { Tooltip } from './Tooltip.js';
70
+ export type { TooltipProps } from './Tooltip.js';
71
+ export type { NavigationItem, BreadcrumbItem, ChartDatum, DropdownMenuItem, } from './dashboard-types.js';
72
+ export { Spinner } from './Spinner.js';
73
+ export type { SpinnerProps, SpinnerSize, SpinnerColor } from './Spinner.js';
74
+ export { Combobox } from './Combobox.js';
75
+ export type { ComboboxProps } from './Combobox.js';
76
+ export type { MenuSelectionMode, MenuPlacement, DialogSize, DialogPlacement, DialogScroll, DialogBackdrop, } from './overlay-model.js';
77
+ export { ToggleGroup } from './ToggleGroup.js';
78
+ export type { ToggleGroupProps, ToggleGroupItem, ToggleGroupMode, ToggleGroupVariant, } from './ToggleGroup.js';
79
+ export { DateRangePicker } from './DateRangePicker.js';
80
+ export type { DateRangePickerProps } from './DateRangePicker.js';
81
+ export { createDateRangePresets } from './date-range-model.js';
82
+ export { rangeText as formatDateRange } from './date-range-model.js';
83
+ export type { DateRange, DateRangePreset, DateRangeLabels, DateRangeSize, DateRangeVariant, } from './date-range-model.js';
@@ -0,0 +1,8 @@
1
+ export interface ListboxOption {
2
+ id: string;
3
+ label: string;
4
+ isDisabled?: boolean;
5
+ }
6
+ export type ListboxSelectionMode = 'single' | 'multiple';
7
+ /** Stable option order, unique enabled IDs, and at most one ID in single mode. */
8
+ export declare function listboxSelection(value: readonly string[], options: ListboxOption[], mode: ListboxSelectionMode): string[];
@@ -0,0 +1,14 @@
1
+ import type { DropdownMenuItem } from './dashboard-types.js';
2
+ export type MenuSelectionMode = 'none' | 'single' | 'multiple';
3
+ export type MenuPlacement = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
4
+ export declare function menuGroups(items: DropdownMenuItem[]): {
5
+ key: string;
6
+ label?: string;
7
+ items: DropdownMenuItem[];
8
+ }[];
9
+ export declare function menuLeaves(items: DropdownMenuItem[], disabled?: boolean): DropdownMenuItem[];
10
+ export declare function menuSelection(keys: string[], items: DropdownMenuItem[], mode: MenuSelectionMode): string[];
11
+ export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'cover' | 'full';
12
+ export type DialogPlacement = 'auto' | 'top' | 'center' | 'bottom';
13
+ export type DialogScroll = 'inside' | 'outside';
14
+ export type DialogBackdrop = 'opaque' | 'blur' | 'transparent';
@@ -0,0 +1,5 @@
1
+ export declare function paginationModel(totalItems: number, pageSize: number, value: number, siblingCount?: number): {
2
+ current: number;
3
+ count: number;
4
+ entries: (string | number)[];
5
+ };
@@ -0,0 +1,8 @@
1
+ export interface SelectOption {
2
+ id: string;
3
+ label: string;
4
+ description?: string;
5
+ isDisabled?: boolean;
6
+ }
7
+ export declare function selectionIds(value: unknown, options: SelectOption[], multiple: boolean): string[];
8
+ export declare function filterOptions(options: SelectOption[], query: string): SelectOption[];
@@ -0,0 +1 @@
1
+ export declare function mountTabsIndicator(container: HTMLElement): () => void;
@@ -0,0 +1,9 @@
1
+ export interface ToggleGroupItem {
2
+ id: string;
3
+ label: string;
4
+ isDisabled?: boolean;
5
+ }
6
+ export type ToggleGroupMode = 'single' | 'multiple';
7
+ export type ToggleGroupVariant = 'outline' | 'ghost';
8
+ /** Normalize IDs without discarding existing disabled selections. */
9
+ export declare function toggleIds(value: unknown, items: ToggleGroupItem[], multiple: boolean): string[];
@@ -0,0 +1,4 @@
1
+ export declare function useDisclosure(open?: boolean, defaultOpen?: boolean, onOpenChange?: (open: boolean) => void): {
2
+ visible: boolean;
3
+ change: (next: boolean) => void;
4
+ };
package/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
2
  "name": "@kazee-ds/react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.4.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/types/index.d.ts",
8
+ "import": "./dist/index.js",
9
+ "default": "./dist/index.js"
10
+ },
11
+ "./package.json": "./package.json"
12
+ },
13
+ "peerDependencies": {
14
+ "react": ">=19.0.0",
15
+ "react-dom": ">=19.0.0"
16
+ },
17
+ "dependencies": {
18
+ "@internationalized/date": "3.12.4",
19
+ "react-aria-components": "^1.21.1"
20
+ },
21
+ "devDependencies": {
22
+ "@arethetypeswrong/cli": "^0.18.5",
23
+ "@testing-library/jest-dom": "^7.0.1",
24
+ "@testing-library/react": "^16.3.3",
25
+ "@testing-library/user-event": "^14.6.7",
26
+ "@types/react": "^19.3.0",
27
+ "@types/react-dom": "^19.3.0",
28
+ "@vitejs/plugin-react": "^6.1.2",
29
+ "jsdom": "^29.1.1",
30
+ "publint": "^0.3.25",
31
+ "react": "^19.3.0",
32
+ "react-dom": "^19.3.0",
33
+ "vite": "^8.3.3"
34
+ },
35
+ "sideEffects": false,
36
+ "license": "UNLICENSED",
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "main": "./dist/index.js",
41
+ "module": "./dist/index.js",
42
+ "types": "./dist/types/index.d.ts",
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "registry": "https://registry.npmjs.org/"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://gitlab.com/kazee.indonesia/kazee-design-system.git",
50
+ "directory": "packages/react"
51
+ },
52
+ "homepage": "https://kazee-design-system-023417.gitlab.io",
53
+ "scripts": {
54
+ "test": "vitest run",
55
+ "typecheck": "tsc --noEmit",
56
+ "build": "vite build && tsc -p tsconfig.build.json",
57
+ "lint:package": "publint --strict && attw --pack . --profile esm-only"
58
+ }
6
59
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.