@central-ui/react 0.3.0 → 0.5.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 (75) hide show
  1. package/dist/components/accordion/index.d.ts +14 -14
  2. package/dist/components/accordion/index.js +19 -19
  3. package/dist/components/autocomplete/index.d.ts +51 -47
  4. package/dist/components/autocomplete/index.js +57 -57
  5. package/dist/components/avatar/index.d.ts +7 -6
  6. package/dist/components/avatar/index.js +9 -9
  7. package/dist/components/banner/index.js +1 -1
  8. package/dist/components/carousel/index.d.ts +31 -11
  9. package/dist/components/carousel/index.js +25 -21
  10. package/dist/components/checkbox/index.d.ts +12 -11
  11. package/dist/components/checkbox/index.js +21 -21
  12. package/dist/components/combobox/index.d.ts +56 -56
  13. package/dist/components/combobox/index.js +67 -68
  14. package/dist/components/datepicker/index.d.ts +8 -9
  15. package/dist/components/datepicker/index.js +13 -13
  16. package/dist/components/dialog/index.d.ts +18 -18
  17. package/dist/components/dialog/index.js +22 -21
  18. package/dist/components/drawer/index.d.ts +24 -24
  19. package/dist/components/drawer/index.js +28 -27
  20. package/dist/components/exception/index.d.ts +23 -11
  21. package/dist/components/exception/index.js +17 -17
  22. package/dist/components/fileupload/index.d.ts +8 -8
  23. package/dist/components/input/index.d.ts +14 -14
  24. package/dist/components/input/index.js +27 -27
  25. package/dist/components/menu/index.d.ts +37 -37
  26. package/dist/components/menu/index.js +47 -47
  27. package/dist/components/numberinput/index.d.ts +22 -22
  28. package/dist/components/numberinput/index.js +35 -35
  29. package/dist/components/otpinput/index.d.ts +12 -12
  30. package/dist/components/otpinput/index.js +21 -21
  31. package/dist/components/pagination/index.d.ts +158 -0
  32. package/dist/components/pagination/index.js +157 -0
  33. package/dist/components/passwordinput/index.d.ts +15 -15
  34. package/dist/components/passwordinput/index.js +27 -27
  35. package/dist/components/popover/index.d.ts +16 -16
  36. package/dist/components/popover/index.js +20 -19
  37. package/dist/components/radio/index.d.ts +12 -12
  38. package/dist/components/radio/index.js +25 -25
  39. package/dist/components/ratinginput/index.d.ts +1 -1
  40. package/dist/components/ratinginput/index.js +3 -3
  41. package/dist/components/select/index.d.ts +29 -29
  42. package/dist/components/select/index.js +33 -33
  43. package/dist/components/slider/index.d.ts +20 -20
  44. package/dist/components/slider/index.js +27 -27
  45. package/dist/components/stepper/index.d.ts +135 -44
  46. package/dist/components/stepper/index.js +185 -62
  47. package/dist/components/switch/index.d.ts +9 -9
  48. package/dist/components/switch/index.js +17 -17
  49. package/dist/components/table/index.d.ts +2 -2
  50. package/dist/components/table/index.js +16 -16
  51. package/dist/components/tabs/index.d.ts +10 -10
  52. package/dist/components/tabs/index.js +11 -11
  53. package/dist/components/textarea/index.d.ts +13 -13
  54. package/dist/components/textarea/index.js +25 -25
  55. package/dist/components/toast/index.d.ts +11 -11
  56. package/dist/components/toast/index.js +11 -11
  57. package/dist/components/toggle/index.d.ts +7 -7
  58. package/dist/components/toggle/index.js +9 -9
  59. package/dist/components/tooltip/index.d.ts +6 -6
  60. package/dist/components/tooltip/index.js +6 -7
  61. package/dist/components/tour/index.d.ts +2 -2
  62. package/dist/components/tour/index.js +5 -4
  63. package/dist/index.d.ts +1 -0
  64. package/dist/index.js +1 -0
  65. package/dist/utils/icons.d.ts +104 -23
  66. package/dist/utils/icons.js +16 -3
  67. package/package.json +69 -69
  68. package/src/presets/shopify-polaris/shopify-polaris-accordion.css +28 -28
  69. package/src/presets/shopify-polaris/shopify-polaris-pagination.css +55 -0
  70. package/src/presets/shopify-polaris/shopify-polaris-stepper.css +63 -27
  71. package/src/presets/shopify-polaris/shopify-polaris.css +1 -0
  72. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-accordion.css +28 -28
  73. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-pagination.css +49 -0
  74. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-stepper.css +64 -26
  75. package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy.css +1 -0
@@ -1,7 +1,7 @@
1
1
  import type { StyleProps } from '../../types/Style.ts';
2
2
  import type { AsChildProps } from '../../utils/asChild.ts';
3
3
  import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';
4
- import type { ComponentPropsWithRef } from 'react';
4
+ import type { ComponentProps, ComponentPropsWithRef } from 'react';
5
5
  /**
6
6
  * OpenButton renders its own trigger button; pass asChild to make your own target element the trigger instead. Keep Popup in the same Root. Popup already includes its portal and positioner. PopupText supplies the help text; Arrow is optional.
7
7
  *
@@ -30,13 +30,13 @@ import type { ComponentPropsWithRef } from 'react';
30
30
  */
31
31
  export declare function Root<Payload = unknown>(props: BaseTooltip.Root.Props<Payload>): import("react").JSX.Element;
32
32
  /** Opens the tooltip on hover or focus. Pass asChild to give this behavior to your own element, like your app's Button. */
33
- export declare const OpenButton: import("react").ForwardRefExoticComponent<Omit<Omit<BaseTooltip.Trigger.Props<unknown>, "className" | "render"> & {
33
+ export declare function OpenButton({ asChild, disableStyle, children, ref, ...props }: Omit<BaseTooltip.Trigger.Props, 'className' | 'render'> & {
34
34
  className?: string;
35
- } & AsChildProps & StyleProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
36
- export type PopupProps = Omit<ComponentPropsWithRef<typeof BaseTooltip.Popup>, 'className'> & {
35
+ } & AsChildProps & StyleProps): import("react").JSX.Element;
36
+ export type PopupProps = Omit<ComponentPropsWithRef<typeof BaseTooltip.Popup>, 'className' | 'render'> & {
37
37
  className?: string;
38
38
  } & Pick<BaseTooltip.Portal.Props, 'container' | 'keepMounted'> & Pick<BaseTooltip.Positioner.Props, 'anchor' | 'positionMethod' | 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'arrowPadding' | 'disableAnchorTracking' | 'collisionAvoidance'> & StyleProps;
39
39
  /** Already includes the portal and positioner. Keep it in the matching Root and let the native open state control visibility. */
40
40
  export declare function Popup({ disableStyle, container, keepMounted, anchor, positionMethod, side, sideOffset, align, alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, style, ...props }: PopupProps): import("react").JSX.Element;
41
- export declare const PopupText: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & StyleProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
42
- export declare const Arrow: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").SVGProps<SVGSVGElement>, "children" | "dangerouslySetInnerHTML"> & StyleProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
41
+ export declare function PopupText({ disableStyle, className, ref, ...props }: ComponentProps<'span'> & StyleProps): import("react").JSX.Element;
42
+ export declare function Arrow({ disableStyle, className, style, ref, ...props }: Omit<ComponentProps<'svg'>, 'children' | 'dangerouslySetInnerHTML'> & StyleProps): import("react").JSX.Element;
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { asChildRendering } from "../../utils/asChild.js";
3
3
  import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';
4
- import { forwardRef } from 'react';
5
4
  /**
6
5
  * OpenButton renders its own trigger button; pass asChild to make your own target element the trigger instead. Keep Popup in the same Root. Popup already includes its portal and positioner. PopupText supplies the help text; Arrow is optional.
7
6
  *
@@ -32,10 +31,10 @@ export function Root(props) {
32
31
  return _jsx(BaseTooltip.Root, { ...props });
33
32
  }
34
33
  /** Opens the tooltip on hover or focus. Pass asChild to give this behavior to your own element, like your app's Button. */
35
- export const OpenButton = /* @__PURE__ */ forwardRef(function OpenButton({ asChild, disableStyle, children, ...props }, ref) {
34
+ export function OpenButton({ asChild, disableStyle, children, ref, ...props }) {
36
35
  const rendering = asChildRendering({ asChild, children, component: 'tooltip-openbutton', disableStyle });
37
36
  return _jsx(BaseTooltip.Trigger, { ...props, ref: ref, ...rendering });
38
- });
37
+ }
39
38
  /** Already includes the portal and positioner. Keep it in the matching Root and let the native open state control visibility. */
40
39
  export function Popup({ disableStyle, container, keepMounted, anchor, positionMethod, side = 'top', sideOffset = 8, align = 'start', alignOffset, collisionBoundary, collisionPadding, sticky, arrowPadding, disableAnchorTracking, collisionAvoidance, className, style, ...props }) {
41
40
  const baseStyle = {
@@ -46,9 +45,9 @@ export function Popup({ disableStyle, container, keepMounted, anchor, positionMe
46
45
  ? (state) => ({ ...baseStyle, ...style(state) })
47
46
  : { ...baseStyle, ...style } }) }) }));
48
47
  }
49
- export const PopupText = /* @__PURE__ */ forwardRef(function PopupText({ disableStyle, className, ...props }, ref) {
48
+ export function PopupText({ disableStyle, className, ref, ...props }) {
50
49
  return (_jsx("span", { ...props, ref: ref, "data-component": "tooltip-popuptext", "data-style-disabled": disableStyle ? '' : undefined, className: className }));
51
- });
52
- export const Arrow = /* @__PURE__ */ forwardRef(function Arrow({ disableStyle, className, style, ...props }, ref) {
50
+ }
51
+ export function Arrow({ disableStyle, className, style, ref, ...props }) {
53
52
  return (_jsxs(BaseTooltip.Arrow, { style: style, render: _jsx("svg", { ...props, ref: ref, "aria-hidden": true, width: "20", height: "10", viewBox: "0 0 20 10" }), "data-component": "tooltip-arrow", "data-style-disabled": disableStyle ? '' : undefined, className: className, children: [_jsx("path", { d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z", "data-component": "tooltip-arrow-1" }), _jsx("path", { d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z", "data-component": "tooltip-arrow-2" }), _jsx("path", { d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z", "data-component": "tooltip-arrow-3" })] }));
54
- });
53
+ }
@@ -38,7 +38,7 @@ import type { ComponentProps, ReactElement, ReactNode, SVGProps } from 'react';
38
38
  * <Tour.Description>Narrow the results.</Tour.Description>
39
39
  * </Tour.Content>
40
40
  * <Tour.Progress />
41
- * <Tour.BackButton>Back</Tour.BackButton>
41
+ * <Tour.PreviousButton>Back</Tour.PreviousButton>
42
42
  * <Tour.NextButton>Next</Tour.NextButton>
43
43
  * <Tour.DoneButton>Done</Tour.DoneButton>
44
44
  * </Tour.Popup>
@@ -133,7 +133,7 @@ export declare function Progress({ disableStyle, className, children, ...props }
133
133
  }): import("react").JSX.Element;
134
134
  type ButtonProps = ComponentProps<'button'> & AsChildProps & StyleProps;
135
135
  /** Goes back one step, styled like a secondary Button. Not rendered on the first step, where there's nothing to go back to. Pass asChild to give this behavior to your own button instead. */
136
- export declare function BackButton(props: ButtonProps): import("react").JSX.Element | null;
136
+ export declare function PreviousButton(props: ButtonProps): import("react").JSX.Element | null;
137
137
  /** Goes to the next step, styled like a primary Button. Not rendered on the last step; DoneButton takes its place there. Pass asChild to give this behavior to your own button instead. */
138
138
  export declare function NextButton(props: ButtonProps): import("react").JSX.Element | null;
139
139
  /** Finishes the tour, styled like a primary Button. Rendered only on the last step, in NextButton's place. Pass asChild to give this behavior to your own button instead. */
@@ -40,7 +40,7 @@ import { twMerge } from 'tailwind-merge';
40
40
  * <Tour.Description>Narrow the results.</Tour.Description>
41
41
  * </Tour.Content>
42
42
  * <Tour.Progress />
43
- * <Tour.BackButton>Back</Tour.BackButton>
43
+ * <Tour.PreviousButton>Back</Tour.PreviousButton>
44
44
  * <Tour.NextButton>Next</Tour.NextButton>
45
45
  * <Tour.DoneButton>Done</Tour.DoneButton>
46
46
  * </Tour.Popup>
@@ -230,11 +230,11 @@ function TourButton({ asChild, joyrideProps, part, defaultClassName, disableStyl
230
230
  return (_jsx("button", { type: "button", ...behaviorProps, ...asChildStyleAttributes({ asChild, component: `tour-${part}`, disableStyle }), className: twMerge(!disableStyle && defaultClassName, className), children: children }));
231
231
  }
232
232
  /** Goes back one step, styled like a secondary Button. Not rendered on the first step, where there's nothing to go back to. Pass asChild to give this behavior to your own button instead. */
233
- export function BackButton(props) {
234
- const step = useStep('BackButton');
233
+ export function PreviousButton(props) {
234
+ const step = useStep('PreviousButton');
235
235
  if (step.joyride.index === 0)
236
236
  return null;
237
- return (_jsx(TourButton, { ...props, joyrideProps: step.joyride.backProps, part: "backbutton", defaultClassName: `${buttonBase} ${secondaryButton}` }));
237
+ return (_jsx(TourButton, { ...props, joyrideProps: step.joyride.backProps, part: "previousbutton", defaultClassName: `${buttonBase} ${secondaryButton}` }));
238
238
  }
239
239
  /** Goes to the next step, styled like a primary Button. Not rendered on the last step; DoneButton takes its place there. Pass asChild to give this behavior to your own button instead. */
240
240
  export function NextButton(props) {
@@ -276,5 +276,6 @@ export function CloseButtonIcon({ disableStyle, children, className, ...props })
276
276
  'data-style-disabled': disableStyle ? '' : undefined,
277
277
  },
278
278
  className: twMerge(!disableStyle && 'h-4 w-fit shrink-0 text-inherit', children?.props.className, className),
279
+ strokeWidth: props.strokeWidth ?? children?.props.strokeWidth ?? 2,
279
280
  });
280
281
  }
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * as FileUpload from './components/fileupload/index.tsx';
11
11
  export * as Input from './components/input/index.tsx';
12
12
  export * as Menu from './components/menu/index.tsx';
13
13
  export * as NumberInput from './components/numberinput/index.tsx';
14
+ export * as Pagination from './components/pagination/index.tsx';
14
15
  export * as PasswordInput from './components/passwordinput/index.tsx';
15
16
  export * as OtpInput from './components/otpinput/index.tsx';
16
17
  export * as Popover from './components/popover/index.tsx';
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ export * as FileUpload from "./components/fileupload/index.js";
11
11
  export * as Input from "./components/input/index.js";
12
12
  export * as Menu from "./components/menu/index.js";
13
13
  export * as NumberInput from "./components/numberinput/index.js";
14
+ export * as Pagination from "./components/pagination/index.js";
14
15
  export * as PasswordInput from "./components/passwordinput/index.js";
15
16
  export * as OtpInput from "./components/otpinput/index.js";
16
17
  export * as Popover from "./components/popover/index.js";
@@ -1,24 +1,105 @@
1
1
  import type { SVGIconProps } from '../types/Icon.ts';
2
- export declare const ArrowLeft: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
3
- export declare const CalendarDays: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
4
- export declare const Check: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
5
- export declare const ChevronDown: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
6
- export declare const ChevronLeft: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
7
- export declare const ChevronRight: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
8
- export declare const ChevronUp: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
9
- export declare const ChevronsUpDown: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
10
- export declare const CircleAlert: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
11
- export declare const CircleCheck: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
12
- export declare const Eye: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
13
- export declare const EyeOff: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
14
- export declare const File: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
15
- export declare const FolderOpen: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
16
- export declare const GripVertical: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
17
- export declare const Info: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
18
- export declare const LoaderCircle: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
19
- export declare const Minus: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
20
- export declare const Star: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
21
- export declare const Text: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
22
- export declare const TriangleAlert: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
23
- export declare const Upload: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
24
- export declare const X: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
2
+ export declare const ArrowLeft: {
3
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export declare const CalendarDays: {
7
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export declare const Check: {
11
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ export declare const ChevronDown: {
15
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
16
+ displayName: string;
17
+ };
18
+ export declare const ChevronFirst: {
19
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
20
+ displayName: string;
21
+ };
22
+ export declare const ChevronLast: {
23
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
24
+ displayName: string;
25
+ };
26
+ export declare const ChevronLeft: {
27
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
28
+ displayName: string;
29
+ };
30
+ export declare const ChevronRight: {
31
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
32
+ displayName: string;
33
+ };
34
+ export declare const ChevronUp: {
35
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
36
+ displayName: string;
37
+ };
38
+ export declare const ChevronsUpDown: {
39
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
40
+ displayName: string;
41
+ };
42
+ export declare const CircleAlert: {
43
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
44
+ displayName: string;
45
+ };
46
+ export declare const CircleCheck: {
47
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
48
+ displayName: string;
49
+ };
50
+ export declare const Ellipsis: {
51
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
52
+ displayName: string;
53
+ };
54
+ export declare const Eye: {
55
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
56
+ displayName: string;
57
+ };
58
+ export declare const EyeOff: {
59
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
60
+ displayName: string;
61
+ };
62
+ export declare const File: {
63
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
64
+ displayName: string;
65
+ };
66
+ export declare const FolderOpen: {
67
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
68
+ displayName: string;
69
+ };
70
+ export declare const GripVertical: {
71
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
72
+ displayName: string;
73
+ };
74
+ export declare const Info: {
75
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
76
+ displayName: string;
77
+ };
78
+ export declare const LoaderCircle: {
79
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
80
+ displayName: string;
81
+ };
82
+ export declare const Minus: {
83
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
84
+ displayName: string;
85
+ };
86
+ export declare const Star: {
87
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
88
+ displayName: string;
89
+ };
90
+ export declare const Text: {
91
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
92
+ displayName: string;
93
+ };
94
+ export declare const TriangleAlert: {
95
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
96
+ displayName: string;
97
+ };
98
+ export declare const Upload: {
99
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
100
+ displayName: string;
101
+ };
102
+ export declare const X: {
103
+ ({ size, width, height, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }: SVGIconProps): import("react").JSX.Element;
104
+ displayName: string;
105
+ };
@@ -1,8 +1,8 @@
1
1
  import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createElement, forwardRef } from 'react';
2
+ import { createElement } from 'react';
3
3
  /** Builds a Lucide-compatible icon from its SVG elements, so the package ships only the icons it uses instead of the whole lucide-react catalog. Icon shapes are copied from lucide-react v1.57.0 (ISC license, https://lucide.dev). */
4
4
  function createIcon(name, iconNode) {
5
- const Icon = forwardRef(function Icon({ size = 24, width, height, color = 'currentColor', strokeWidth = 2, absoluteStrokeWidth, nonScalingStroke, className, children, ...props }, ref) {
5
+ function Icon({ size = 24, width, height, color = 'currentColor', strokeWidth = 2, absoluteStrokeWidth, nonScalingStroke, className, children, ref, ...props }) {
6
6
  // Keeping the stroke the same visual thickness at any size, when asked
7
7
  const iconStrokeWidth = absoluteStrokeWidth
8
8
  ? (Number(strokeWidth) * 24) / Number(width ?? size)
@@ -17,7 +17,7 @@ function createIcon(name, iconNode) {
17
17
  vectorEffect: nonScalingStroke ? 'non-scaling-stroke' : undefined,
18
18
  ...attributes,
19
19
  })), children] }));
20
- });
20
+ }
21
21
  Icon.displayName = name.replace(/(^|-)(\w)/g, (_match, _dash, letter) => letter.toUpperCase());
22
22
  return Icon;
23
23
  }
@@ -43,6 +43,14 @@ export const Check = /* @__PURE__ */ createIcon('check', [
43
43
  export const ChevronDown = /* @__PURE__ */ createIcon('chevron-down', [
44
44
  ['path', { d: 'm6 9 6 6 6-6' }],
45
45
  ]);
46
+ export const ChevronFirst = /* @__PURE__ */ createIcon('chevron-first', [
47
+ ['path', { d: 'm17 18-6-6 6-6' }],
48
+ ['path', { d: 'M7 6v12' }],
49
+ ]);
50
+ export const ChevronLast = /* @__PURE__ */ createIcon('chevron-last', [
51
+ ['path', { d: 'm7 18 6-6-6-6' }],
52
+ ['path', { d: 'M17 6v12' }],
53
+ ]);
46
54
  export const ChevronLeft = /* @__PURE__ */ createIcon('chevron-left', [
47
55
  ['path', { d: 'm15 18-6-6 6-6' }],
48
56
  ]);
@@ -65,6 +73,11 @@ export const CircleCheck = /* @__PURE__ */ createIcon('circle-check', [
65
73
  ['circle', { cx: '12', cy: '12', r: '10' }],
66
74
  ['path', { d: 'm16 9-5.5 5.5L8 12' }],
67
75
  ]);
76
+ export const Ellipsis = /* @__PURE__ */ createIcon('ellipsis', [
77
+ ['circle', { cx: '12', cy: '12', r: '1' }],
78
+ ['circle', { cx: '19', cy: '12', r: '1' }],
79
+ ['circle', { cx: '5', cy: '12', r: '1' }],
80
+ ]);
68
81
  export const Eye = /* @__PURE__ */ createIcon('eye', [
69
82
  [
70
83
  'path',
package/package.json CHANGED
@@ -1,69 +1,69 @@
1
- {
2
- "name": "@central-ui/react",
3
- "version": "0.3.0",
4
- "description": "Accessible React components with optional Tailwind CSS style presets",
5
- "license": "MIT",
6
- "keywords": [
7
- "react",
8
- "ui",
9
- "components",
10
- "ark-ui",
11
- "unstyled"
12
- ],
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
- "type": "module",
17
- "sideEffects": [
18
- "./src/presets/**/*.css"
19
- ],
20
- "files": [
21
- "dist",
22
- "src/presets",
23
- "README.md",
24
- "LICENSE"
25
- ],
26
- "exports": {
27
- ".": {
28
- "types": "./dist/index.d.ts",
29
- "import": "./dist/index.js"
30
- },
31
- "./presets/shopify-polaris-legacy.css": "./src/presets/shopify-polaris-legacy/shopify-polaris-legacy.css",
32
- "./presets/shopify-polaris.css": "./src/presets/shopify-polaris/shopify-polaris.css"
33
- },
34
- "scripts": {
35
- "build": "tsc --project tsconfig.json",
36
- "prepack": "npm run build",
37
- "typecheck": "tsc --project tsconfig.json --noEmit"
38
- },
39
- "peerDependencies": {
40
- "react": "^18.0.0 || ^19.0.0",
41
- "react-dom": "^18.0.0 || ^19.0.0",
42
- "tailwindcss": "^4.2.1"
43
- },
44
- "peerDependenciesMeta": {
45
- "tailwindcss": {
46
- "optional": true
47
- }
48
- },
49
- "devDependencies": {
50
- "@types/react": "19.3.0",
51
- "@types/react-dom": "19.3.0",
52
- "typescript": "6.0.3"
53
- },
54
- "dependencies": {
55
- "@ark-ui/react": "^5.39.3",
56
- "@base-ui/react": "^1.9.0",
57
- "@internationalized/date": "^3.12.4",
58
- "@radix-ui/react-password-toggle-field": "^0.2.1",
59
- "@tanstack/react-virtual": "^3.14.20",
60
- "embla-carousel-autoplay": "8.6.0",
61
- "embla-carousel-react": "8.6.0",
62
- "react-aria": "^3.53.1",
63
- "react-aria-components": "^1.22.1",
64
- "react-joyride": "^3.2.0",
65
- "react-resizable-panels": "^4.14.5",
66
- "recharts": "^3.10.1",
67
- "tailwind-merge": "^3.7.0"
68
- }
69
- }
1
+ {
2
+ "name": "@central-ui/react",
3
+ "version": "0.5.0",
4
+ "description": "Accessible React components with optional Tailwind CSS style presets",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "react",
8
+ "ui",
9
+ "components",
10
+ "ark-ui",
11
+ "unstyled"
12
+ ],
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "type": "module",
17
+ "sideEffects": [
18
+ "./src/presets/**/*.css"
19
+ ],
20
+ "files": [
21
+ "dist",
22
+ "src/presets",
23
+ "README.md",
24
+ "LICENSE"
25
+ ],
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ },
31
+ "./presets/shopify-polaris-legacy.css": "./src/presets/shopify-polaris-legacy/shopify-polaris-legacy.css",
32
+ "./presets/shopify-polaris.css": "./src/presets/shopify-polaris/shopify-polaris.css"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc --project tsconfig.json",
36
+ "prepack": "npm run build",
37
+ "typecheck": "tsc --project tsconfig.json --noEmit"
38
+ },
39
+ "peerDependencies": {
40
+ "react": "^19.0.0",
41
+ "react-dom": "^19.0.0",
42
+ "tailwindcss": "^4.2.1"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "tailwindcss": {
46
+ "optional": true
47
+ }
48
+ },
49
+ "devDependencies": {
50
+ "@types/react": "19.3.0",
51
+ "@types/react-dom": "19.3.0",
52
+ "typescript": "6.0.3"
53
+ },
54
+ "dependencies": {
55
+ "@ark-ui/react": "^5.39.3",
56
+ "@base-ui/react": "^1.9.0",
57
+ "@internationalized/date": "^3.12.4",
58
+ "@radix-ui/react-password-toggle-field": "^0.2.1",
59
+ "@tanstack/react-virtual": "^3.14.20",
60
+ "embla-carousel-autoplay": "8.6.0",
61
+ "embla-carousel-react": "8.6.0",
62
+ "react-aria": "^3.53.1",
63
+ "react-aria-components": "^1.22.1",
64
+ "react-joyride": "^3.2.0",
65
+ "react-resizable-panels": "^4.14.5",
66
+ "recharts": "^3.10.1",
67
+ "tailwind-merge": "^3.7.0"
68
+ }
69
+ }
@@ -1,28 +1,28 @@
1
- /* accordion */
2
- @layer components {
3
- :where(:not([data-style-disabled])) {
4
- &:where([data-component='accordion-list']) {
5
- @apply flex w-full flex-col overflow-hidden rounded-xl border border-neutral-200 bg-white;
6
- }
7
-
8
- &:where([data-component='accordion-item']) {
9
- @apply w-full border-b border-neutral-200 last:border-b-0;
10
- }
11
-
12
- &:where([data-component='accordion-openbutton']) {
13
- @apply flex min-h-10 w-full cursor-pointer items-center justify-between gap-4 bg-white px-3 py-2 text-left text-sm font-medium text-neutral-950 outline-none hover:bg-neutral-50 focus-visible:relative focus-visible:z-1 focus-visible:outline-2 focus-visible:outline-blue-500 disabled:pointer-events-none disabled:bg-neutral-100 disabled:text-neutral-500 disabled:opacity-50;
14
- }
15
-
16
- &:where([data-component='accordion-openertitle']) {
17
- @apply min-w-0 flex-1;
18
- }
19
-
20
- &:where([data-component='accordion-openerindicator']) {
21
- @apply h-4 w-fit shrink-0 text-inherit transition-transform data-panel-open:rotate-180;
22
- }
23
-
24
- &:where([data-component='accordion-content']) {
25
- @apply h-(--accordion-panel-height) overflow-hidden text-sm text-neutral-700 transition-[height] duration-200 data-starting-style:h-0 data-ending-style:h-0;
26
- }
27
- }
28
- }
1
+ /* accordion */
2
+ @layer components {
3
+ :where(:not([data-style-disabled])) {
4
+ &:where([data-component='accordion-list']) {
5
+ @apply flex w-full flex-col overflow-hidden rounded-xl border border-neutral-200 bg-white;
6
+ }
7
+
8
+ &:where([data-component='accordion-item']) {
9
+ @apply w-full border-b border-neutral-200 last:border-b-0;
10
+ }
11
+
12
+ &:where([data-component='accordion-openbutton']) {
13
+ @apply flex min-h-10 w-full cursor-pointer items-center justify-between gap-4 bg-white px-3 py-2 text-left text-sm font-medium text-neutral-950 outline-none hover:bg-neutral-50 focus-visible:relative focus-visible:z-1 focus-visible:outline-2 focus-visible:outline-blue-500 disabled:pointer-events-none disabled:bg-neutral-100 disabled:text-neutral-500 disabled:opacity-50;
14
+ }
15
+
16
+ &:where([data-component='accordion-openbuttontitle']) {
17
+ @apply min-w-0 flex-1;
18
+ }
19
+
20
+ &:where([data-component='accordion-openbuttonicon']) {
21
+ @apply h-4 w-fit shrink-0 text-inherit transition-transform data-panel-open:rotate-180;
22
+ }
23
+
24
+ &:where([data-component='accordion-content']) {
25
+ @apply h-(--accordion-panel-height) overflow-hidden text-sm text-neutral-700 transition-[height] duration-200 data-starting-style:h-0 data-ending-style:h-0;
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,55 @@
1
+ /* pagination */
2
+ @layer components {
3
+ :where(:not([data-style-disabled])) {
4
+ &:where([data-component='pagination-container']),
5
+ &:where([data-component='pagination-pagelist']) {
6
+ @apply flex w-fit items-center gap-1;
7
+ }
8
+
9
+ &:where([data-component='pagination-firstbutton']),
10
+ &:where([data-component='pagination-previousbutton']),
11
+ &:where([data-component='pagination-nextbutton']),
12
+ &:where([data-component='pagination-lastbutton']),
13
+ &:where([data-component='pagination-page'])[data-type='page'] {
14
+ @apply flex h-7 min-w-7 shrink-0 cursor-pointer items-center justify-center rounded-full px-2 text-[0.8rem] font-medium tabular-nums outline-none select-none focus-visible:outline-2 focus-visible:outline-blue-500 enabled:active:scale-97 transition-[background-color,color,transform] duration-400 ease-[cubic-bezier(0.2,0.8,0,1)] motion-reduce:transition-none disabled:pointer-events-none disabled:cursor-default;
15
+
16
+ &:not(:disabled) {
17
+ @apply bg-neutral-200 text-neutral-950 hover:bg-neutral-300 focus-visible:bg-neutral-300 active:bg-neutral-300;
18
+ }
19
+ &:disabled {
20
+ @apply bg-black/3 text-neutral-400;
21
+ }
22
+ &[data-selected] {
23
+ @apply bg-neutral-950 text-white hover:bg-black focus-visible:bg-black active:bg-black;
24
+ }
25
+ }
26
+
27
+ &:where([data-component='pagination-firstbutton']),
28
+ &:where([data-component='pagination-previousbutton']),
29
+ &:where([data-component='pagination-nextbutton']),
30
+ &:where([data-component='pagination-lastbutton']) {
31
+ /* Roomy padding for text; the icon's negative margins below pull an icon-only button back to an exact square */
32
+ @apply gap-2.5 px-3;
33
+ }
34
+
35
+ &:where([data-component='pagination-page'])[data-type='ellipsis'] {
36
+ @apply flex h-7 min-w-7 shrink-0 items-center justify-center text-neutral-500;
37
+ }
38
+
39
+ &:where([data-component='pagination-firstbuttonicon']),
40
+ &:where([data-component='pagination-previousbuttonicon']),
41
+ &:where([data-component='pagination-nextbuttonicon']),
42
+ &:where([data-component='pagination-lastbuttonicon']),
43
+ &:where([data-component='pagination-pageicon']) {
44
+ @apply h-4 w-fit shrink-0;
45
+ }
46
+
47
+ /* Arrows point the reading direction, and their negative margins keep icon-only buttons square */
48
+ &:where([data-component='pagination-firstbuttonicon']),
49
+ &:where([data-component='pagination-previousbuttonicon']),
50
+ &:where([data-component='pagination-nextbuttonicon']),
51
+ &:where([data-component='pagination-lastbuttonicon']) {
52
+ @apply -mx-1.5 rtl:-scale-x-100;
53
+ }
54
+ }
55
+ }