@carbonid1/design-system 7.2.1 → 7.3.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.
- package/README.md +1 -0
- package/dist/Autocomplete/Autocomplete.d.ts +22 -0
- package/dist/Autocomplete/Autocomplete.js +39 -0
- package/dist/Autocomplete/Autocomplete.types.d.ts +37 -0
- package/dist/Autocomplete/Autocomplete.types.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/skills/design-system-package/SKILL.md +3 -1
package/README.md
CHANGED
|
@@ -77,6 +77,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|
|
77
77
|
| `Switch` | Boolean setting control with a compound `Root` / `Thumb` API |
|
|
78
78
|
| `ContextMenu` | Right-click / long-press menu (compound API) |
|
|
79
79
|
| `Select` | Base UI-backed dropdown with a convenience wrapper and compound `Root` / `Trigger` / `Popup` / `Item` parts |
|
|
80
|
+
| `Autocomplete` | Searchable single selection with compound input, trigger, clear, popup, list, and item parts |
|
|
80
81
|
| `Tooltip` | Hover/focus tooltip with a convenience wrapper and compound `Provider` / `Root` / `Trigger` / `Popup` parts |
|
|
81
82
|
| `Toaster` | Base UI-backed toast notification root (renders once in layout) |
|
|
82
83
|
| `toast` | Imperative toast trigger for default, success, error, action, persistent, and dismissible notifications |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
2
|
+
import type { AutocompleteClearProps, AutocompleteEmptyProps, AutocompleteGroupLabelProps, AutocompleteInputGroupProps, AutocompleteInputProps, AutocompleteItemProps, AutocompleteListProps, AutocompletePopupProps, AutocompletePositionerProps, AutocompleteRootProps, AutocompleteStatusProps, AutocompleteTriggerProps } from './Autocomplete.types';
|
|
3
|
+
/** Searchable single selection, built on Base UI Combobox. Input text filters; only items are selected. */
|
|
4
|
+
export declare const Autocomplete: {
|
|
5
|
+
Root: <Value>({ autoHighlight, modal, ...props }: AutocompleteRootProps<Value>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
InputGroup: ({ className, ...props }: AutocompleteInputGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Input: (props: AutocompleteInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Trigger: ({ children, className, "aria-label": ariaLabel, ...props }: AutocompleteTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Clear: ({ children, className, "aria-label": ariaLabel, keepMounted, ...props }: AutocompleteClearProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Portal: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
Positioner: ({ className, sideOffset, collisionPadding, positionMethod, ...props }: AutocompletePositionerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
Popup: ({ className, ...props }: AutocompletePopupProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
List: ({ className, ...props }: AutocompleteListProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
Item: ({ children, className, ...props }: AutocompleteItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
Empty: ({ className, ...props }: AutocompleteEmptyProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
Group: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
GroupLabel: ({ className, ...props }: AutocompleteGroupLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
Collection: typeof BaseCombobox.Collection;
|
|
19
|
+
Status: ({ className, ...props }: AutocompleteStatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
useFilter: typeof BaseCombobox.useFilter;
|
|
21
|
+
useFilteredItems: typeof BaseCombobox.useFilteredItems;
|
|
22
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
4
|
+
import { Check, ChevronDown, X } from 'lucide-react';
|
|
5
|
+
import { InputGroup as StyledInputGroup } from '../InputGroup/InputGroup';
|
|
6
|
+
import { mergeStatefulClassName } from '../helpers/mergeStatefulClassName/mergeStatefulClassName';
|
|
7
|
+
const Root = ({ autoHighlight = true, modal = false, ...props }) => (_jsx(BaseCombobox.Root, { autoHighlight: autoHighlight, modal: modal, ...props, multiple: false }));
|
|
8
|
+
const InputGroup = ({ className, ...props }) => (_jsx(BaseCombobox.InputGroup, { render: _jsx(StyledInputGroup.Root, {}), className: mergeStatefulClassName('min-h-9 gap-0 p-0.5', className), ...props }));
|
|
9
|
+
/** Compose inside InputGroup so the input and its actions share one focus ring and surface. */
|
|
10
|
+
const Input = (props) => (_jsx(BaseCombobox.Input, { render: _jsx(StyledInputGroup.Control, {}), ...props }));
|
|
11
|
+
const Trigger = ({ children, className, 'aria-label': ariaLabel = 'Show options', ...props }) => (_jsx(BaseCombobox.Trigger, { "aria-label": ariaLabel, "aria-labelledby": undefined, render: _jsx(StyledInputGroup.Action, { variant: "ghost" }), className: mergeStatefulClassName('group motion-reduce:transition-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-[Highlight]', className), ...props, children: children ?? (_jsx(ChevronDown, { "aria-hidden": true, className: "size-4 transition-transform group-data-[popup-open]:rotate-180 motion-reduce:transition-none" })) }));
|
|
12
|
+
const Clear = ({ children, className, 'aria-label': ariaLabel = 'Clear selection', keepMounted = true, ...props }) => (_jsx(BaseCombobox.Clear, { "aria-label": ariaLabel, keepMounted: keepMounted, render: _jsx(StyledInputGroup.Action, { variant: "ghost" }), className: mergeStatefulClassName('not-data-[visible]:invisible motion-reduce:transition-none forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-[Highlight]', className), ...props, children: children ?? _jsx(X, { "aria-hidden": true, className: "size-4" }) }));
|
|
13
|
+
const Positioner = ({ className, sideOffset = 4, collisionPadding = 8, positionMethod = 'fixed', ...props }) => (_jsx(BaseCombobox.Positioner, { sideOffset: sideOffset, collisionPadding: collisionPadding, positionMethod: positionMethod, className: mergeStatefulClassName('z-50 outline-hidden', className), ...props }));
|
|
14
|
+
const Popup = ({ className, ...props }) => (_jsx(BaseCombobox.Popup, { className: mergeStatefulClassName('border-border bg-popover text-popover-foreground shadow-popover flex max-h-[var(--available-height)] w-[var(--anchor-width)] max-w-[var(--available-width)] flex-col overflow-hidden rounded-lg border outline-hidden', className), ...props }));
|
|
15
|
+
const List = ({ className, ...props }) => (_jsx(BaseCombobox.List, { className: mergeStatefulClassName('max-h-60 min-h-0 scroll-py-1 space-y-1 overflow-y-auto overscroll-contain p-1 empty:p-0', className), ...props }));
|
|
16
|
+
const Item = ({ children, className, ...props }) => (_jsxs(BaseCombobox.Item, { className: mergeStatefulClassName('data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[selected]:bg-primary/10 data-[selected]:ring-primary/20 relative flex min-h-9 cursor-default items-center gap-2 rounded-lg px-2.5 py-2 text-sm break-words outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[selected]:font-medium data-[selected]:ring-1 data-[selected]:ring-inset forced-colors:data-[highlighted]:outline-2 forced-colors:data-[highlighted]:outline-offset-[-2px] forced-colors:data-[highlighted]:outline-[Highlight]', className), ...props, children: [_jsx("span", { className: "min-w-0 flex-1", children: children }), _jsx(BaseCombobox.ItemIndicator, { keepMounted: true, className: "invisible shrink-0 data-[selected]:visible", children: _jsx(Check, { "aria-hidden": true, className: "size-4" }) })] }));
|
|
17
|
+
const Empty = ({ className, ...props }) => (_jsx(BaseCombobox.Empty, { className: mergeStatefulClassName('text-muted-foreground overflow-y-auto px-3 text-sm not-empty:py-3', className), ...props }));
|
|
18
|
+
const GroupLabel = ({ className, ...props }) => (_jsx(BaseCombobox.GroupLabel, { className: mergeStatefulClassName('text-muted-foreground px-2.5 pt-2 pb-1 text-xs font-medium', className), ...props }));
|
|
19
|
+
const Status = ({ className, ...props }) => (_jsx(BaseCombobox.Status, { className: mergeStatefulClassName('text-muted-foreground px-3 text-sm not-empty:py-2', className), ...props }));
|
|
20
|
+
/** Searchable single selection, built on Base UI Combobox. Input text filters; only items are selected. */
|
|
21
|
+
export const Autocomplete = {
|
|
22
|
+
Root,
|
|
23
|
+
InputGroup,
|
|
24
|
+
Input,
|
|
25
|
+
Trigger,
|
|
26
|
+
Clear,
|
|
27
|
+
Portal: BaseCombobox.Portal,
|
|
28
|
+
Positioner,
|
|
29
|
+
Popup,
|
|
30
|
+
List,
|
|
31
|
+
Item,
|
|
32
|
+
Empty,
|
|
33
|
+
Group: BaseCombobox.Group,
|
|
34
|
+
GroupLabel,
|
|
35
|
+
Collection: BaseCombobox.Collection,
|
|
36
|
+
Status,
|
|
37
|
+
useFilter: BaseCombobox.useFilter,
|
|
38
|
+
useFilteredItems: BaseCombobox.useFilteredItems,
|
|
39
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
2
|
+
import type { Ref } from 'react';
|
|
3
|
+
/** A searchable single-selection control. `value` is the selected item; `inputValue` is the query. */
|
|
4
|
+
export type AutocompleteRootProps<Value> = Omit<BaseCombobox.Root.Props<Value>, 'multiple'>;
|
|
5
|
+
export type AutocompleteInputGroupProps = BaseCombobox.InputGroup.Props & {
|
|
6
|
+
ref?: Ref<HTMLDivElement>;
|
|
7
|
+
};
|
|
8
|
+
export type AutocompleteInputProps = BaseCombobox.Input.Props & {
|
|
9
|
+
ref?: Ref<HTMLInputElement>;
|
|
10
|
+
};
|
|
11
|
+
export type AutocompleteTriggerProps = BaseCombobox.Trigger.Props & {
|
|
12
|
+
ref?: Ref<HTMLButtonElement>;
|
|
13
|
+
};
|
|
14
|
+
export type AutocompleteClearProps = BaseCombobox.Clear.Props & {
|
|
15
|
+
ref?: Ref<HTMLButtonElement>;
|
|
16
|
+
};
|
|
17
|
+
export type AutocompletePositionerProps = BaseCombobox.Positioner.Props & {
|
|
18
|
+
ref?: Ref<HTMLDivElement>;
|
|
19
|
+
};
|
|
20
|
+
export type AutocompletePopupProps = BaseCombobox.Popup.Props & {
|
|
21
|
+
ref?: Ref<HTMLDivElement>;
|
|
22
|
+
};
|
|
23
|
+
export type AutocompleteListProps = BaseCombobox.List.Props & {
|
|
24
|
+
ref?: Ref<HTMLDivElement>;
|
|
25
|
+
};
|
|
26
|
+
export type AutocompleteItemProps = BaseCombobox.Item.Props & {
|
|
27
|
+
ref?: Ref<HTMLDivElement>;
|
|
28
|
+
};
|
|
29
|
+
export type AutocompleteEmptyProps = BaseCombobox.Empty.Props & {
|
|
30
|
+
ref?: Ref<HTMLDivElement>;
|
|
31
|
+
};
|
|
32
|
+
export type AutocompleteGroupLabelProps = BaseCombobox.GroupLabel.Props & {
|
|
33
|
+
ref?: Ref<HTMLDivElement>;
|
|
34
|
+
};
|
|
35
|
+
export type AutocompleteStatusProps = BaseCombobox.Status.Props & {
|
|
36
|
+
ref?: Ref<HTMLDivElement>;
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export { buttonVariants } from './Button/Button.variants';
|
|
|
7
7
|
export type { ButtonProps } from './Button/Button.types';
|
|
8
8
|
export { Input } from './Input/Input';
|
|
9
9
|
export type { InputProps } from './Input/Input.types';
|
|
10
|
+
export { Autocomplete } from './Autocomplete/Autocomplete';
|
|
11
|
+
export type { AutocompleteClearProps, AutocompleteEmptyProps, AutocompleteGroupLabelProps, AutocompleteInputGroupProps, AutocompleteInputProps, AutocompleteItemProps, AutocompleteListProps, AutocompletePopupProps, AutocompletePositionerProps, AutocompleteRootProps, AutocompleteStatusProps, AutocompleteTriggerProps, } from './Autocomplete/Autocomplete.types';
|
|
10
12
|
export { Field } from './Field/Field';
|
|
11
13
|
export type { FieldControlProps, FieldDescriptionProps, FieldErrorProps, FieldItemProps, FieldLabelProps, FieldRootActions, FieldRootProps, FieldValidityProps, FieldValidityState, } from './Field/Field.types';
|
|
12
14
|
export { InputGroup } from './InputGroup/InputGroup';
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { badgeVariants } from './Badge/Badge.variants';
|
|
|
4
4
|
export { Button } from './Button/Button';
|
|
5
5
|
export { buttonVariants } from './Button/Button.variants';
|
|
6
6
|
export { Input } from './Input/Input';
|
|
7
|
+
export { Autocomplete } from './Autocomplete/Autocomplete';
|
|
7
8
|
export { Field } from './Field/Field';
|
|
8
9
|
export { InputGroup } from './InputGroup/InputGroup';
|
|
9
10
|
export { Card, cardVariants } from './Card/Card';
|
package/package.json
CHANGED
|
@@ -56,4 +56,6 @@ A package change is invisible outside this repo until it's published. For releas
|
|
|
56
56
|
|
|
57
57
|
`pnpm release` is a local agent-run release step, not CI/GitHub automation. It versions packages, publishes to npm, pushes tags, and expects a clean `main`. Run it only for release-ready package work; don't run it for exploratory or unfinished changes.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
**Publishing auth is exclusively `NPM_TOKEN`**, loaded by the packages repo's release script from its gitignored `.env.local` or an explicitly exported environment variable. Never print or commit it. Do not use `npm login`, `pnpm login`, browser/QR CLI login, OTP prompts, `~/.npmrc` session credentials, a direct publish command, or publishing CI as a fallback. If authentication fails, inspect the token's expiry and package write permissions and replace that token in `.env.local`; token rotation in npm's account settings must not become an alternate publishing session.
|
|
60
|
+
|
|
61
|
+
Stop only for real blockers: failing checks, an unexpected major or breaking release, a missing or rejected publishing token, unrelated dirty work, merge conflicts, an unexpected release prompt, or a release script failure. Otherwise publish and continue.
|