@techsio/ui-kit 0.52.0 → 0.53.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/molecules/availability-status.js +99 -0
- package/dist/molecules/price-block.js +122 -0
- package/dist/src/molecules/availability-status.d.ts +37 -0
- package/dist/src/molecules/availability-status.d.ts.map +1 -0
- package/dist/src/molecules/price-block.d.ts +84 -0
- package/dist/src/molecules/price-block.d.ts.map +1 -0
- package/dist/stories/changelog/changelog.stories.d.ts.map +1 -1
- package/dist/stories/molecules/availability-status.stories.d.ts +14 -0
- package/dist/stories/molecules/availability-status.stories.d.ts.map +1 -0
- package/dist/stories/molecules/price-block.stories.d.ts +14 -0
- package/dist/stories/molecules/price-block.stories.d.ts.map +1 -0
- package/dist/test/price-availability.spec.d.ts +2 -0
- package/dist/test/price-availability.spec.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/tokens/components/components.css +2 -0
- package/src/tokens/components/molecules/_availability-status.css +74 -0
- package/src/tokens/components/molecules/_price-block.css +35 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from "../atoms/icon.js";
|
|
3
|
+
import { Skeleton } from "../atoms/skeleton.js";
|
|
4
|
+
import { tv } from "../utils.js";
|
|
5
|
+
const availabilityStatusVariants = tv({
|
|
6
|
+
slots: {
|
|
7
|
+
root: "flex min-w-0 flex-col gap-availability-status",
|
|
8
|
+
summary: "flex min-w-0 items-start gap-availability-status-summary",
|
|
9
|
+
icon: "size-availability-status-icon shrink-0 self-start",
|
|
10
|
+
content: "flex min-w-0 flex-col gap-availability-status-content",
|
|
11
|
+
label: "break-words font-availability-status-label text-availability-status-label-size",
|
|
12
|
+
detail: "break-words text-availability-status-detail-fg text-availability-status-detail-size",
|
|
13
|
+
pending: "w-availability-status-pending max-w-full gap-availability-status-pending",
|
|
14
|
+
pendingLine: "h-availability-status-pending-line"
|
|
15
|
+
},
|
|
16
|
+
variants: {
|
|
17
|
+
status: {
|
|
18
|
+
available: {
|
|
19
|
+
icon: "text-availability-status-fg-available",
|
|
20
|
+
label: "text-availability-status-fg-available"
|
|
21
|
+
},
|
|
22
|
+
limited: {
|
|
23
|
+
icon: "text-availability-status-fg-limited",
|
|
24
|
+
label: "text-availability-status-fg-limited"
|
|
25
|
+
},
|
|
26
|
+
preorder: {
|
|
27
|
+
icon: "text-availability-status-fg-preorder",
|
|
28
|
+
label: "text-availability-status-fg-preorder"
|
|
29
|
+
},
|
|
30
|
+
unavailable: {
|
|
31
|
+
icon: "text-availability-status-fg-unavailable",
|
|
32
|
+
label: "text-availability-status-fg-unavailable"
|
|
33
|
+
},
|
|
34
|
+
unknown: {
|
|
35
|
+
icon: "text-availability-status-fg-unknown",
|
|
36
|
+
label: "text-availability-status-fg-unknown"
|
|
37
|
+
},
|
|
38
|
+
pending: {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const defaultIcons = {
|
|
43
|
+
available: "token-icon-availability-status-available",
|
|
44
|
+
limited: "token-icon-availability-status-limited",
|
|
45
|
+
preorder: "token-icon-availability-status-preorder",
|
|
46
|
+
unavailable: "token-icon-availability-status-unavailable",
|
|
47
|
+
unknown: "token-icon-availability-status-unknown"
|
|
48
|
+
};
|
|
49
|
+
function AvailabilityStatus({ status, label, detail, icon, showIcon = true, pendingLabel, className, ref, ...props }) {
|
|
50
|
+
const styles = availabilityStatusVariants({
|
|
51
|
+
status
|
|
52
|
+
});
|
|
53
|
+
return /*#__PURE__*/ jsx("div", {
|
|
54
|
+
className: styles.root({
|
|
55
|
+
className
|
|
56
|
+
}),
|
|
57
|
+
...props,
|
|
58
|
+
"data-status": status,
|
|
59
|
+
ref: ref,
|
|
60
|
+
children: "pending" === status ? /*#__PURE__*/ jsxs(Fragment, {
|
|
61
|
+
children: [
|
|
62
|
+
/*#__PURE__*/ jsx("span", {
|
|
63
|
+
className: "sr-only",
|
|
64
|
+
children: pendingLabel
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ jsx(Skeleton.Text, {
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
className: styles.pendingLine(),
|
|
69
|
+
containerClassName: styles.pending(),
|
|
70
|
+
isLoaded: false,
|
|
71
|
+
noOfLines: 2,
|
|
72
|
+
size: "sm"
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
}) : /*#__PURE__*/ jsxs("div", {
|
|
76
|
+
className: styles.summary(),
|
|
77
|
+
children: [
|
|
78
|
+
showIcon ? /*#__PURE__*/ jsx(Icon, {
|
|
79
|
+
className: styles.icon(),
|
|
80
|
+
icon: icon ?? defaultIcons[status]
|
|
81
|
+
}) : null,
|
|
82
|
+
/*#__PURE__*/ jsxs("div", {
|
|
83
|
+
className: styles.content(),
|
|
84
|
+
children: [
|
|
85
|
+
/*#__PURE__*/ jsx("span", {
|
|
86
|
+
className: styles.label(),
|
|
87
|
+
children: label
|
|
88
|
+
}),
|
|
89
|
+
detail ? /*#__PURE__*/ jsx("span", {
|
|
90
|
+
className: styles.detail(),
|
|
91
|
+
children: detail
|
|
92
|
+
}) : null
|
|
93
|
+
]
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export { AvailabilityStatus };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Badge } from "../atoms/badge.js";
|
|
3
|
+
import { Skeleton } from "../atoms/skeleton.js";
|
|
4
|
+
import { tv } from "../utils.js";
|
|
5
|
+
const priceBlockVariants = tv({
|
|
6
|
+
slots: {
|
|
7
|
+
root: "flex min-w-0 flex-col gap-price-block",
|
|
8
|
+
primaryRow: "flex min-w-0 flex-wrap items-baseline gap-price-block-primary",
|
|
9
|
+
prefix: "break-words text-price-block-prefix-fg text-price-block-prefix-size",
|
|
10
|
+
amount: "break-words font-price-block-amount text-price-block-amount-fg text-price-block-amount-size",
|
|
11
|
+
original: "break-words text-price-block-original-fg text-price-block-original-size",
|
|
12
|
+
metadata: "flex min-w-0 flex-wrap items-center gap-price-block-metadata text-price-block-metadata-fg text-price-block-metadata-size",
|
|
13
|
+
separator: "text-price-block-separator-fg",
|
|
14
|
+
detail: "break-words text-price-block-detail-fg text-price-block-detail-size",
|
|
15
|
+
pending: "w-price-block-pending max-w-full gap-price-block-pending",
|
|
16
|
+
pendingLine: "h-price-block-pending-line"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
function PriceMetadata({ taxLabel, unitLabel }) {
|
|
20
|
+
const styles = priceBlockVariants();
|
|
21
|
+
if (!(taxLabel || unitLabel)) return null;
|
|
22
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
23
|
+
className: styles.metadata(),
|
|
24
|
+
children: [
|
|
25
|
+
taxLabel ? /*#__PURE__*/ jsx("span", {
|
|
26
|
+
children: taxLabel
|
|
27
|
+
}) : null,
|
|
28
|
+
taxLabel && unitLabel ? /*#__PURE__*/ jsx("span", {
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: styles.separator(),
|
|
31
|
+
children: "\xb7"
|
|
32
|
+
}) : null,
|
|
33
|
+
unitLabel ? /*#__PURE__*/ jsx("span", {
|
|
34
|
+
children: unitLabel
|
|
35
|
+
}) : null
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function PriceBlock({ state, amountLabel, originalLabel, originalSrLabel, discountLabel, taxLabel, unitLabel, prefix, label, detail, pendingLabel, className, ref, ...props }) {
|
|
40
|
+
const styles = priceBlockVariants();
|
|
41
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
42
|
+
className: styles.root({
|
|
43
|
+
className
|
|
44
|
+
}),
|
|
45
|
+
...props,
|
|
46
|
+
"data-state": state,
|
|
47
|
+
ref: ref,
|
|
48
|
+
children: [
|
|
49
|
+
"pending" === state ? /*#__PURE__*/ jsxs(Fragment, {
|
|
50
|
+
children: [
|
|
51
|
+
/*#__PURE__*/ jsx("span", {
|
|
52
|
+
className: "sr-only",
|
|
53
|
+
children: pendingLabel
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ jsx(Skeleton.Text, {
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
className: styles.pendingLine(),
|
|
58
|
+
containerClassName: styles.pending(),
|
|
59
|
+
isLoaded: false,
|
|
60
|
+
noOfLines: 2,
|
|
61
|
+
size: "sm"
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}) : null,
|
|
65
|
+
"on-request" === state ? /*#__PURE__*/ jsxs(Fragment, {
|
|
66
|
+
children: [
|
|
67
|
+
/*#__PURE__*/ jsx("div", {
|
|
68
|
+
className: styles.primaryRow(),
|
|
69
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
70
|
+
className: styles.amount(),
|
|
71
|
+
children: label
|
|
72
|
+
})
|
|
73
|
+
}),
|
|
74
|
+
detail ? /*#__PURE__*/ jsx("span", {
|
|
75
|
+
className: styles.detail(),
|
|
76
|
+
children: detail
|
|
77
|
+
}) : null
|
|
78
|
+
]
|
|
79
|
+
}) : null,
|
|
80
|
+
"known" === state || "from" === state || "discounted" === state ? /*#__PURE__*/ jsxs(Fragment, {
|
|
81
|
+
children: [
|
|
82
|
+
/*#__PURE__*/ jsxs("div", {
|
|
83
|
+
className: styles.primaryRow(),
|
|
84
|
+
children: [
|
|
85
|
+
"from" === state ? /*#__PURE__*/ jsx("span", {
|
|
86
|
+
className: styles.prefix(),
|
|
87
|
+
children: prefix
|
|
88
|
+
}) : null,
|
|
89
|
+
/*#__PURE__*/ jsx("span", {
|
|
90
|
+
className: styles.amount(),
|
|
91
|
+
children: amountLabel
|
|
92
|
+
}),
|
|
93
|
+
"discounted" === state ? /*#__PURE__*/ jsxs("del", {
|
|
94
|
+
className: styles.original(),
|
|
95
|
+
children: [
|
|
96
|
+
/*#__PURE__*/ jsxs("span", {
|
|
97
|
+
className: "sr-only",
|
|
98
|
+
children: [
|
|
99
|
+
originalSrLabel,
|
|
100
|
+
" "
|
|
101
|
+
]
|
|
102
|
+
}),
|
|
103
|
+
originalLabel
|
|
104
|
+
]
|
|
105
|
+
}) : null,
|
|
106
|
+
"discounted" === state && discountLabel ? /*#__PURE__*/ jsx(Badge, {
|
|
107
|
+
size: "sm",
|
|
108
|
+
variant: "discount",
|
|
109
|
+
children: discountLabel
|
|
110
|
+
}) : null
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
/*#__PURE__*/ jsx(PriceMetadata, {
|
|
114
|
+
taxLabel: taxLabel,
|
|
115
|
+
unitLabel: unitLabel
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}) : null
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
export { PriceBlock };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvailabilityStatus — @techsio/ui-kit molecule.
|
|
3
|
+
*
|
|
4
|
+
* @component AvailabilityStatus
|
|
5
|
+
* @componentVersion v1.0.0
|
|
6
|
+
* @skill availability-status-usage
|
|
7
|
+
* @changelog libs/ui/stories/changelog/changelog.stories.tsx
|
|
8
|
+
*
|
|
9
|
+
* Versioning is enforced at commit by scripts/check-skill-sync.mjs: @componentVersion must match
|
|
10
|
+
* the availability-status-usage skill's component_version and a changelog entry. Bump all three together.
|
|
11
|
+
*/
|
|
12
|
+
import type { HTMLAttributes, Ref } from "react";
|
|
13
|
+
import { type IconType } from "../atoms/icon.js";
|
|
14
|
+
type AvailabilityStatusNativeProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
15
|
+
ref?: Ref<HTMLDivElement>;
|
|
16
|
+
};
|
|
17
|
+
type SettledAvailability = "available" | "limited" | "preorder" | "unavailable" | "unknown";
|
|
18
|
+
type SettledAvailabilityProps = {
|
|
19
|
+
status: SettledAvailability;
|
|
20
|
+
label: string;
|
|
21
|
+
detail?: string;
|
|
22
|
+
icon?: IconType;
|
|
23
|
+
showIcon?: boolean;
|
|
24
|
+
pendingLabel?: never;
|
|
25
|
+
};
|
|
26
|
+
type PendingAvailabilityProps = {
|
|
27
|
+
status: "pending";
|
|
28
|
+
pendingLabel: string;
|
|
29
|
+
label?: never;
|
|
30
|
+
detail?: never;
|
|
31
|
+
icon?: never;
|
|
32
|
+
showIcon?: never;
|
|
33
|
+
};
|
|
34
|
+
export type AvailabilityStatusProps = AvailabilityStatusNativeProps & (SettledAvailabilityProps | PendingAvailabilityProps);
|
|
35
|
+
export declare function AvailabilityStatus({ status, label, detail, icon, showIcon, pendingLabel, className, ref, ...props }: AvailabilityStatusProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=availability-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability-status.d.ts","sourceRoot":"","sources":["../../../src/molecules/availability-status.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAqDnD,KAAK,6BAA6B,GAAG,IAAI,CACxC,cAAc,CAAC,cAAc,CAAC,EAC9B,UAAU,CACV,GAAG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CACzB,CAAA;AAED,KAAK,mBAAmB,GACrB,WAAW,GACX,SAAS,GACT,UAAU,GACV,aAAa,GACb,SAAS,CAAA;AAEZ,KAAK,wBAAwB,GAAG;IAC/B,MAAM,EAAE,mBAAmB,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,KAAK,CAAA;CACpB,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC/B,MAAM,EAAE,SAAS,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,6BAA6B,GAClE,CAAC,wBAAwB,GAAG,wBAAwB,CAAC,CAAA;AAEtD,wBAAgB,kBAAkB,CAAC,EAClC,MAAM,EACN,KAAK,EACL,MAAM,EACN,IAAI,EACJ,QAAe,EACf,YAAY,EACZ,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACR,EAAE,uBAAuB,2CAsCzB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PriceBlock — @techsio/ui-kit molecule.
|
|
3
|
+
*
|
|
4
|
+
* @component PriceBlock
|
|
5
|
+
* @componentVersion v1.0.0
|
|
6
|
+
* @skill price-block-usage
|
|
7
|
+
* @changelog libs/ui/stories/changelog/changelog.stories.tsx
|
|
8
|
+
*
|
|
9
|
+
* Versioning is enforced at commit by scripts/check-skill-sync.mjs: @componentVersion must match
|
|
10
|
+
* the price-block-usage skill's component_version and a changelog entry. Bump all three together.
|
|
11
|
+
*/
|
|
12
|
+
import type { HTMLAttributes, Ref } from "react";
|
|
13
|
+
type PriceBlockNativeProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
14
|
+
ref?: Ref<HTMLDivElement>;
|
|
15
|
+
};
|
|
16
|
+
type KnownPriceProps = {
|
|
17
|
+
state: "known";
|
|
18
|
+
amountLabel: string;
|
|
19
|
+
taxLabel?: string;
|
|
20
|
+
unitLabel?: string;
|
|
21
|
+
prefix?: never;
|
|
22
|
+
originalLabel?: never;
|
|
23
|
+
originalSrLabel?: never;
|
|
24
|
+
discountLabel?: never;
|
|
25
|
+
label?: never;
|
|
26
|
+
detail?: never;
|
|
27
|
+
pendingLabel?: never;
|
|
28
|
+
};
|
|
29
|
+
type FromPriceProps = {
|
|
30
|
+
state: "from";
|
|
31
|
+
prefix: string;
|
|
32
|
+
amountLabel: string;
|
|
33
|
+
taxLabel?: string;
|
|
34
|
+
unitLabel?: string;
|
|
35
|
+
originalLabel?: never;
|
|
36
|
+
originalSrLabel?: never;
|
|
37
|
+
discountLabel?: never;
|
|
38
|
+
label?: never;
|
|
39
|
+
detail?: never;
|
|
40
|
+
pendingLabel?: never;
|
|
41
|
+
};
|
|
42
|
+
type DiscountedPriceProps = {
|
|
43
|
+
state: "discounted";
|
|
44
|
+
amountLabel: string;
|
|
45
|
+
originalLabel: string;
|
|
46
|
+
originalSrLabel: string;
|
|
47
|
+
discountLabel?: string;
|
|
48
|
+
taxLabel?: string;
|
|
49
|
+
unitLabel?: string;
|
|
50
|
+
prefix?: never;
|
|
51
|
+
label?: never;
|
|
52
|
+
detail?: never;
|
|
53
|
+
pendingLabel?: never;
|
|
54
|
+
};
|
|
55
|
+
type OnRequestPriceProps = {
|
|
56
|
+
state: "on-request";
|
|
57
|
+
label: string;
|
|
58
|
+
detail?: string;
|
|
59
|
+
amountLabel?: never;
|
|
60
|
+
originalLabel?: never;
|
|
61
|
+
originalSrLabel?: never;
|
|
62
|
+
discountLabel?: never;
|
|
63
|
+
taxLabel?: never;
|
|
64
|
+
unitLabel?: never;
|
|
65
|
+
prefix?: never;
|
|
66
|
+
pendingLabel?: never;
|
|
67
|
+
};
|
|
68
|
+
type PendingPriceProps = {
|
|
69
|
+
state: "pending";
|
|
70
|
+
pendingLabel: string;
|
|
71
|
+
amountLabel?: never;
|
|
72
|
+
originalLabel?: never;
|
|
73
|
+
originalSrLabel?: never;
|
|
74
|
+
discountLabel?: never;
|
|
75
|
+
taxLabel?: never;
|
|
76
|
+
unitLabel?: never;
|
|
77
|
+
prefix?: never;
|
|
78
|
+
label?: never;
|
|
79
|
+
detail?: never;
|
|
80
|
+
};
|
|
81
|
+
export type PriceBlockProps = PriceBlockNativeProps & (KnownPriceProps | FromPriceProps | DiscountedPriceProps | OnRequestPriceProps | PendingPriceProps);
|
|
82
|
+
export declare function PriceBlock({ state, amountLabel, originalLabel, originalSrLabel, discountLabel, taxLabel, unitLabel, prefix, label, detail, pendingLabel, className, ref, ...props }: PriceBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=price-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price-block.d.ts","sourceRoot":"","sources":["../../../src/molecules/price-block.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.stories.d.ts","sourceRoot":"","sources":["../../../stories/changelog/changelog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"changelog.stories.d.ts","sourceRoot":"","sources":["../../../stories/changelog/changelog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAiStD,iBAAS,SAAS,4CAUjB;AAED,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAKhC,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,SAAS,CAAM,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { AvailabilityStatus, type AvailabilityStatusProps } from "../../src/molecules/availability-status.js";
|
|
3
|
+
declare const meta: Meta<typeof AvailabilityStatus>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = Omit<StoryObj<typeof meta>, "args"> & {
|
|
6
|
+
args?: Partial<AvailabilityStatusProps>;
|
|
7
|
+
};
|
|
8
|
+
type PlaygroundStory = StoryObj<Extract<AvailabilityStatusProps, {
|
|
9
|
+
label: string;
|
|
10
|
+
}>>;
|
|
11
|
+
export declare const Playground: PlaygroundStory;
|
|
12
|
+
export declare const States: Story;
|
|
13
|
+
export declare const LongContent: Story;
|
|
14
|
+
//# sourceMappingURL=availability-status.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability-status.stories.d.ts","sourceRoot":"","sources":["../../../stories/molecules/availability-status.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC7B,MAAM,yCAAyC,CAAA;AAGhD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAOzC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,EAAE,MAAM,CAAC,GAAG;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAA;CACxC,CAAA;AACD,KAAK,eAAe,GAAG,QAAQ,CAC7B,OAAO,CAAC,uBAAuB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CACpD,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,eAqBxB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KA6CpB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAqBzB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { PriceBlock, type PriceBlockProps } from "../../src/molecules/price-block.js";
|
|
3
|
+
declare const meta: Meta<typeof PriceBlock>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = Omit<StoryObj<typeof meta>, "args"> & {
|
|
6
|
+
args?: Partial<PriceBlockProps>;
|
|
7
|
+
};
|
|
8
|
+
type PlaygroundStory = StoryObj<Extract<PriceBlockProps, {
|
|
9
|
+
state: "discounted";
|
|
10
|
+
}>>;
|
|
11
|
+
export declare const Playground: PlaygroundStory;
|
|
12
|
+
export declare const States: Story;
|
|
13
|
+
export declare const LongContent: Story;
|
|
14
|
+
//# sourceMappingURL=price-block.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price-block.stories.d.ts","sourceRoot":"","sources":["../../../stories/molecules/price-block.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EACN,UAAU,EACV,KAAK,eAAe,EACpB,MAAM,iCAAiC,CAAA;AAExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAOjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,EAAE,MAAM,CAAC,GAAG;IAClD,IAAI,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAC/B,CAAA;AACD,KAAK,eAAe,GAAG,QAAQ,CAC9B,OAAO,CAAC,eAAe,EAAE;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,CAAC,CACjD,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,eAuBxB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAkCpB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAkCzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price-availability.spec.d.ts","sourceRoot":"","sources":["../../test/price-availability.spec.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
@import "./atoms/_tooltip.css";
|
|
19
19
|
|
|
20
20
|
@import "./molecules/_accordion.css";
|
|
21
|
+
@import "./molecules/_availability-status.css";
|
|
21
22
|
@import "./molecules/_breadcrumb.css";
|
|
22
23
|
@import "./molecules/_carousel.css";
|
|
23
24
|
@import "./molecules/_cascade-select.css";
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
@import "./molecules/_form-error-summary.css";
|
|
33
34
|
@import "./molecules/_pagination.css";
|
|
34
35
|
@import "./molecules/_popover.css";
|
|
36
|
+
@import "./molecules/_price-block.css";
|
|
35
37
|
@import "./molecules/_radio-card.css";
|
|
36
38
|
@import "./molecules/_radio-group.css";
|
|
37
39
|
@import "./molecules/_menu.css";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
@theme static {
|
|
2
|
+
/* Reference layer */
|
|
3
|
+
--color-availability-status-available: var(--color-fg-status-success);
|
|
4
|
+
--color-availability-status-limited: var(--color-fg-status-warning);
|
|
5
|
+
--color-availability-status-preorder: var(--color-fg-accent-primary);
|
|
6
|
+
--color-availability-status-unavailable: var(--color-fg-status-error);
|
|
7
|
+
--color-availability-status-unknown: var(--color-fg-secondary);
|
|
8
|
+
--color-availability-status-muted: var(--color-fg-secondary);
|
|
9
|
+
|
|
10
|
+
--spacing-availability-status-compact: var(--spacing-100);
|
|
11
|
+
--spacing-availability-status-icon-base: var(--spacing-250);
|
|
12
|
+
--spacing-availability-status-pending-line-base: var(--spacing-250);
|
|
13
|
+
--spacing-availability-status-pending-width-base: calc(
|
|
14
|
+
var(--spacing-950) *
|
|
15
|
+
2
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
/* Derived color layer */
|
|
19
|
+
--color-availability-status-fg-available: var(
|
|
20
|
+
--color-availability-status-available
|
|
21
|
+
);
|
|
22
|
+
--color-availability-status-fg-limited: var(
|
|
23
|
+
--color-availability-status-limited
|
|
24
|
+
);
|
|
25
|
+
--color-availability-status-fg-preorder: var(
|
|
26
|
+
--color-availability-status-preorder
|
|
27
|
+
);
|
|
28
|
+
--color-availability-status-fg-unavailable: var(
|
|
29
|
+
--color-availability-status-unavailable
|
|
30
|
+
);
|
|
31
|
+
--color-availability-status-fg-unknown: var(
|
|
32
|
+
--color-availability-status-unknown
|
|
33
|
+
);
|
|
34
|
+
--color-availability-status-detail-fg: var(--color-availability-status-muted);
|
|
35
|
+
|
|
36
|
+
/* Derived layout and typography layer */
|
|
37
|
+
--gap-availability-status: var(--spacing-availability-status-compact);
|
|
38
|
+
--gap-availability-status-summary: var(--spacing-availability-status-compact);
|
|
39
|
+
--gap-availability-status-content: var(--spacing-availability-status-compact);
|
|
40
|
+
--gap-availability-status-pending: var(--spacing-availability-status-compact);
|
|
41
|
+
--spacing-availability-status-icon: var(
|
|
42
|
+
--spacing-availability-status-icon-base
|
|
43
|
+
);
|
|
44
|
+
--spacing-availability-status-pending-line: var(
|
|
45
|
+
--spacing-availability-status-pending-line-base
|
|
46
|
+
);
|
|
47
|
+
--spacing-availability-status-pending: var(
|
|
48
|
+
--spacing-availability-status-pending-width-base
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
--text-availability-status-label-size: var(--text-sm);
|
|
52
|
+
--text-availability-status-detail-size: var(--text-xs);
|
|
53
|
+
--font-weight-availability-status-label: var(--font-weight-medium);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@utility token-icon-availability-status-available {
|
|
57
|
+
@apply token-icon-check-circle;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@utility token-icon-availability-status-limited {
|
|
61
|
+
@apply token-icon-alert;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@utility token-icon-availability-status-preorder {
|
|
65
|
+
@apply icon-[mdi--clock-outline];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@utility token-icon-availability-status-unavailable {
|
|
69
|
+
@apply icon-[mdi--close-circle-outline];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@utility token-icon-availability-status-unknown {
|
|
73
|
+
@apply icon-[mdi--help-circle-outline];
|
|
74
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@theme static {
|
|
2
|
+
/* Reference layer */
|
|
3
|
+
--color-price-block-content: var(--color-fg-primary);
|
|
4
|
+
--color-price-block-muted: var(--color-fg-secondary);
|
|
5
|
+
|
|
6
|
+
--spacing-price-block-compact: var(--spacing-50);
|
|
7
|
+
--spacing-price-block-related: var(--spacing-100);
|
|
8
|
+
--spacing-price-block-pending-line-base: var(--spacing-350);
|
|
9
|
+
--spacing-price-block-pending-width-base: calc(var(--spacing-950) * 2);
|
|
10
|
+
|
|
11
|
+
/* Derived color layer */
|
|
12
|
+
--color-price-block-amount-fg: var(--color-price-block-content);
|
|
13
|
+
--color-price-block-prefix-fg: var(--color-price-block-muted);
|
|
14
|
+
--color-price-block-original-fg: var(--color-price-block-muted);
|
|
15
|
+
--color-price-block-metadata-fg: var(--color-price-block-muted);
|
|
16
|
+
--color-price-block-separator-fg: var(--color-price-block-muted);
|
|
17
|
+
--color-price-block-detail-fg: var(--color-price-block-muted);
|
|
18
|
+
|
|
19
|
+
/* Derived layout and typography layer */
|
|
20
|
+
--gap-price-block: var(--spacing-price-block-related);
|
|
21
|
+
--gap-price-block-primary: var(--spacing-price-block-related);
|
|
22
|
+
--gap-price-block-metadata: var(--spacing-price-block-compact);
|
|
23
|
+
--gap-price-block-pending: var(--spacing-price-block-compact);
|
|
24
|
+
--spacing-price-block-pending-line: var(
|
|
25
|
+
--spacing-price-block-pending-line-base
|
|
26
|
+
);
|
|
27
|
+
--spacing-price-block-pending: var(--spacing-price-block-pending-width-base);
|
|
28
|
+
|
|
29
|
+
--text-price-block-amount-size: var(--text-lg);
|
|
30
|
+
--text-price-block-prefix-size: var(--text-sm);
|
|
31
|
+
--text-price-block-original-size: var(--text-sm);
|
|
32
|
+
--text-price-block-metadata-size: var(--text-xs);
|
|
33
|
+
--text-price-block-detail-size: var(--text-sm);
|
|
34
|
+
--font-weight-price-block-amount: var(--font-weight-medium);
|
|
35
|
+
}
|