@luscii-healthtech/web-ui 58.3.0 → 58.4.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.
- package/dist/index.development.js +47 -13
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/ActionCard/ActionCard.d.ts +34 -0
- package/dist/src/generated/components/ActionCard/ActionCard.d.ts +34 -0
- package/dist/src/generated/index.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/stories/ActionCard.stories.d.ts +51 -0
- package/dist/web-ui-tailwind.css +9 -0
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ElementType, FC, ReactNode } from "react";
|
|
2
|
+
import { type Props as InstrumentCardProps } from "../InstrumentCard/InstrumentCard";
|
|
3
|
+
export type ActionType = "information" | "contact" | "lesson" | "calculation" | "measurement";
|
|
4
|
+
/**
|
|
5
|
+
* `Omit` distributes over the union so `InstrumentCard`'s discriminated
|
|
6
|
+
* `state`/`errorMessage` pairing survives; a plain `Omit` would collapse it.
|
|
7
|
+
*/
|
|
8
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
9
|
+
export type ActionCardMetadata = {
|
|
10
|
+
label: string;
|
|
11
|
+
/** Bordered instead of flat — used for schedule information. */
|
|
12
|
+
bordered?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type Props = {
|
|
15
|
+
type: ActionType;
|
|
16
|
+
title: string;
|
|
17
|
+
metadata?: ActionCardMetadata[];
|
|
18
|
+
/** Always rendered in the compact variant, so `variant` is not accepted. */
|
|
19
|
+
instruments?: DistributiveOmit<InstrumentCardProps, "variant">[];
|
|
20
|
+
actions?: ReactNode;
|
|
21
|
+
draggable?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Element for the title. `variant` controls the visual size; this controls
|
|
24
|
+
* the document outline, which only the consuming page knows.
|
|
25
|
+
* @default "h3"
|
|
26
|
+
*/
|
|
27
|
+
titleAs?: ElementType;
|
|
28
|
+
/** "list" drops the shadow so the card sits flush inside a list container. */
|
|
29
|
+
variant?: "default" | "compact" | "list";
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
className?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const ActionCard: FC<Props>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ElementType, FC, ReactNode } from "react";
|
|
2
|
+
import { type Props as InstrumentCardProps } from "../InstrumentCard/InstrumentCard";
|
|
3
|
+
export type ActionType = "information" | "contact" | "lesson" | "calculation" | "measurement";
|
|
4
|
+
/**
|
|
5
|
+
* `Omit` distributes over the union so `InstrumentCard`'s discriminated
|
|
6
|
+
* `state`/`errorMessage` pairing survives; a plain `Omit` would collapse it.
|
|
7
|
+
*/
|
|
8
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
9
|
+
export type ActionCardMetadata = {
|
|
10
|
+
label: string;
|
|
11
|
+
/** Bordered instead of flat — used for schedule information. */
|
|
12
|
+
bordered?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type Props = {
|
|
15
|
+
type: ActionType;
|
|
16
|
+
title: string;
|
|
17
|
+
metadata?: ActionCardMetadata[];
|
|
18
|
+
/** Always rendered in the compact variant, so `variant` is not accepted. */
|
|
19
|
+
instruments?: DistributiveOmit<InstrumentCardProps, "variant">[];
|
|
20
|
+
actions?: ReactNode;
|
|
21
|
+
draggable?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Element for the title. `variant` controls the visual size; this controls
|
|
24
|
+
* the document outline, which only the consuming page knows.
|
|
25
|
+
* @default "h3"
|
|
26
|
+
*/
|
|
27
|
+
titleAs?: ElementType;
|
|
28
|
+
/** "list" drops the shadow so the card sits flush inside a list container. */
|
|
29
|
+
variant?: "default" | "compact" | "list";
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
className?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const ActionCard: FC<Props>;
|
|
34
|
+
export {};
|
|
@@ -95,6 +95,7 @@ export { PageHeader, type PageHeaderProps } from "./components/PageHeader";
|
|
|
95
95
|
export { Tag } from "./components/Tag/Tag";
|
|
96
96
|
export { TagGroup } from "./components/Tag/TagGroup";
|
|
97
97
|
export { InstrumentCard, type InstrumentType, type Props as InstrumentCardProps, } from "./components/InstrumentCard/InstrumentCard";
|
|
98
|
+
export { ActionCard, type ActionType, type ActionCardMetadata, type Props as ActionCardProps, } from "./components/ActionCard/ActionCard";
|
|
98
99
|
export { Textarea, type TextareaProps, type ResizeTypes, } from "./components/Textarea/Textarea";
|
|
99
100
|
export { TextEditor, type TextEditorTag, } from "./components/TextEditor/TextEditor";
|
|
100
101
|
export { type TextEditorTranslations } from "./components/TextEditor/textEditorTranslations";
|
package/dist/src/index.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export { PageHeader, type PageHeaderProps } from "./components/PageHeader";
|
|
|
95
95
|
export { Tag } from "./components/Tag/Tag";
|
|
96
96
|
export { TagGroup } from "./components/Tag/TagGroup";
|
|
97
97
|
export { InstrumentCard, type InstrumentType, type Props as InstrumentCardProps, } from "./components/InstrumentCard/InstrumentCard";
|
|
98
|
+
export { ActionCard, type ActionType, type ActionCardMetadata, type Props as ActionCardProps, } from "./components/ActionCard/ActionCard";
|
|
98
99
|
export { Textarea, type TextareaProps, type ResizeTypes, } from "./components/Textarea/Textarea";
|
|
99
100
|
export { TextEditor, type TextEditorTag, } from "./components/TextEditor/TextEditor";
|
|
100
101
|
export { type TextEditorTranslations } from "./components/TextEditor/textEditorTranslations";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { type ActionType } from "../src/components/ActionCard/ActionCard";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<import("../src").ActionCardProps>;
|
|
6
|
+
parameters: {
|
|
7
|
+
backgrounds: {
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
argTypes: {
|
|
12
|
+
type: {
|
|
13
|
+
options: ActionType[];
|
|
14
|
+
control: {
|
|
15
|
+
type: "select";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
variant: {
|
|
19
|
+
options: string[];
|
|
20
|
+
control: {
|
|
21
|
+
type: "select";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
draggable: {
|
|
25
|
+
control: {
|
|
26
|
+
type: "boolean";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
actions: {
|
|
30
|
+
control: false;
|
|
31
|
+
};
|
|
32
|
+
metadata: {
|
|
33
|
+
control: {
|
|
34
|
+
type: "object";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
instruments: {
|
|
38
|
+
control: {
|
|
39
|
+
type: "object";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export default meta;
|
|
45
|
+
type Story = StoryObj<typeof meta>;
|
|
46
|
+
export declare const Base: Story;
|
|
47
|
+
export declare const EveryType: Story;
|
|
48
|
+
export declare const WithAndWithoutActions: Story;
|
|
49
|
+
export declare const DraggableAndStatic: Story;
|
|
50
|
+
export declare const ListVariant: Story;
|
|
51
|
+
export declare const CompactVariant: Story;
|
package/dist/web-ui-tailwind.css
CHANGED
|
@@ -1972,6 +1972,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
1972
1972
|
.ui\:max-w-\[560px\] {
|
|
1973
1973
|
max-width: 560px;
|
|
1974
1974
|
}
|
|
1975
|
+
.ui\:max-w-\[720px\] {
|
|
1976
|
+
max-width: 720px;
|
|
1977
|
+
}
|
|
1975
1978
|
.ui\:max-w-\[900px\] {
|
|
1976
1979
|
max-width: 900px;
|
|
1977
1980
|
}
|
|
@@ -4823,6 +4826,12 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
4823
4826
|
position: absolute;
|
|
4824
4827
|
}
|
|
4825
4828
|
}
|
|
4829
|
+
.ui\:after\:inset-0 {
|
|
4830
|
+
&::after {
|
|
4831
|
+
content: var(--tw-content);
|
|
4832
|
+
inset: 0px;
|
|
4833
|
+
}
|
|
4834
|
+
}
|
|
4826
4835
|
.ui\:after\:start-\[2px\] {
|
|
4827
4836
|
&::after {
|
|
4828
4837
|
content: var(--tw-content);
|