@pickle-ui/react 1.0.0-beta.11 → 1.0.0-beta.13

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.
@@ -3,7 +3,7 @@ import { type VariantProps } from 'class-variance-authority';
3
3
  import { type SlotClassNames } from '../lib/utils.js';
4
4
  declare const buttonVariants: (props?: ({
5
5
  size?: "md" | "lg" | "sm" | "icon" | "icon-lg" | "icon-sm" | "icon-xl" | "icon-xs" | "xl" | "xs" | null | undefined;
6
- variant?: "destructive" | "link" | "default" | "outline" | "secondary" | "destructive-outline" | "ghost" | null | undefined;
6
+ variant?: "destructive" | "link" | "default" | "outline" | "secondary" | "ghost" | "ghost-destructive" | "outline-destructive" | "secondary-destructive" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export interface ButtonProps extends useRender.ComponentProps<'button'>, VariantProps<typeof buttonVariants> {
9
9
  classNames?: SlotClassNames<'loadingIndicator'>;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAM,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAGvD,QAAA,MAAM,cAAc;;;8EAsCnB,CAAC;AAEF,MAAM,WAAW,WACf,SACE,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,EAClC,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAe,EACf,GAAG,EACH,MAAM,EACN,IAAW,EACX,IAAI,EACJ,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,WAAW,8FAqCb;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAM,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAGvD,QAAA,MAAM,cAAc;;;8EA0CnB,CAAC;AAEF,MAAM,WAAW,WACf,SACE,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,EAClC,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAe,EACf,GAAG,EACH,MAAM,EACN,IAAW,EACX,IAAI,EACJ,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,WAAW,8FAqCb;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -26,11 +26,13 @@ const buttonVariants = cva("relative inline-flex shrink-0 cursor-pointer items-c
26
26
  variant: {
27
27
  default: 'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 data-pressed:bg-primary/90 *:data-[slot=button-loading-indicator]:text-primary-foreground [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',
28
28
  destructive: 'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-destructive-foreground shadow-destructive/24 shadow-xs hover:bg-destructive/90 data-pressed:bg-destructive/90 *:data-[slot=button-loading-indicator]:text-destructive-foreground [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',
29
- 'destructive-outline': 'border-input bg-popover not-dark:bg-clip-padding text-destructive-subtle-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:border-destructive/32 hover:bg-destructive/4 data-pressed:border-destructive/32 data-pressed:bg-destructive/4 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none',
30
29
  ghost: 'border-transparent text-foreground hover:bg-accent data-pressed:bg-accent *:data-[slot=button-loading-indicator]:text-foreground',
30
+ 'ghost-destructive': 'border-transparent text-destructive-subtle-foreground hover:bg-accent data-pressed:bg-accent *:data-[slot=button-loading-indicator]:text-destructive-subtle-foreground',
31
31
  link: 'border-transparent text-foreground underline-offset-4 hover:underline data-pressed:underline *:data-[slot=button-loading-indicator]:text-foreground',
32
32
  outline: 'border-input bg-popover not-dark:bg-clip-padding text-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:bg-accent/50 data-pressed:bg-accent/50 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:data-pressed:bg-input/64 dark:hover:bg-input/64 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none',
33
+ 'outline-destructive': 'border-input bg-popover not-dark:bg-clip-padding text-destructive-subtle-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:border-destructive/32 hover:bg-destructive/4 data-pressed:border-destructive/32 data-pressed:bg-destructive/4 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none',
33
34
  secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90 *:data-[slot=button-loading-indicator]:text-secondary-foreground [:active,[data-pressed]]:bg-secondary/80',
35
+ 'secondary-destructive': 'border-transparent bg-destructive-subtle text-destructive-subtle-foreground hover:bg-destructive-subtle/90 data-pressed:bg-destructive-subtle/90 *:data-[slot=button-loading-indicator]:text-destructive-subtle-foreground [:active,[data-pressed]]:bg-destructive-subtle/80',
34
36
  },
35
37
  },
36
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAuB,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,cAAc,GAAG,GAAG,CACxB,oyBAAoyB,EACpyB;IACE,eAAe,EAAE;QACf,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,gDAAgD;YAC3D,SAAS,EACP,qIAAqI;YACvI,EAAE,EAAE,mCAAmC;YACvC,EAAE,EAAE,iCAAiC;YACrC,EAAE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C,SAAS;QACjD,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;KACjD,CAAC;IAEF,OAAO,SAAS,CAAC;QACf,cAAc,EAAE,QAAQ;QACxB,KAAK,EAAE,UAAU,CAAW,YAAY,EAAE,KAAK,CAAC;QAChD,GAAG;QACH,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -1,6 +1,14 @@
1
+ import { type RenderSeparator } from './_internal/separate.js';
1
2
  import { type FlexProps } from './Flex.js';
2
- type XStackProps = Omit<FlexProps, 'direction'>;
3
- declare function XStack({ className, ref, ...props }: XStackProps): import("react").JSX.Element;
3
+ type XStackProps = Omit<FlexProps, 'direction'> & {
4
+ /**
5
+ * Renders a separator between each two children: a decorative `Separator`
6
+ * for `true`, or what a function returns, given the separator's index and
7
+ * its orientation. Give a decorative node `aria-hidden`.
8
+ */
9
+ separator?: boolean | RenderSeparator;
10
+ };
11
+ declare function XStack({ children, className, ref, separator, ...props }: XStackProps): import("react").JSX.Element;
4
12
  export { XStack };
5
13
  export type { XStackProps };
6
14
  //# sourceMappingURL=XStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"XStack.d.ts","sourceRoot":"","sources":["../../src/components/XStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,KAAK,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAEhD,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,+BASxD;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"XStack.d.ts","sourceRoot":"","sources":["../../src/components/XStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,KAAK,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG;IAChD;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;CACvC,CAAC;AAEF,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,+BAWb;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from '../lib/utils.js';
3
+ import { separate } from './_internal/separate.js';
3
4
  import { Flex } from './Flex.js';
4
- function XStack({ className, ref, ...props }) {
5
- return (_jsx(Flex, { className: cn('flex-row', className), "data-slot": "x-stack", ref: ref, ...props }));
5
+ function XStack({ children, className, ref, separator, ...props }) {
6
+ return (_jsx(Flex, { className: cn('flex-row', className), "data-slot": "x-stack", ref: ref, ...props, children: separate(children, 'vertical', separator) }));
6
7
  }
7
8
  export { XStack };
8
9
  //# sourceMappingURL=XStack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"XStack.js","sourceRoot":"","sources":["../../src/components/XStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAI9C,SAAS,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAe;IACvD,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,eAC1B,SAAS,EACnB,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"XStack.js","sourceRoot":"","sources":["../../src/components/XStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAwB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAW9C,SAAS,MAAM,CAAC,EACd,QAAQ,EACR,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACI;IACZ,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,eAC1B,SAAS,EACnB,GAAG,EAAE,GAAG,KACJ,KAAK,YAER,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,GACrC,CACR,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,6 +1,14 @@
1
+ import { type RenderSeparator } from './_internal/separate.js';
1
2
  import { type FlexProps } from './Flex.js';
2
- type YStackProps = Omit<FlexProps, 'direction'>;
3
- declare function YStack({ className, ref, ...props }: YStackProps): import("react").JSX.Element;
3
+ type YStackProps = Omit<FlexProps, 'direction'> & {
4
+ /**
5
+ * Renders a separator between each two children: a decorative `Separator`
6
+ * for `true`, or what a function returns, given the separator's index and
7
+ * its orientation. Give a decorative node `aria-hidden`.
8
+ */
9
+ separator?: boolean | RenderSeparator;
10
+ };
11
+ declare function YStack({ children, className, ref, separator, ...props }: YStackProps): import("react").JSX.Element;
4
12
  export { YStack };
5
13
  export type { YStackProps };
6
14
  //# sourceMappingURL=YStack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"YStack.d.ts","sourceRoot":"","sources":["../../src/components/YStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,KAAK,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAEhD,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,+BASxD;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"YStack.d.ts","sourceRoot":"","sources":["../../src/components/YStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAE9C,KAAK,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG;IAChD;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;CACvC,CAAC;AAEF,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,+BAWb;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from '../lib/utils.js';
3
+ import { separate } from './_internal/separate.js';
3
4
  import { Flex } from './Flex.js';
4
- function YStack({ className, ref, ...props }) {
5
- return (_jsx(Flex, { className: cn('flex-col', className), "data-slot": "y-stack", ref: ref, ...props }));
5
+ function YStack({ children, className, ref, separator, ...props }) {
6
+ return (_jsx(Flex, { className: cn('flex-col', className), "data-slot": "y-stack", ref: ref, ...props, children: separate(children, 'horizontal', separator) }));
6
7
  }
7
8
  export { YStack };
8
9
  //# sourceMappingURL=YStack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"YStack.js","sourceRoot":"","sources":["../../src/components/YStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAI9C,SAAS,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAe;IACvD,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,eAC1B,SAAS,EACnB,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"YStack.js","sourceRoot":"","sources":["../../src/components/YStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAwB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAW9C,SAAS,MAAM,CAAC,EACd,QAAQ,EACR,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACI;IACZ,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,eAC1B,SAAS,EACnB,GAAG,EAAE,GAAG,KACJ,KAAK,YAER,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,GACvC,CACR,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export type RenderSeparator = (details: {
3
+ index: number;
4
+ orientation: SeparatorOrientation;
5
+ }) => React.ReactNode;
6
+ type SeparatorOrientation = 'horizontal' | 'vertical';
7
+ /**
8
+ * Puts a separator between each two children: a decorative `Separator` for
9
+ * `true`, or what a function returns.
10
+ */
11
+ export declare function separate(children: React.ReactNode, orientation: SeparatorOrientation, separator: boolean | RenderSeparator | undefined): string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element[] | null | undefined;
12
+ export {};
13
+ //# sourceMappingURL=separate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separate.d.ts","sourceRoot":"","sources":["../../../src/components/_internal/separate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,oBAAoB,CAAC;CACnC,KAAK,KAAK,CAAC,SAAS,CAAC;AAEtB,KAAK,oBAAoB,GAAG,YAAY,GAAG,UAAU,CAAC;AAMtD;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,WAAW,EAAE,oBAAoB,EACjC,SAAS,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS,8WAejD"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Separator } from '../Separator.js';
4
+ const renderSeparator = ({ orientation }) => (_jsx(Separator, { "aria-hidden": true, orientation: orientation }));
5
+ /**
6
+ * Puts a separator between each two children: a decorative `Separator` for
7
+ * `true`, or what a function returns.
8
+ */
9
+ export function separate(children, orientation, separator) {
10
+ if (!separator)
11
+ return children;
12
+ const render = separator === true ? renderSeparator : separator;
13
+ // `toArray` drops empty children; `map` then keys each fragment by its child.
14
+ return React.Children.map(React.Children.toArray(children), (child, index) => (_jsxs(React.Fragment, { children: [index > 0 && render({ index: index - 1, orientation }), child] })));
15
+ }
16
+ //# sourceMappingURL=separate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"separate.js","sourceRoot":"","sources":["../../../src/components/_internal/separate.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AASzC,MAAM,eAAe,GAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAC5D,KAAC,SAAS,yBAAa,WAAW,EAAE,WAAW,GAAI,CACpD,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,QAAQ,CACtB,QAAyB,EACzB,WAAiC,EACjC,SAAgD;IAEhD,IAAI,CAAC,SAAS;QAAE,OAAO,QAAQ,CAAC;IAChC,MAAM,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;IAEhE,8EAA8E;IAC9E,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CACvB,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAChC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAChB,MAAC,KAAK,CAAC,QAAQ,eACZ,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,EACtD,KAAK,IACS,CAClB,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickle-ui/react",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.13",
4
4
  "type": "module",
5
5
  "description": "React component library built with Base UI, shadcn/ui, Tailwind CSS, and reui.",
6
6
  "main": "dist/index.js",
@@ -130,7 +130,7 @@ function AlertDialogMatrixCell({ column, row }: ComponentMatrixCellProps) {
130
130
  <AlertDialog>
131
131
  <AlertDialog.Trigger
132
132
  render={
133
- <Button variant={destructive ? 'destructive-outline' : 'outline'} />
133
+ <Button variant={destructive ? 'outline-destructive' : 'outline'} />
134
134
  }
135
135
  >
136
136
  {content.trigger}
@@ -44,10 +44,12 @@ const VARIANT_ROWS: {
44
44
  }[] = [
45
45
  { key: 'default', label: 'Default' },
46
46
  { key: 'secondary', label: 'Secondary' },
47
+ { key: 'secondary-destructive', label: 'Secondary destructive' },
47
48
  { key: 'destructive', label: 'Destructive' },
48
- { key: 'destructive-outline', label: 'Destructive outline' },
49
49
  { key: 'outline', label: 'Outline' },
50
+ { key: 'outline-destructive', label: 'Outline destructive' },
50
51
  { key: 'ghost', label: 'Ghost' },
52
+ { key: 'ghost-destructive', label: 'Ghost destructive' },
51
53
  { key: 'link', label: 'Link' },
52
54
  ];
53
55
 
@@ -33,15 +33,19 @@ const buttonVariants = cva(
33
33
  'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 data-pressed:bg-primary/90 *:data-[slot=button-loading-indicator]:text-primary-foreground [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',
34
34
  destructive:
35
35
  'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-destructive-foreground shadow-destructive/24 shadow-xs hover:bg-destructive/90 data-pressed:bg-destructive/90 *:data-[slot=button-loading-indicator]:text-destructive-foreground [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',
36
- 'destructive-outline':
37
- 'border-input bg-popover not-dark:bg-clip-padding text-destructive-subtle-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:border-destructive/32 hover:bg-destructive/4 data-pressed:border-destructive/32 data-pressed:bg-destructive/4 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none',
38
36
  ghost:
39
37
  'border-transparent text-foreground hover:bg-accent data-pressed:bg-accent *:data-[slot=button-loading-indicator]:text-foreground',
38
+ 'ghost-destructive':
39
+ 'border-transparent text-destructive-subtle-foreground hover:bg-accent data-pressed:bg-accent *:data-[slot=button-loading-indicator]:text-destructive-subtle-foreground',
40
40
  link: 'border-transparent text-foreground underline-offset-4 hover:underline data-pressed:underline *:data-[slot=button-loading-indicator]:text-foreground',
41
41
  outline:
42
42
  'border-input bg-popover not-dark:bg-clip-padding text-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:bg-accent/50 data-pressed:bg-accent/50 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:data-pressed:bg-input/64 dark:hover:bg-input/64 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none',
43
+ 'outline-destructive':
44
+ 'border-input bg-popover not-dark:bg-clip-padding text-destructive-subtle-foreground shadow-xs/5 not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] hover:border-destructive/32 hover:bg-destructive/4 data-pressed:border-destructive/32 data-pressed:bg-destructive/4 *:data-[slot=button-loading-indicator]:text-foreground dark:bg-input/32 dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/2%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] [:disabled,:active,[data-pressed]]:shadow-none',
43
45
  secondary:
44
46
  'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90 *:data-[slot=button-loading-indicator]:text-secondary-foreground [:active,[data-pressed]]:bg-secondary/80',
47
+ 'secondary-destructive':
48
+ 'border-transparent bg-destructive-subtle text-destructive-subtle-foreground hover:bg-destructive-subtle/90 data-pressed:bg-destructive-subtle/90 *:data-[slot=button-loading-indicator]:text-destructive-subtle-foreground [:active,[data-pressed]]:bg-destructive-subtle/80',
45
49
  },
46
50
  },
47
51
  },
@@ -53,6 +53,14 @@ export const All: StoryDefinition = {
53
53
  </XStack>
54
54
  </Story.Section>
55
55
 
56
+ <Story.Section title="Separators">
57
+ <XStack gap={3} separator>
58
+ <Item>Groceries</Item>
59
+ <Item>Chores</Item>
60
+ <Item>Calendar</Item>
61
+ </XStack>
62
+ </Story.Section>
63
+
56
64
  <Story.Section title="Responsive override">
57
65
  <XStack className="max-sm:flex-col" gap={3}>
58
66
  <Item>Horizontal by default</Item>
@@ -30,4 +30,117 @@ describe('XStack', () => {
30
30
  expect(element.tagName.toLowerCase()).toBe('nav');
31
31
  expect(element).toHaveClass('max-md:flex-col');
32
32
  });
33
+
34
+ describe('separator', () => {
35
+ const separators = (container: HTMLElement) =>
36
+ container.querySelectorAll('[data-slot="separator"]');
37
+
38
+ it('renders no separator by default', () => {
39
+ const { container } = render(
40
+ <XStack>
41
+ <span>A</span>
42
+ <span>B</span>
43
+ </XStack>,
44
+ );
45
+
46
+ expect(separators(container)).toHaveLength(0);
47
+ });
48
+
49
+ it('renders a separator between each two children', () => {
50
+ const { container } = render(
51
+ <XStack separator>
52
+ <span>A</span>
53
+ <span>B</span>
54
+ <span>C</span>
55
+ </XStack>,
56
+ );
57
+
58
+ const stack = container.firstElementChild!;
59
+ expect(
60
+ [...stack.children].map(
61
+ (child) => child.getAttribute('data-slot') ?? child.textContent,
62
+ ),
63
+ ).toEqual(['A', 'separator', 'B', 'separator', 'C']);
64
+ });
65
+
66
+ it('renders no separator around a single child', () => {
67
+ const { container } = render(
68
+ <XStack separator>
69
+ <span>A</span>
70
+ </XStack>,
71
+ );
72
+
73
+ expect(separators(container)).toHaveLength(0);
74
+ });
75
+
76
+ it('skips falsy children', () => {
77
+ const { container } = render(
78
+ <XStack separator>
79
+ {null}
80
+ <span>A</span>
81
+ {false}
82
+ {undefined}
83
+ <span>B</span>
84
+ {null}
85
+ </XStack>,
86
+ );
87
+
88
+ expect(separators(container)).toHaveLength(1);
89
+ });
90
+
91
+ it('hides the separators from assistive technology', () => {
92
+ render(
93
+ <XStack role="list" separator>
94
+ <span role="listitem">A</span>
95
+ <span role="listitem">B</span>
96
+ </XStack>,
97
+ );
98
+
99
+ expect(screen.queryAllByRole('separator')).toHaveLength(0);
100
+ expect(
101
+ screen.getAllByRole('separator', { hidden: true })[0],
102
+ ).toHaveAttribute('aria-hidden', 'true');
103
+ expect(screen.getByRole('list').children).toHaveLength(3);
104
+ });
105
+
106
+ it('renders vertical separators', () => {
107
+ const { container } = render(
108
+ <XStack separator>
109
+ <span>A</span>
110
+ <span>B</span>
111
+ </XStack>,
112
+ );
113
+
114
+ expect(separators(container)[0]).toHaveAttribute(
115
+ 'data-orientation',
116
+ 'vertical',
117
+ );
118
+ });
119
+
120
+ it('renders the node a separator function returns', () => {
121
+ const { container } = render(
122
+ <XStack
123
+ separator={({ index, orientation }) => (
124
+ <hr data-orientation={orientation} data-testid={`rule-${index}`} />
125
+ )}
126
+ >
127
+ <span>A</span>
128
+ <span>B</span>
129
+ <span>C</span>
130
+ </XStack>,
131
+ );
132
+
133
+ const stack = container.firstElementChild!;
134
+ expect(
135
+ [...stack.children].map(
136
+ (child) => child.getAttribute('data-testid') ?? child.textContent,
137
+ ),
138
+ ).toEqual(['A', 'rule-0', 'B', 'rule-1', 'C']);
139
+ expect(screen.getByTestId('rule-0')).toHaveAttribute(
140
+ 'data-orientation',
141
+ 'vertical',
142
+ );
143
+ expect(separators(container)).toHaveLength(0);
144
+ });
145
+ });
33
146
  });
@@ -1,16 +1,32 @@
1
1
  import { cn } from '../lib/utils';
2
+ import { type RenderSeparator, separate } from './_internal/separate';
2
3
  import { Flex, type FlexProps } from './Flex';
3
4
 
4
- type XStackProps = Omit<FlexProps, 'direction'>;
5
+ type XStackProps = Omit<FlexProps, 'direction'> & {
6
+ /**
7
+ * Renders a separator between each two children: a decorative `Separator`
8
+ * for `true`, or what a function returns, given the separator's index and
9
+ * its orientation. Give a decorative node `aria-hidden`.
10
+ */
11
+ separator?: boolean | RenderSeparator;
12
+ };
5
13
 
6
- function XStack({ className, ref, ...props }: XStackProps) {
14
+ function XStack({
15
+ children,
16
+ className,
17
+ ref,
18
+ separator,
19
+ ...props
20
+ }: XStackProps) {
7
21
  return (
8
22
  <Flex
9
23
  className={cn('flex-row', className)}
10
24
  data-slot="x-stack"
11
25
  ref={ref}
12
26
  {...props}
13
- />
27
+ >
28
+ {separate(children, 'vertical', separator)}
29
+ </Flex>
14
30
  );
15
31
  }
16
32
 
@@ -1,6 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
 
3
3
  import { Story } from './_internal/Story';
4
+ import { Separator } from './Separator';
4
5
  import { Text } from './Text';
5
6
  import { YStack } from './YStack';
6
7
 
@@ -54,6 +55,31 @@ export const All: StoryDefinition = {
54
55
  </YStack>
55
56
  </Story.Section>
56
57
 
58
+ <Story.Section title="Separators">
59
+ <YStack gap={3} separator>
60
+ <Item>Groceries</Item>
61
+ <Item>Chores</Item>
62
+ <Item>Calendar</Item>
63
+ </YStack>
64
+ </Story.Section>
65
+
66
+ <Story.Section title="Custom separators">
67
+ <YStack
68
+ gap={3}
69
+ separator={({ orientation }) => (
70
+ <Separator
71
+ aria-hidden
72
+ className="bg-primary"
73
+ orientation={orientation}
74
+ />
75
+ )}
76
+ >
77
+ <Item>Groceries</Item>
78
+ <Item>Chores</Item>
79
+ <Item>Calendar</Item>
80
+ </YStack>
81
+ </Story.Section>
82
+
57
83
  <Story.Section title="Responsive override">
58
84
  <YStack className="md:flex-row" gap={3}>
59
85
  <Item>Vertical by default</Item>
@@ -28,4 +28,19 @@ describe('YStack', () => {
28
28
  expect(element).toHaveClass('flex-row', 'custom-class');
29
29
  expect(element).not.toHaveClass('flex-col');
30
30
  });
31
+
32
+ it('renders horizontal separators between its children', () => {
33
+ const { container } = render(
34
+ <YStack separator>
35
+ <span>A</span>
36
+ <span>B</span>
37
+ <span>C</span>
38
+ </YStack>,
39
+ );
40
+
41
+ const separators = container.querySelectorAll('[data-slot="separator"]');
42
+ expect(separators).toHaveLength(2);
43
+ expect(separators[0]).toHaveAttribute('data-orientation', 'horizontal');
44
+ expect(separators[0]).toHaveAttribute('aria-hidden', 'true');
45
+ });
31
46
  });
@@ -1,16 +1,32 @@
1
1
  import { cn } from '../lib/utils';
2
+ import { type RenderSeparator, separate } from './_internal/separate';
2
3
  import { Flex, type FlexProps } from './Flex';
3
4
 
4
- type YStackProps = Omit<FlexProps, 'direction'>;
5
+ type YStackProps = Omit<FlexProps, 'direction'> & {
6
+ /**
7
+ * Renders a separator between each two children: a decorative `Separator`
8
+ * for `true`, or what a function returns, given the separator's index and
9
+ * its orientation. Give a decorative node `aria-hidden`.
10
+ */
11
+ separator?: boolean | RenderSeparator;
12
+ };
5
13
 
6
- function YStack({ className, ref, ...props }: YStackProps) {
14
+ function YStack({
15
+ children,
16
+ className,
17
+ ref,
18
+ separator,
19
+ ...props
20
+ }: YStackProps) {
7
21
  return (
8
22
  <Flex
9
23
  className={cn('flex-col', className)}
10
24
  data-slot="y-stack"
11
25
  ref={ref}
12
26
  {...props}
13
- />
27
+ >
28
+ {separate(children, 'horizontal', separator)}
29
+ </Flex>
14
30
  );
15
31
  }
16
32
 
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+
3
+ import { Separator } from '../Separator';
4
+
5
+ export type RenderSeparator = (details: {
6
+ index: number;
7
+ orientation: SeparatorOrientation;
8
+ }) => React.ReactNode;
9
+
10
+ type SeparatorOrientation = 'horizontal' | 'vertical';
11
+
12
+ const renderSeparator: RenderSeparator = ({ orientation }) => (
13
+ <Separator aria-hidden orientation={orientation} />
14
+ );
15
+
16
+ /**
17
+ * Puts a separator between each two children: a decorative `Separator` for
18
+ * `true`, or what a function returns.
19
+ */
20
+ export function separate(
21
+ children: React.ReactNode,
22
+ orientation: SeparatorOrientation,
23
+ separator: boolean | RenderSeparator | undefined,
24
+ ) {
25
+ if (!separator) return children;
26
+ const render = separator === true ? renderSeparator : separator;
27
+
28
+ // `toArray` drops empty children; `map` then keys each fragment by its child.
29
+ return React.Children.map(
30
+ React.Children.toArray(children),
31
+ (child, index) => (
32
+ <React.Fragment>
33
+ {index > 0 && render({ index: index - 1, orientation })}
34
+ {child}
35
+ </React.Fragment>
36
+ ),
37
+ );
38
+ }