@apipass/design-system 1.18.1 → 1.20.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 (42) hide show
  1. package/dist/lib/embedded-styles.js +1 -1
  2. package/dist/lib/lib.index.cjs +1 -1
  3. package/dist/lib/lib.index.js +775 -765
  4. package/dist/lib/lib.index.js.map +1 -1
  5. package/dist/lib/style.css +1 -1
  6. package/dist/lib/ui/components/Widget/Widget.cjs +1 -1
  7. package/dist/lib/ui/components/Widget/Widget.cjs.map +1 -1
  8. package/dist/lib/ui/components/Widget/Widget.js +12 -12
  9. package/dist/lib/ui/components/Widget/Widget.js.map +1 -1
  10. package/dist/lib/ui/components/WidgetEmptyState/WidgetEmptyState.cjs +2 -0
  11. package/dist/lib/ui/components/WidgetEmptyState/WidgetEmptyState.cjs.map +1 -0
  12. package/dist/lib/ui/components/WidgetEmptyState/WidgetEmptyState.js +18 -0
  13. package/dist/lib/ui/components/WidgetEmptyState/WidgetEmptyState.js.map +1 -0
  14. package/dist/lib/ui/components/WidgetErrorState/WidgetErrorState.cjs +2 -0
  15. package/dist/lib/ui/components/WidgetErrorState/WidgetErrorState.cjs.map +1 -0
  16. package/dist/lib/ui/components/WidgetErrorState/WidgetErrorState.js +22 -0
  17. package/dist/lib/ui/components/WidgetErrorState/WidgetErrorState.js.map +1 -0
  18. package/dist/lib/ui/components/WidgetGrid/WidgetGrid.cjs +1 -1
  19. package/dist/lib/ui/components/WidgetGrid/WidgetGrid.cjs.map +1 -1
  20. package/dist/lib/ui/components/WidgetGrid/WidgetGrid.js +40 -26
  21. package/dist/lib/ui/components/WidgetGrid/WidgetGrid.js.map +1 -1
  22. package/dist/lib/ui/components/WidgetLoadingState/WidgetLoadingState.cjs +2 -0
  23. package/dist/lib/ui/components/WidgetLoadingState/WidgetLoadingState.cjs.map +1 -0
  24. package/dist/lib/ui/components/WidgetLoadingState/WidgetLoadingState.js +27 -0
  25. package/dist/lib/ui/components/WidgetLoadingState/WidgetLoadingState.js.map +1 -0
  26. package/dist/lib/ui/primitives/ComboBox/ComboBox.cjs +2 -0
  27. package/dist/lib/ui/primitives/ComboBox/ComboBox.cjs.map +1 -0
  28. package/dist/lib/ui/primitives/ComboBox/ComboBox.js +58 -0
  29. package/dist/lib/ui/primitives/ComboBox/ComboBox.js.map +1 -0
  30. package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.cjs +1 -1
  31. package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.js +17 -17
  32. package/dist/lib/ui/primitives/Search/Search.cjs +1 -1
  33. package/dist/lib/ui/primitives/Search/Search.js +8 -8
  34. package/dist/types/ui/components/Widget/Widget.d.ts +11 -8
  35. package/dist/types/ui/components/WidgetEmptyState/WidgetEmptyState.d.ts +6 -0
  36. package/dist/types/ui/components/WidgetErrorState/WidgetErrorState.d.ts +8 -0
  37. package/dist/types/ui/components/WidgetGrid/WidgetGrid.d.ts +3 -1
  38. package/dist/types/ui/components/WidgetLoadingState/WidgetLoadingState.d.ts +6 -0
  39. package/dist/types/ui/components/index.d.ts +3 -0
  40. package/dist/types/ui/primitives/ComboBox/ComboBox.d.ts +12 -0
  41. package/dist/types/ui/primitives/index.d.ts +1 -0
  42. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("../../../vendor/clsx/dist/clsx.cjs"),a=require("react"),l=require("react-aria-components");;/* empty css */const p=require("../Input/Input.cjs"),q=require("../../icons/IconX.cjs"),b=require("../../icons/IconSearch.cjs"),S=require("../Fieldset/Fieldset.cjs"),h=require("../IconButton/IconButton.cjs"),x=require("../ListBox/ListBox.cjs"),f=a.forwardRef(function({className:m,results:s,onSearch:o,...i},n){const[u,j]=a.useState(""),c=a.useRef(null),t=e=>{j(e),o&&o(e)},I=d.clsx(m,"search-input-container");return r.jsxs(l.ComboBox,{className:I,children:[r.jsx(S.Label,{hidden:!0,children:i["aria-label"]||"Search"}),r.jsx(p.Input,{type:"search",className:"search-input",value:u,onInput:e=>t(e.currentTarget.value),ref:e=>{c.current=e,typeof n=="function"?n(e):n&&(n.current=e)},...i}),r.jsx("span",{className:"search-icon",children:u?r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>t(""),size:"small",variant:"subtle",children:r.jsx(q.IconX,{})}):r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>{var e;return(e=c==null?void 0:c.current)==null?void 0:e.focus()},size:"small",variant:"subtle",children:r.jsx(b.IconSearch,{})})}),r.jsx(l.Popover,{children:r.jsx(x.ListBox,{children:s==null?void 0:s.map(e=>r.jsx(x.ListBoxItem,{onAction:()=>t(e),children:e},e))})})]})});exports.Search=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("../../../vendor/clsx/dist/clsx.cjs"),a=require("react"),l=require("react-aria-components");;/* empty css */const p=require("../../icons/IconX.cjs"),q=require("../../icons/IconSearch.cjs"),b=require("../Fieldset/Fieldset.cjs"),S=require("../Input/Input.cjs"),h=require("../IconButton/IconButton.cjs"),x=require("../ListBox/ListBox.cjs"),f=a.forwardRef(function({className:m,results:s,onSearch:o,...i},n){const[u,j]=a.useState(""),c=a.useRef(null),t=e=>{j(e),o&&o(e)},I=d.clsx(m,"search-input-container");return r.jsxs(l.ComboBox,{className:I,children:[r.jsx(b.Label,{hidden:!0,children:i["aria-label"]||"Search"}),r.jsx(S.Input,{type:"search",className:"search-input",value:u,onInput:e=>t(e.currentTarget.value),ref:e=>{c.current=e,typeof n=="function"?n(e):n&&(n.current=e)},...i}),r.jsx("span",{className:"search-icon",children:u?r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>t(""),size:"small",variant:"subtle",children:r.jsx(p.IconX,{})}):r.jsx(h.IconButton,{"aria-label":"Clear search",onPress:()=>{var e;return(e=c==null?void 0:c.current)==null?void 0:e.focus()},size:"small",variant:"subtle",children:r.jsx(q.IconSearch,{})})}),r.jsx(l.Popover,{children:r.jsx(x.ListBox,{children:s==null?void 0:s.map(e=>r.jsx(x.ListBoxItem,{onAction:()=>t(e),children:e},e))})})]})});exports.Search=f;
2
2
  //# sourceMappingURL=Search.cjs.map
@@ -3,10 +3,10 @@ import { clsx as f } from "../../../vendor/clsx/dist/clsx.js";
3
3
  import d, { useState as I, useRef as b } from "react";
4
4
  import { ComboBox as x, Popover as v } from "react-aria-components";
5
5
  /* empty css */
6
- import { Input as B } from "../Input/Input.js";
7
- import { IconX as S } from "../../icons/IconX.js";
8
- import { IconSearch as N } from "../../icons/IconSearch.js";
9
- import { Label as C } from "../Fieldset/Fieldset.js";
6
+ import { IconX as B } from "../../icons/IconX.js";
7
+ import { IconSearch as S } from "../../icons/IconSearch.js";
8
+ import { Label as N } from "../Fieldset/Fieldset.js";
9
+ import { Input as C } from "../Input/Input.js";
10
10
  import { IconButton as m } from "../IconButton/IconButton.js";
11
11
  import { ListBox as L, ListBoxItem as P } from "../ListBox/ListBox.js";
12
12
  const D = d.forwardRef(function({ className: l, results: a, onSearch: n, ...i }, o) {
@@ -14,9 +14,9 @@ const D = d.forwardRef(function({ className: l, results: a, onSearch: n, ...i },
14
14
  p(r), n && n(r);
15
15
  }, h = f(l, "search-input-container");
16
16
  return /* @__PURE__ */ u(x, { className: h, children: [
17
- /* @__PURE__ */ e(C, { hidden: !0, children: i["aria-label"] || "Search" }),
17
+ /* @__PURE__ */ e(N, { hidden: !0, children: i["aria-label"] || "Search" }),
18
18
  /* @__PURE__ */ e(
19
- B,
19
+ C,
20
20
  {
21
21
  type: "search",
22
22
  className: "search-input",
@@ -35,7 +35,7 @@ const D = d.forwardRef(function({ className: l, results: a, onSearch: n, ...i },
35
35
  onPress: () => c(""),
36
36
  size: "small",
37
37
  variant: "subtle",
38
- children: /* @__PURE__ */ e(S, {})
38
+ children: /* @__PURE__ */ e(B, {})
39
39
  }
40
40
  ) : /* @__PURE__ */ e(
41
41
  m,
@@ -47,7 +47,7 @@ const D = d.forwardRef(function({ className: l, results: a, onSearch: n, ...i },
47
47
  },
48
48
  size: "small",
49
49
  variant: "subtle",
50
- children: /* @__PURE__ */ e(N, {})
50
+ children: /* @__PURE__ */ e(S, {})
51
51
  }
52
52
  ) }),
53
53
  /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(L, { children: a == null ? void 0 : a.map((r) => /* @__PURE__ */ e(P, { onAction: () => c(r), children: r }, r)) }) })
@@ -1,12 +1,15 @@
1
1
  import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
2
  import "./widget.css";
3
- export type WidgetProps = ComponentPropsWithoutRef<"div"> & {
4
- title: string;
5
- description?: ReactNode;
6
- headerActions?: ReactNode;
3
+ type WidgetDescriptionProps = {
4
+ description?: undefined;
5
+ descriptionButtonLabel?: undefined;
6
+ } | {
7
+ description: ReactNode;
8
+ descriptionButtonLabel: string;
7
9
  };
8
- export declare const Widget: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
- title: string;
10
- description?: ReactNode;
10
+ export type WidgetProps = Omit<ComponentPropsWithoutRef<"div">, "title"> & WidgetDescriptionProps & {
11
+ title: ReactNode;
11
12
  headerActions?: ReactNode;
12
- } & import("react").RefAttributes<HTMLDivElement>>;
13
+ };
14
+ export declare const Widget: import("react").ForwardRefExoticComponent<WidgetProps & import("react").RefAttributes<HTMLDivElement>>;
15
+ export {};
@@ -0,0 +1,6 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ import "./widget-empty-state.css";
3
+ export type WidgetEmptyStateProps = ComponentPropsWithoutRef<"div"> & {
4
+ message: string;
5
+ };
6
+ export declare function WidgetEmptyState({ message, className, ...props }: WidgetEmptyStateProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ import "./widget-error-state.css";
3
+ export type WidgetErrorStateProps = ComponentPropsWithoutRef<"div"> & {
4
+ message: string;
5
+ retryLabel: string;
6
+ onRetry?: () => void;
7
+ };
8
+ export declare function WidgetErrorState({ message, retryLabel, onRetry, className, ...props }: WidgetErrorStateProps): import("react/jsx-runtime").JSX.Element;
@@ -15,8 +15,10 @@ export interface WidgetGridProps {
15
15
  cols?: number;
16
16
  rowHeight?: number;
17
17
  isEditable?: boolean;
18
+ isDraggable?: boolean;
19
+ isResizable?: boolean;
18
20
  className?: string;
19
21
  style?: CSSProperties;
20
22
  children: ReactNode;
21
23
  }
22
- export declare function WidgetGrid({ layout, onLayoutChange, cols, rowHeight, isEditable, className, style, children, }: WidgetGridProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function WidgetGrid({ layout, onLayoutChange, cols, rowHeight, isEditable, isDraggable, isResizable, className, style, children, }: WidgetGridProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ import "./widget-loading-state.css";
3
+ export type WidgetLoadingStateProps = ComponentPropsWithoutRef<"div"> & {
4
+ message: string;
5
+ };
6
+ export declare function WidgetLoadingState({ message, className, ...props }: WidgetLoadingStateProps): import("react/jsx-runtime").JSX.Element;
@@ -6,4 +6,7 @@ export * from "./FormModal/FormModal";
6
6
  export * from "./PageHeader/PageHeader";
7
7
  export * from "./Sidebar/Sidebar";
8
8
  export * from "./Widget/Widget";
9
+ export * from "./WidgetEmptyState/WidgetEmptyState";
10
+ export * from "./WidgetErrorState/WidgetErrorState";
9
11
  export * from "./WidgetGrid/WidgetGrid";
12
+ export * from "./WidgetLoadingState/WidgetLoadingState";
@@ -0,0 +1,12 @@
1
+ import { SharedFieldProps, type ListBoxItemProps } from "primitives";
2
+ import { type ComboBoxProps as RACComboBoxProps } from "react-aria-components";
3
+ import "./combobox.css";
4
+ export interface ComboBoxFieldProps<T extends object> extends Omit<ComboBoxProps<T>, "children">, SharedFieldProps {
5
+ items?: Iterable<T>;
6
+ children: React.ReactNode | ((item: T) => React.ReactNode);
7
+ }
8
+ export declare function ComboBoxField<T extends object>({ className, label, description, errorMessage, placeholder, children, items, ...props }: ComboBoxFieldProps<T>): import("react/jsx-runtime").JSX.Element;
9
+ export type ComboBoxProps<T extends object> = RACComboBoxProps<T>;
10
+ export declare function ComboBox<T extends object>({ ...props }: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
11
+ export type ComboBoxItemProps = ListBoxItemProps;
12
+ export declare function ComboBoxItem({ children, className, ...props }: ComboBoxItemProps): import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,7 @@ export * from "./CodeEditor/CodeEditor";
5
5
  export * from "./Avatar/Avatar";
6
6
  export * from "./Button/Button";
7
7
  export * from "./Checkbox/Checkbox";
8
+ export * from "./ComboBox/ComboBox";
8
9
  export * from "./DateRangePicker/DateRangePicker";
9
10
  export * from "./DateRangePicker/dateRangePresets";
10
11
  export * from "./Dialog/Dialog";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/design-system",
3
- "version": "1.18.1",
3
+ "version": "1.20.0",
4
4
  "type": "module",
5
5
  "description": "APIPass React Design System",
6
6
  "sideEffects": [