@cratis/components 3.1.0 → 3.3.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.
@@ -0,0 +1,29 @@
1
+ import { type CSSProperties, type MouseEventHandler, type ReactNode } from 'react';
2
+ import type { ButtonProps as ButtonRootProps } from '@primereact/types/primitive/button';
3
+ import { type TooltipPosition } from './Tooltip';
4
+ export type ButtonSeverity = 'secondary' | 'info' | 'success' | 'warn' | 'help' | 'danger' | 'contrast';
5
+ export interface ButtonProps {
6
+ label?: ReactNode;
7
+ icon?: ReactNode;
8
+ loading?: boolean;
9
+ tooltip?: string;
10
+ tooltipOptions?: {
11
+ position?: TooltipPosition;
12
+ className?: string;
13
+ };
14
+ pt?: ButtonRootProps['pt'];
15
+ text?: boolean;
16
+ outlined?: boolean;
17
+ rounded?: boolean;
18
+ severity?: ButtonSeverity;
19
+ size?: 'small' | 'normal' | 'large';
20
+ disabled?: boolean;
21
+ type?: 'button' | 'submit' | 'reset';
22
+ onClick?: MouseEventHandler<HTMLButtonElement>;
23
+ className?: string;
24
+ style?: CSSProperties;
25
+ 'aria-label'?: string;
26
+ children?: ReactNode;
27
+ }
28
+ export declare const Button: ({ label, icon, loading, tooltip, tooltipOptions, pt, text, outlined, rounded, severity, size, disabled, type, onClick, className, style, "aria-label": ariaLabel, children }: ButtonProps) => import("react").JSX.Element;
29
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../Common/Button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAW,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAG1D,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAKxG,MAAM,WAAW,WAAW;IAExB,KAAK,CAAC,EAAE,SAAS,CAAC;IAKlB,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,eAAe,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEpE,EAAE,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAE3B,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAErC,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAE/C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAeD,eAAO,MAAM,MAAM,GAAI,8KAmBpB,WAAW,gCA0Bb,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Button as Button$1 } from 'primereact/button';
3
+ import { Tooltip } from './Tooltip.js';
4
+
5
+ const renderIcon = (icon) => typeof icon === 'string' ? jsx("i", { className: icon, "aria-hidden": 'true' }) : icon;
6
+ /**
7
+ * A button carrying the `label` / `icon` / `loading` / `tooltip` authoring model.
8
+ *
9
+ * PrimeReact 11's `Button` takes its content as **children** and dropped `label`,
10
+ * `icon`, `loading`, `tooltip` and `text` entirely. Because its props type is
11
+ * generic over `React.ElementType`, those props are still *accepted by the
12
+ * compiler* and silently ignored at runtime — a `<Button label="Save" />`
13
+ * typechecks and renders an empty button. This wrapper closes that trap once, for
14
+ * every application, rather than leaving each call site to be caught by eye.
15
+ */
16
+ const Button = ({ label, icon, loading, tooltip, tooltipOptions, pt, text, outlined, rounded, severity, size, disabled, type = 'button', onClick, className, style, 'aria-label': ariaLabel, children }) => {
17
+ const variant = text ? 'text' : outlined ? 'outlined' : undefined;
18
+ const button = (jsxs(Button$1, { type: type, variant: variant, rounded: rounded, severity: severity, size: size, iconOnly: !!icon && label === undefined && !children, disabled: disabled || loading, onClick: onClick, className: className, style: style, "aria-label": ariaLabel, pt: pt, children: [loading ? jsx("i", { className: 'pi pi-spinner pi-spin', "aria-hidden": 'true' }) : renderIcon(icon), label, children] }));
19
+ return tooltip
20
+ ? jsx(Tooltip, { content: tooltip, position: tooltipOptions?.position, className: tooltipOptions?.className, children: button })
21
+ : button;
22
+ };
23
+
24
+ export { Button };
25
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sources":["../../../Common/Button.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","PrimeButton"],"mappings":";;;;AAwDA,MAAM,UAAU,GAAG,CAAC,IAAe,KAC/B,OAAO,IAAI,KAAK,QAAQ,GAAGA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,IAAI,EAAA,aAAA,EAAc,MAAM,EAAA,CAAG,GAAG,IAAI;AAE/E;;;;;;;;;AASG;MACU,MAAM,GAAG,CAAC,EACnB,KAAK,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,cAAc,EACd,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,GAAG,QAAQ,EACf,OAAO,EACP,SAAS,EACT,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,QAAQ,EACE,KAAI;AACd,IAAA,MAAM,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS;AAEjE,IAAA,MAAM,MAAM,IACRC,KAACC,QAAW,EAAA,EACR,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,CAAC,CAAC,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,QAAQ,EACpD,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EAAA,YAAA,EACA,SAAS,EACrB,EAAE,EAAE,EAAE,EAAA,QAAA,EAAA,CACL,OAAO,GAAGF,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,iBAAa,MAAM,EAAA,CAAG,GAAG,UAAU,CAAC,IAAI,CAAC,EACvF,KAAK,EACL,QAAQ,CAAA,EAAA,CACC,CACjB;AAED,IAAA,OAAO;UACDA,IAAC,OAAO,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAA,QAAA,EAAG,MAAM,EAAA;UAC5G,MAAM;AAChB;;;;"}
@@ -7,4 +7,5 @@ export * from './normalizeIconClass';
7
7
  export * from './Page';
8
8
  export * from './FormElement';
9
9
  export * from './Tooltip';
10
+ export * from './Button';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Common/index.ts"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Common/index.ts"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
@@ -7,6 +7,7 @@ export { normalizeIconClass } from './normalizeIconClass.js';
7
7
  export { Page } from './Page.js';
8
8
  export { FormElement } from './FormElement.js';
9
9
  export { Tooltip } from './Tooltip.js';
10
+ export { Button } from './Button.js';
10
11
 
11
12
  // Copyright (c) Cratis. All rights reserved.
12
13
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../Common/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAAA;AACA"}
1
+ {"version":3,"file":"index.js","sources":["../../../Common/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export type MessageSeverity = 'info' | 'success' | 'warn' | 'error' | 'secondary' | 'contrast';
3
+ export interface MessageProps {
4
+ severity?: MessageSeverity;
5
+ text?: React.ReactNode;
6
+ children?: React.ReactNode;
7
+ className?: string;
8
+ }
9
+ export declare const Message: ({ severity, text, children, className }: MessageProps) => React.JSX.Element;
10
+ //# sourceMappingURL=Message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../Display/Message.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC;AAG/F,MAAM,WAAW,YAAY;IAEzB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AASD,eAAO,MAAM,OAAO,GAAI,yCAAkD,YAAY,sBAMrF,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Message as Message$1 } from 'primereact/message';
3
+
4
+ /**
5
+ * A declarative inline message built on PrimeReact 11's compositional `Message` parts.
6
+ *
7
+ * PrimeReact 10's `<Message severity text />` became `Message.Root` + `Message.Content` +
8
+ * `Message.Text` in 11; this preserves the flat call shape so an inline notice stays a
9
+ * single element at the call site.
10
+ */
11
+ const Message = ({ severity = 'info', text, children, className }) => (jsx(Message$1.Root, { severity: severity, className: className, children: jsx(Message$1.Content, { children: jsx(Message$1.Text, { children: children ?? text }) }) }));
12
+
13
+ export { Message };
14
+ //# sourceMappingURL=Message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Message.js","sources":["../../../Display/Message.tsx"],"sourcesContent":[null],"names":["_jsx","PrimeMessage"],"mappings":";;;AAqBA;;;;;;AAMG;MACU,OAAO,GAAG,CAAC,EAAE,QAAQ,GAAG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAgB,MAClFA,GAAA,CAACC,SAAY,CAAC,IAAI,EAAA,EAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAA,QAAA,EACvDD,GAAA,CAACC,SAAY,CAAC,OAAO,EAAA,EAAA,QAAA,EACjBD,IAACC,SAAY,CAAC,IAAI,EAAA,EAAA,QAAA,EAAE,QAAQ,IAAI,IAAI,EAAA,CAAqB,EAAA,CACtC,EAAA,CACP;;;;"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface ProgressSpinnerProps {
3
+ style?: React.CSSProperties;
4
+ className?: string;
5
+ 'aria-label'?: string;
6
+ }
7
+ export declare const ProgressSpinner: ({ style, className, "aria-label": ariaLabel }: ProgressSpinnerProps) => React.JSX.Element;
8
+ //# sourceMappingURL=ProgressSpinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressSpinner.d.ts","sourceRoot":"","sources":["../../../Display/ProgressSpinner.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,oBAAoB;IAEjC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAQD,eAAO,MAAM,eAAe,GAAI,+CAA2D,oBAAoB,sBAK9G,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { ProgressSpinner as ProgressSpinner$1 } from 'primereact/progressspinner';
3
+
4
+ /**
5
+ * An indeterminate spinner built on PrimeReact 11's compositional `ProgressSpinner` parts.
6
+ *
7
+ * PrimeReact 10's single `<ProgressSpinner />` became `ProgressSpinner.Root` + `Track` +
8
+ * `Range` in 11; this preserves the flat call shape for the common loading indicator.
9
+ */
10
+ const ProgressSpinner = ({ style, className, 'aria-label': ariaLabel = 'Loading' }) => (jsxs(ProgressSpinner$1.Root, { style: style, className: className, "aria-label": ariaLabel, children: [jsx(ProgressSpinner$1.Track, {}), jsx(ProgressSpinner$1.Range, {})] }));
11
+
12
+ export { ProgressSpinner };
13
+ //# sourceMappingURL=ProgressSpinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressSpinner.js","sources":["../../../Display/ProgressSpinner.tsx"],"sourcesContent":[null],"names":["_jsxs","PrimeProgressSpinner","_jsx"],"mappings":";;;AAgBA;;;;;AAKG;MACU,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,GAAG,SAAS,EAAwB,MAC3GA,IAAA,CAACC,iBAAoB,CAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAA,YAAA,EAAc,SAAS,EAAA,QAAA,EAAA,CAChFC,GAAA,CAACD,iBAAoB,CAAC,KAAK,EAAA,EAAA,CAAG,EAC9BC,GAAA,CAACD,iBAAoB,CAAC,KAAK,EAAA,EAAA,CAAG,CAAA,EAAA,CACN;;;;"}
@@ -4,4 +4,6 @@ export * from './Chip';
4
4
  export * from './Skeleton';
5
5
  export * from './Avatar';
6
6
  export * from './ProgressBar';
7
+ export * from './Message';
8
+ export * from './ProgressSpinner';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Display/index.ts"],"names":[],"mappings":"AAGA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Display/index.ts"],"names":[],"mappings":"AAGA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"}
@@ -4,6 +4,8 @@ export { Chip } from './Chip.js';
4
4
  export { Skeleton } from './Skeleton.js';
5
5
  export { Avatar } from './Avatar.js';
6
6
  export { ProgressBar } from './ProgressBar.js';
7
+ export { Message } from './Message.js';
8
+ export { ProgressSpinner } from './ProgressSpinner.js';
7
9
 
8
10
  // Copyright (c) Cratis. All rights reserved.
9
11
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../Display/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;AACA"}
1
+ {"version":3,"file":"index.js","sources":["../../../Display/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;AACA"}
@@ -686,6 +686,10 @@
686
686
  --tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
687
687
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
688
688
  }
689
+ .outline {
690
+ outline-style: var(--tw-outline-style);
691
+ outline-width: 1px;
692
+ }
689
693
  .blur {
690
694
  --tw-blur: blur(8px);
691
695
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
@@ -919,6 +923,11 @@
919
923
  inherits: false;
920
924
  initial-value: 0 0 #0000;
921
925
  }
926
+ @property --tw-outline-style {
927
+ syntax: "*";
928
+ inherits: false;
929
+ initial-value: solid;
930
+ }
922
931
  @property --tw-blur {
923
932
  syntax: "*";
924
933
  inherits: false;
@@ -1035,6 +1044,7 @@
1035
1044
  --tw-ring-offset-width: 0px;
1036
1045
  --tw-ring-offset-color: #fff;
1037
1046
  --tw-ring-offset-shadow: 0 0 #0000;
1047
+ --tw-outline-style: solid;
1038
1048
  --tw-blur: initial;
1039
1049
  --tw-brightness: initial;
1040
1050
  --tw-contrast: initial;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/components",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "",
5
5
  "author": "Cratis",
6
6
  "license": "MIT",