@carbonid1/design-system 7.0.0 → 7.0.1

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,20 @@
1
+ import type { ElementType } from 'react';
2
+ import type { ItemActionsProps, ItemContentProps, ItemDescriptionProps, ItemMediaProps, ItemRootProps, ItemTitleProps } from './Item.types';
3
+ declare const itemVariants: (props?: ({
4
+ surface?: "outline" | "raised" | "plain" | "inset" | null | undefined;
5
+ interactive?: boolean | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ /**
8
+ * One member of a collection. `Item` supplies static structure and surface styling only:
9
+ * callers keep native list markup and attach link, button, or disclosure behavior to the
10
+ * appropriate owner. `interactive` adds visual feedback without adding semantics or handlers.
11
+ */
12
+ export declare const Item: {
13
+ Root: <E extends ElementType = "div">({ as, className, surface, interactive, ...props }: ItemRootProps<E>) => import("react/jsx-runtime").JSX.Element;
14
+ Media: ({ className, ...props }: ItemMediaProps) => import("react/jsx-runtime").JSX.Element;
15
+ Content: ({ className, ...props }: ItemContentProps) => import("react/jsx-runtime").JSX.Element;
16
+ Title: ({ className, ...props }: ItemTitleProps) => import("react/jsx-runtime").JSX.Element;
17
+ Description: ({ className, ...props }: ItemDescriptionProps) => import("react/jsx-runtime").JSX.Element;
18
+ Actions: ({ className, ...props }: ItemActionsProps) => import("react/jsx-runtime").JSX.Element;
19
+ };
20
+ export { itemVariants };
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ import { cn } from '../helpers/cn/cn';
4
+ const itemVariants = cva('min-w-0 rounded-lg', {
5
+ variants: {
6
+ surface: {
7
+ plain: 'bg-transparent',
8
+ raised: 'bg-card shadow-card',
9
+ inset: 'bg-surface-inset inset-shadow-surface',
10
+ outline: 'border-border border bg-transparent',
11
+ },
12
+ interactive: {
13
+ true: 'outline-hidden hover:bg-accent focus-within:bg-accent focus-visible:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 dark:hover:bg-accent/50 dark:focus-within:bg-accent/50 dark:focus-visible:bg-accent/50 forced-colors:focus-visible:ring-0 forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-offset-2 forced-colors:focus-visible:outline-[Highlight]',
14
+ false: '',
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ surface: 'plain',
19
+ interactive: false,
20
+ },
21
+ });
22
+ const Root = ({ as, className, surface = 'plain', interactive = false, ...props }) => {
23
+ const Component = (as ?? 'div');
24
+ return (_jsx(Component, { "data-slot": "item", className: cn('flex items-center gap-3 p-3', itemVariants({ surface, interactive }), className), ...props }));
25
+ };
26
+ const Media = ({ className, ...props }) => (_jsx("div", { "data-slot": "item-media", className: cn('flex shrink-0 items-center justify-center', className), ...props }));
27
+ const Content = ({ className, ...props }) => (_jsx("div", { "data-slot": "item-content", className: cn('flex min-w-0 flex-1 flex-col gap-1', className), ...props }));
28
+ const Title = ({ className, ...props }) => (_jsx("div", { "data-slot": "item-title", className: cn('text-sm leading-snug font-medium', className), ...props }));
29
+ const Description = ({ className, ...props }) => (_jsx("div", { "data-slot": "item-description", className: cn('text-muted-foreground text-sm leading-normal', className), ...props }));
30
+ const Actions = ({ className, ...props }) => (_jsx("div", { "data-slot": "item-actions", className: cn('flex shrink-0 items-center gap-2', className), ...props }));
31
+ /**
32
+ * One member of a collection. `Item` supplies static structure and surface styling only:
33
+ * callers keep native list markup and attach link, button, or disclosure behavior to the
34
+ * appropriate owner. `interactive` adds visual feedback without adding semantics or handlers.
35
+ */
36
+ export const Item = {
37
+ Root,
38
+ Media,
39
+ Content,
40
+ Title,
41
+ Description,
42
+ Actions,
43
+ };
44
+ export { itemVariants };
@@ -0,0 +1,21 @@
1
+ import type { ComponentPropsWithoutRef, ElementType } from 'react';
2
+ import type { VariantProps } from 'class-variance-authority';
3
+ import type { itemVariants } from './Item';
4
+ type ItemRootOwnProps<E extends ElementType = 'div'> = VariantProps<typeof itemVariants> & {
5
+ /** Override the rendered element while preserving its native props. Defaults to `div`. */
6
+ as?: E;
7
+ className?: string;
8
+ };
9
+ /**
10
+ * Props for `Item.Root`. `surface` controls elevation; `interactive` adds hover and visible-focus
11
+ * styling but never supplies behavior, roles, handlers, or focusability.
12
+ */
13
+ type ItemRootProps<E extends ElementType = 'div'> = ItemRootOwnProps<E> & Omit<ComponentPropsWithoutRef<E>, keyof ItemRootOwnProps<E>>;
14
+ /** Concrete root props for contexts that need a fixed default element, such as Storybook args. */
15
+ type ItemRootPropsDefault = ItemRootProps<'div'>;
16
+ type ItemMediaProps = ComponentPropsWithoutRef<'div'>;
17
+ type ItemContentProps = ComponentPropsWithoutRef<'div'>;
18
+ type ItemTitleProps = ComponentPropsWithoutRef<'div'>;
19
+ type ItemDescriptionProps = ComponentPropsWithoutRef<'div'>;
20
+ type ItemActionsProps = ComponentPropsWithoutRef<'div'>;
21
+ export type { ItemActionsProps, ItemContentProps, ItemDescriptionProps, ItemMediaProps, ItemRootProps, ItemRootPropsDefault, ItemTitleProps, };
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export { InputGroup } from './InputGroup/InputGroup';
11
11
  export type { InputGroupActionProps, InputGroupControlProps, InputGroupRootProps, } from './InputGroup/InputGroup.types';
12
12
  export { Card, cardVariants } from './Card/Card';
13
13
  export type { CardActionProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardRootProps, CardTitleProps, } from './Card/Card.types';
14
+ export { Item, itemVariants } from './Item/Item';
15
+ export type { ItemActionsProps, ItemContentProps, ItemDescriptionProps, ItemMediaProps, ItemRootProps, ItemRootPropsDefault, ItemTitleProps, } from './Item/Item.types';
14
16
  export { Kbd, kbdVariants } from './Kbd/Kbd';
15
17
  export type { KbdProps } from './Kbd/Kbd.types';
16
18
  export { Text, textVariants } from './Text/Text';
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export { Input } from './Input/Input';
5
5
  export { Field } from './Field/Field';
6
6
  export { InputGroup } from './InputGroup/InputGroup';
7
7
  export { Card, cardVariants } from './Card/Card';
8
+ export { Item, itemVariants } from './Item/Item';
8
9
  export { Kbd, kbdVariants } from './Kbd/Kbd';
9
10
  export { Text, textVariants } from './Text/Text';
10
11
  export { ProgressRing } from './ProgressRing/ProgressRing';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbonid1/design-system",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Shared React UI primitives + design tokens (themes, postcss config)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,6 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@base-ui/react": "^1.6.0",
56
+ "@storybook/addon-a11y": "^10.3.5",
56
57
  "@storybook/addon-docs": "^10.3.5",
57
58
  "@storybook/addon-mcp": "^0.6.0",
58
59
  "@storybook/addon-themes": "^10.3.5",