@greghowe79/the-lib 0.4.3 → 0.4.5

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.
@@ -6,7 +6,7 @@ const styles = require("./styles.css.qwik.cjs");
6
6
  const button = require("../button/button.qwik.cjs");
7
7
  const closeIcon = require("../icons/closeIcon.qwik.cjs");
8
8
  require("@fontsource/roboto-condensed");
9
- const Modal = qwik.component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction }) => {
9
+ const Modal = qwik.component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction, closeButtonVisible = true }) => {
10
10
  qwik.useStylesScoped$(styles);
11
11
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
12
12
  id: "modal",
@@ -26,7 +26,7 @@ const Modal = qwik.component$(({ title, open, primaryButtonLabel, secondaryButto
26
26
  id: "modal-title",
27
27
  children: title
28
28
  }),
29
- /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
29
+ closeButtonVisible && /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
30
30
  id: "close-button",
31
31
  ariaLabel: "Chiudi modale",
32
32
  onClick$: () => open.value = false,
@@ -4,7 +4,7 @@ import styles from "./styles.css.qwik.mjs";
4
4
  import { Button } from "../button/button.qwik.mjs";
5
5
  import { CloseIcon } from "../icons/closeIcon.qwik.mjs";
6
6
  import "@fontsource/roboto-condensed";
7
- const Modal = component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction }) => {
7
+ const Modal = component$(({ title, open, primaryButtonLabel, secondaryButtonLabel, primaryAction, secondaryAction, closeButtonVisible = true }) => {
8
8
  useStylesScoped$(styles);
9
9
  return /* @__PURE__ */ jsx("div", {
10
10
  id: "modal",
@@ -24,7 +24,7 @@ const Modal = component$(({ title, open, primaryButtonLabel, secondaryButtonLabe
24
24
  id: "modal-title",
25
25
  children: title
26
26
  }),
27
- /* @__PURE__ */ jsx(Button, {
27
+ closeButtonVisible && /* @__PURE__ */ jsx(Button, {
28
28
  id: "close-button",
29
29
  ariaLabel: "Chiudi modale",
30
30
  onClick$: () => open.value = false,
@@ -12,6 +12,6 @@ export interface ButtonProps {
12
12
  ariaLabel?: string;
13
13
  type?: ButtonType;
14
14
  size?: ButtonSize;
15
- onClick$?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
15
+ onClick$?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>> | QRL<(type: string | unknown) => Promise<void>>;
16
16
  }
17
17
  export declare const Button: Component<ButtonProps>;
@@ -3,9 +3,10 @@ import '@fontsource/roboto-condensed';
3
3
  export interface ModalProps {
4
4
  title?: string;
5
5
  open: Signal<boolean>;
6
+ closeButtonVisible?: boolean;
6
7
  primaryButtonLabel?: string;
7
8
  secondaryButtonLabel?: string;
8
- primaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
9
+ primaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>> | QRL<(type: string | unknown) => Promise<void>>;
9
10
  secondaryAction?: QRL<() => void> | QRL<() => boolean> | QRL<() => Promise<void>>;
10
11
  }
11
12
  export declare const Modal: import("@builder.io/qwik").Component<ModalProps>;
@@ -6,3 +6,4 @@ type Story = StoryObj<ModalProps>;
6
6
  export declare const Default: Story;
7
7
  export declare const WithoutTitle: Story;
8
8
  export declare const LongContent: Story;
9
+ export declare const WithoutCloseButton: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greghowe79/the-lib",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Collection of fast components for Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",