@orangecheck/app-design 1.4.0 → 1.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 (43) hide show
  1. package/dist/chrome.d.mts +5 -4
  2. package/dist/chrome.d.ts +5 -4
  3. package/dist/chrome.js +171 -40
  4. package/dist/chrome.js.map +1 -1
  5. package/dist/chrome.mjs +172 -41
  6. package/dist/chrome.mjs.map +1 -1
  7. package/dist/components.d.mts +46 -9
  8. package/dist/components.d.ts +46 -9
  9. package/dist/components.js +334 -167
  10. package/dist/components.js.map +1 -1
  11. package/dist/components.mjs +333 -170
  12. package/dist/components.mjs.map +1 -1
  13. package/dist/{docs-BB9gK4KF.d.ts → docs-ByUx4t-D.d.ts} +2 -1
  14. package/dist/{docs-D-T-nHiu.d.mts → docs-CFE5mU_6.d.mts} +2 -1
  15. package/dist/index.d.mts +4 -4
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +572 -244
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +570 -246
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/mdx.d.mts +1 -1
  22. package/dist/mdx.d.ts +1 -1
  23. package/dist/mdx.js +7 -2
  24. package/dist/mdx.js.map +1 -1
  25. package/dist/mdx.mjs +7 -2
  26. package/dist/mdx.mjs.map +1 -1
  27. package/dist/primitives.d.mts +4 -3
  28. package/dist/primitives.d.ts +4 -3
  29. package/dist/primitives.js +37 -1
  30. package/dist/primitives.js.map +1 -1
  31. package/dist/primitives.mjs +37 -1
  32. package/dist/primitives.mjs.map +1 -1
  33. package/dist/session.d.mts +3 -3
  34. package/dist/session.d.ts +3 -3
  35. package/dist/session.js +1 -1
  36. package/dist/session.js.map +1 -1
  37. package/dist/session.mjs +1 -1
  38. package/dist/session.mjs.map +1 -1
  39. package/dist/{tool-shell-D8Q8XX11.d.mts → tool-shell-CQZNRUgH.d.mts} +8 -4
  40. package/dist/{tool-shell-gmlj47Ie.d.ts → tool-shell-CRmceGrV.d.ts} +8 -4
  41. package/dist/{tools-DFIxIj5p.d.mts → tools-Bg1gi2HO.d.mts} +1 -1
  42. package/dist/{tools-BggNN5DV.d.ts → tools-Bw7RhO92.d.ts} +1 -1
  43. package/package.json +3 -2
@@ -21,7 +21,7 @@ import './index-DmfyPYe5.mjs';
21
21
 
22
22
  declare const buttonVariants: (props?: ({
23
23
  variant?: "link" | "danger" | "brand" | "primary" | "secondary" | "ghost" | "onInk" | "onInkOutline" | null | undefined;
24
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm" | null | undefined;
24
+ size?: "icon" | "sm" | "md" | "lg" | "icon-sm" | null | undefined;
25
25
  } & class_variance_authority_types.ClassProp) | undefined) => string;
26
26
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
27
27
  asChild?: boolean;
@@ -40,7 +40,7 @@ declare function StatusPill({ className, children, pulse, ...props }: HTMLAttrib
40
40
  }): react.JSX.Element;
41
41
 
42
42
  declare const cardVariants: (props?: ({
43
- tone?: "ink" | "default" | "sunken" | "outline" | null | undefined;
43
+ tone?: "default" | "ink" | "sunken" | "outline" | null | undefined;
44
44
  padding?: "none" | "sm" | "md" | "lg" | null | undefined;
45
45
  interactive?: boolean | null | undefined;
46
46
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -164,7 +164,7 @@ declare function StatusDot({ tone, pulse, className, }: {
164
164
  pulse?: boolean;
165
165
  className?: string;
166
166
  }): react.JSX.Element;
167
- declare function Toaster(props: ToasterProps): react.JSX.Element;
167
+ declare function Toaster({ style, ...props }: ToasterProps): react.JSX.Element;
168
168
 
169
169
  interface ScrollFadeProps extends HTMLAttributes<HTMLDivElement> {
170
170
  fade?: string;
@@ -200,6 +200,7 @@ interface PromptOptions extends ConfirmOptions {
200
200
  secret?: boolean;
201
201
  minLength?: number;
202
202
  validate?: (value: string) => string | null | undefined;
203
+ confirmField?: boolean | ReactNode;
203
204
  }
204
205
  declare function confirm(options: ConfirmOptions): Promise<boolean>;
205
206
  declare function prompt(options: PromptOptions): Promise<string | null>;
@@ -21,7 +21,7 @@ import './index-DmfyPYe5.js';
21
21
 
22
22
  declare const buttonVariants: (props?: ({
23
23
  variant?: "link" | "danger" | "brand" | "primary" | "secondary" | "ghost" | "onInk" | "onInkOutline" | null | undefined;
24
- size?: "sm" | "md" | "lg" | "icon" | "icon-sm" | null | undefined;
24
+ size?: "icon" | "sm" | "md" | "lg" | "icon-sm" | null | undefined;
25
25
  } & class_variance_authority_types.ClassProp) | undefined) => string;
26
26
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
27
27
  asChild?: boolean;
@@ -40,7 +40,7 @@ declare function StatusPill({ className, children, pulse, ...props }: HTMLAttrib
40
40
  }): react.JSX.Element;
41
41
 
42
42
  declare const cardVariants: (props?: ({
43
- tone?: "ink" | "default" | "sunken" | "outline" | null | undefined;
43
+ tone?: "default" | "ink" | "sunken" | "outline" | null | undefined;
44
44
  padding?: "none" | "sm" | "md" | "lg" | null | undefined;
45
45
  interactive?: boolean | null | undefined;
46
46
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -164,7 +164,7 @@ declare function StatusDot({ tone, pulse, className, }: {
164
164
  pulse?: boolean;
165
165
  className?: string;
166
166
  }): react.JSX.Element;
167
- declare function Toaster(props: ToasterProps): react.JSX.Element;
167
+ declare function Toaster({ style, ...props }: ToasterProps): react.JSX.Element;
168
168
 
169
169
  interface ScrollFadeProps extends HTMLAttributes<HTMLDivElement> {
170
170
  fade?: string;
@@ -200,6 +200,7 @@ interface PromptOptions extends ConfirmOptions {
200
200
  secret?: boolean;
201
201
  minLength?: number;
202
202
  validate?: (value: string) => string | null | undefined;
203
+ confirmField?: boolean | ReactNode;
203
204
  }
204
205
  declare function confirm(options: ConfirmOptions): Promise<boolean>;
205
206
  declare function prompt(options: PromptOptions): Promise<string | null>;
@@ -6,6 +6,7 @@ var react = require('react');
6
6
  var clsx = require('clsx');
7
7
  var tailwindMerge = require('tailwind-merge');
8
8
  var SeparatorPrimitive = require('@radix-ui/react-separator');
9
+ var nextThemes = require('next-themes');
9
10
  var sonner = require('sonner');
10
11
  var jsxRuntime = require('react/jsx-runtime');
11
12
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
@@ -161,10 +162,18 @@ function StatusDot({
161
162
  }
162
163
  );
163
164
  }
164
- function Toaster(props) {
165
+ var TOAST_COLOURS = {
166
+ "--normal-bg": "var(--popover)",
167
+ "--normal-text": "var(--popover-foreground)",
168
+ "--normal-border": "var(--border)"
169
+ };
170
+ function Toaster({ style, ...props }) {
171
+ const { resolvedTheme } = nextThemes.useTheme();
165
172
  return /* @__PURE__ */ jsxRuntime.jsx(
166
173
  sonner.Toaster,
167
174
  {
175
+ theme: resolvedTheme === "dark" ? "dark" : resolvedTheme === "light" ? "light" : "system",
176
+ style: { ...TOAST_COLOURS, ...style },
168
177
  position: "bottom-right",
169
178
  toastOptions: {
170
179
  classNames: {
@@ -911,7 +920,9 @@ var none = () => null;
911
920
  function PromptBody({ ask: a }) {
912
921
  const o = a.options;
913
922
  const [value, setValue] = react.useState(o.defaultValue ?? "");
923
+ const [again, setAgain] = react.useState("");
914
924
  const [error, setError] = react.useState(null);
925
+ const [mismatch, setMismatch] = react.useState(false);
915
926
  const submit = (e) => {
916
927
  e.preventDefault();
917
928
  if (o.minLength && value.length < o.minLength) {
@@ -923,6 +934,10 @@ function PromptBody({ ask: a }) {
923
934
  setError(refused);
924
935
  return;
925
936
  }
937
+ if (o.confirmField && again !== value) {
938
+ setMismatch(true);
939
+ return;
940
+ }
926
941
  a.settle(value);
927
942
  done();
928
943
  };
@@ -938,9 +953,30 @@ function PromptBody({ ask: a }) {
938
953
  onChange: (e) => {
939
954
  setValue(e.target.value);
940
955
  setError(null);
956
+ setMismatch(false);
941
957
  }
942
958
  }
943
959
  ) }),
960
+ o.confirmField ? /* @__PURE__ */ jsxRuntime.jsx(
961
+ Field,
962
+ {
963
+ label: o.confirmField === true ? "Type it again" : o.confirmField,
964
+ error: mismatch ? "The two do not match." : null,
965
+ className: "mt-4",
966
+ children: /* @__PURE__ */ jsxRuntime.jsx(
967
+ Input,
968
+ {
969
+ type: o.secret ? "password" : "text",
970
+ autoComplete: o.secret ? "new-password" : "off",
971
+ value: again,
972
+ onChange: (e) => {
973
+ setAgain(e.target.value);
974
+ setMismatch(false);
975
+ }
976
+ }
977
+ )
978
+ }
979
+ ) : null,
944
980
  /* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
945
981
  /* @__PURE__ */ jsxRuntime.jsx(
946
982
  Button,