@vkzstudio/muza-ui 1.1.0 → 1.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.
- package/dist/components/Accordion/Accordion.d.ts +52 -2
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +111 -76
- package/dist/components/ArticleCard/ArticleCard.d.ts +178 -0
- package/dist/components/ArticleCard/ArticleCard.d.ts.map +1 -0
- package/dist/components/ArticleCard/ArticleCard.js +542 -0
- package/dist/components/ArticleCard/ArticleCard.stories.d.ts +14 -0
- package/dist/components/ArticleCard/ArticleCard.stories.d.ts.map +1 -0
- package/dist/components/ArticleCard/index.d.ts +2 -0
- package/dist/components/ArticleCard/index.d.ts.map +1 -0
- package/dist/components/ButtonArrow/ButtonArrow.js +1 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +5 -5
- package/dist/components/Calendar/index.d.ts +1 -2
- package/dist/components/Calendar/index.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +9 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +135 -133
- package/dist/components/CarouselSection/CarouselSection.examples.d.ts +34 -0
- package/dist/components/CarouselSection/CarouselSection.examples.d.ts.map +1 -0
- package/dist/components/CarouselSection/CarouselSection.stories.d.ts +8 -0
- package/dist/components/CarouselSection/CarouselSection.stories.d.ts.map +1 -0
- package/dist/components/CategoryCard/CategoryCard.d.ts +97 -0
- package/dist/components/CategoryCard/CategoryCard.d.ts.map +1 -0
- package/dist/components/CategoryCard/CategoryCard.js +152 -0
- package/dist/components/CategoryCard/CategoryCard.stories.d.ts +14 -0
- package/dist/components/CategoryCard/CategoryCard.stories.d.ts.map +1 -0
- package/dist/components/CategoryCard/index.d.ts +2 -0
- package/dist/components/CategoryCard/index.d.ts.map +1 -0
- package/dist/components/CategoryIcon/CategoryIcon.d.ts +45 -0
- package/dist/components/CategoryIcon/CategoryIcon.d.ts.map +1 -0
- package/dist/components/CategoryIcon/CategoryIcon.js +54 -0
- package/dist/components/CategoryIcon/CategoryIcon.stories.d.ts +10 -0
- package/dist/components/CategoryIcon/CategoryIcon.stories.d.ts.map +1 -0
- package/dist/components/CategoryIcon/index.d.ts +2 -0
- package/dist/components/CategoryIcon/index.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +5 -5
- package/dist/components/DotDivider/DotDivider.d.ts +35 -0
- package/dist/components/DotDivider/DotDivider.d.ts.map +1 -0
- package/dist/components/DotDivider/DotDivider.js +31 -0
- package/dist/components/DotDivider/DotDivider.stories.d.ts +10 -0
- package/dist/components/DotDivider/DotDivider.stories.d.ts.map +1 -0
- package/dist/components/DotDivider/index.d.ts +2 -0
- package/dist/components/DotDivider/index.d.ts.map +1 -0
- package/dist/components/HeartButton/HeartButton.d.ts +61 -0
- package/dist/components/HeartButton/HeartButton.d.ts.map +1 -0
- package/dist/components/HeartButton/HeartButton.js +88 -0
- package/dist/components/HeartButton/HeartButton.stories.d.ts +10 -0
- package/dist/components/HeartButton/HeartButton.stories.d.ts.map +1 -0
- package/dist/components/HeartButton/index.d.ts +2 -0
- package/dist/components/HeartButton/index.d.ts.map +1 -0
- package/dist/components/Icons/CustomBadges.d.ts +20 -0
- package/dist/components/Icons/CustomBadges.d.ts.map +1 -1
- package/dist/components/Icons/CustomBadges.js +176 -21
- package/dist/components/Icons/CustomIcons.d.ts +13 -0
- package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +50 -30
- package/dist/components/Icons/LogosAndBadges.stories.d.ts +2 -1
- package/dist/components/Icons/LogosAndBadges.stories.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.js +65 -55
- package/dist/components/LoginScreen/LoginScreen.d.ts +21 -2
- package/dist/components/LoginScreen/LoginScreen.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreen.js +32 -26
- package/dist/components/LoginScreen/LoginScreen.stories.d.ts +2 -2
- package/dist/components/LoginScreen/LoginScreen.stories.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/OfferCard/OfferCard.d.ts +206 -0
- package/dist/components/OfferCard/OfferCard.d.ts.map +1 -0
- package/dist/components/OfferCard/OfferCard.js +423 -0
- package/dist/components/OfferCard/OfferCard.stories.d.ts +15 -0
- package/dist/components/OfferCard/OfferCard.stories.d.ts.map +1 -0
- package/dist/components/OfferCard/index.d.ts +2 -0
- package/dist/components/OfferCard/index.d.ts.map +1 -0
- package/dist/components/PartnerCard/PartnerCard.d.ts +234 -0
- package/dist/components/PartnerCard/PartnerCard.d.ts.map +1 -0
- package/dist/components/PartnerCard/PartnerCard.js +591 -0
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts +14 -0
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts.map +1 -0
- package/dist/components/PartnerCard/index.d.ts +2 -0
- package/dist/components/PartnerCard/index.d.ts.map +1 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.examples.d.ts +35 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.examples.d.ts.map +1 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.stories.d.ts +11 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.stories.d.ts.map +1 -0
- package/dist/components/Rating/Rating.d.ts +62 -0
- package/dist/components/Rating/Rating.d.ts.map +1 -0
- package/dist/components/Rating/Rating.js +88 -0
- package/dist/components/Rating/Rating.stories.d.ts +12 -0
- package/dist/components/Rating/Rating.stories.d.ts.map +1 -0
- package/dist/components/Rating/index.d.ts +2 -0
- package/dist/components/Rating/index.d.ts.map +1 -0
- package/dist/components/RatingBlock/RatingBlock.d.ts +65 -0
- package/dist/components/RatingBlock/RatingBlock.d.ts.map +1 -0
- package/dist/components/RatingBlock/RatingBlock.js +92 -0
- package/dist/components/RatingBlock/RatingBlock.stories.d.ts +12 -0
- package/dist/components/RatingBlock/RatingBlock.stories.d.ts.map +1 -0
- package/dist/components/RatingBlock/index.d.ts +2 -0
- package/dist/components/RatingBlock/index.d.ts.map +1 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.js +5 -5
- package/dist/components/SearchFilters/SearchFilters.d.ts +88 -0
- package/dist/components/SearchFilters/SearchFilters.d.ts.map +1 -0
- package/dist/components/SearchFilters/SearchFilters.js +176 -0
- package/dist/components/SearchFilters/SearchFilters.stories.d.ts +12 -0
- package/dist/components/SearchFilters/SearchFilters.stories.d.ts.map +1 -0
- package/dist/components/SearchFilters/index.d.ts +2 -0
- package/dist/components/SearchFilters/index.d.ts.map +1 -0
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/TransactionsListView/TransactionsListView.d.ts +152 -0
- package/dist/components/TransactionsListView/TransactionsListView.d.ts.map +1 -0
- package/dist/components/TransactionsListView/TransactionsListView.js +367 -0
- package/dist/components/TransactionsListView/TransactionsListView.stories.d.ts +12 -0
- package/dist/components/TransactionsListView/TransactionsListView.stories.d.ts.map +1 -0
- package/dist/components/TransactionsListView/index.d.ts +2 -0
- package/dist/components/TransactionsListView/index.d.ts.map +1 -0
- package/dist/components/VoucherCard/VoucherCard.d.ts +105 -0
- package/dist/components/VoucherCard/VoucherCard.d.ts.map +1 -0
- package/dist/components/VoucherCard/VoucherCard.js +167 -0
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts +9 -0
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts.map +1 -0
- package/dist/components/VoucherCard/index.d.ts +2 -0
- package/dist/components/VoucherCard/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +405 -352
- package/dist/muza-ui.css +1 -1
- package/dist/styles/primitives.css +5 -0
- package/dist/styles/token-colors.css +105 -30
- package/dist/styles/token-sizes.css +24 -0
- package/dist/translations/index.d.ts +2 -1
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/locales/cs.d.ts.map +1 -1
- package/dist/translations/locales/cs.js +30 -2
- package/dist/translations/locales/en.d.ts.map +1 -1
- package/dist/translations/locales/en.js +26 -2
- package/dist/translations/locales/sk.d.ts.map +1 -1
- package/dist/translations/locales/sk.js +30 -2
- package/dist/translations/resolvePluralTemplate.d.ts +10 -0
- package/dist/translations/resolvePluralTemplate.d.ts.map +1 -0
- package/dist/translations/resolvePluralTemplate.js +20 -0
- package/dist/translations/types.d.ts +57 -0
- package/dist/translations/types.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +116 -24
- package/dist/utils/disabledLinkProps.d.ts +14 -0
- package/dist/utils/disabledLinkProps.d.ts.map +1 -0
- package/dist/utils/disabledLinkProps.js +9 -0
- package/dist/{components/Calendar/utils → utils}/formatDate.d.ts +1 -1
- package/dist/utils/formatDate.d.ts.map +1 -0
- package/dist/utils/formatDateRange.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/Calendar/utils/formatDate.d.ts.map +0 -1
- package/dist/components/Calendar/utils/formatDateRange.d.ts.map +0 -1
- /package/dist/{components/Calendar/utils → utils}/formatDate.js +0 -0
- /package/dist/{components/Calendar/utils → utils}/formatDateRange.d.ts +0 -0
- /package/dist/{components/Calendar/utils → utils}/formatDateRange.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AccordionMultipleProps as RadixAccordionMultipleProps, AccordionSingleProps as RadixAccordionSingleProps } from '@radix-ui/react-accordion';
|
|
2
|
+
import { IconProps } from '../Icons';
|
|
2
3
|
import { TypographyProps } from '../Typography';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
@@ -128,6 +129,15 @@ export interface AccordionHeaderProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
128
129
|
* </AccordionHeader>
|
|
129
130
|
*/
|
|
130
131
|
headerActions?: React.ReactNode;
|
|
132
|
+
/**
|
|
133
|
+
* Suppresses the auto-injected expand/collapse chevron. Use when the
|
|
134
|
+
* header layout needs to position the chevron itself (e.g. inside a
|
|
135
|
+
* grid cell or paired with sibling content) — render your own chevron
|
|
136
|
+
* and rotate it on `data-state=open` via `group-data-[state=open]`.
|
|
137
|
+
*
|
|
138
|
+
* @default false
|
|
139
|
+
*/
|
|
140
|
+
hideDefaultChevron?: boolean;
|
|
131
141
|
}
|
|
132
142
|
/**
|
|
133
143
|
* Props for the AccordionContent component.
|
|
@@ -144,6 +154,27 @@ export type AccordionContentProps = React.ComponentProps<typeof AccordionPrimiti
|
|
|
144
154
|
* trigger, so the accordion does not toggle when the footer is activated.
|
|
145
155
|
*/
|
|
146
156
|
export type AccordionFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
157
|
+
/**
|
|
158
|
+
* Props for the AccordionChevron component.
|
|
159
|
+
*
|
|
160
|
+
* Renders the expand/collapse chevron icon with the rotation, sizing, and
|
|
161
|
+
* disabled-state coloring already wired up. Pair with `hideDefaultChevron`
|
|
162
|
+
* on `AccordionHeader` when the header layout needs to position the
|
|
163
|
+
* chevron itself (inside a grid cell, alongside sibling content, etc.).
|
|
164
|
+
*
|
|
165
|
+
* The chevron must be rendered inside an `AccordionHeader` so it can read
|
|
166
|
+
* the trigger's `data-state` and toggle rotation via `group-data-[state=open]`.
|
|
167
|
+
*
|
|
168
|
+
* Forwards every prop accepted by the underlying Solar icon (className,
|
|
169
|
+
* style, aria attributes, event handlers).
|
|
170
|
+
*/
|
|
171
|
+
export type AccordionChevronProps = Omit<IconProps, 'ref'> & {
|
|
172
|
+
/**
|
|
173
|
+
* Visual variant — overrides the surrounding Accordion's variant.
|
|
174
|
+
* @see AccordionVariant
|
|
175
|
+
*/
|
|
176
|
+
variant?: AccordionVariant;
|
|
177
|
+
};
|
|
147
178
|
/**
|
|
148
179
|
* Props for the AccordionTitle component.
|
|
149
180
|
*
|
|
@@ -171,6 +202,9 @@ declare const accordionItemVariants: (props?: ({
|
|
|
171
202
|
declare const accordionTriggerVariants: (props?: ({
|
|
172
203
|
variant?: "default" | "inline" | "branded" | "settings" | null | undefined;
|
|
173
204
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
205
|
+
declare const accordionChevronVariants: (props?: ({
|
|
206
|
+
variant?: "default" | "inline" | "branded" | "settings" | null | undefined;
|
|
207
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
174
208
|
declare const accordionTitleVariants: (props?: ({
|
|
175
209
|
variant?: "default" | "inline" | "branded" | "settings" | null | undefined;
|
|
176
210
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -182,7 +216,7 @@ declare const accordionFooterVariants: (props?: ({
|
|
|
182
216
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
183
217
|
declare const Accordion: ({ className, variant: variantProp, ...props }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
184
218
|
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
185
|
-
declare const AccordionHeader: ({ className, children, headerActions, ...props }: AccordionHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
219
|
+
declare const AccordionHeader: ({ className, children, headerActions, hideDefaultChevron, ...props }: AccordionHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
186
220
|
declare const AccordionContent: ({ className, children, ...props }: AccordionContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
187
221
|
/**
|
|
188
222
|
* Standardized title slot for `AccordionHeader`. Owns the hover highlight via
|
|
@@ -204,6 +238,22 @@ declare const AccordionContent: ({ className, children, ...props }: AccordionCon
|
|
|
204
238
|
* </AccordionHeader>
|
|
205
239
|
*/
|
|
206
240
|
declare const AccordionTitle: ({ className, component, variant: typographyVariant, weight, size, fixY, ...props }: AccordionTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
241
|
+
/**
|
|
242
|
+
* Standalone chevron icon for `AccordionHeader`. Use together with
|
|
243
|
+
* `hideDefaultChevron` to take control of the chevron's placement (e.g.
|
|
244
|
+
* to position it inside a grid cell or alongside sibling content).
|
|
245
|
+
*
|
|
246
|
+
* Rotation, sizing, and disabled-state coloring are wired up to the
|
|
247
|
+
* surrounding trigger via `group-data-[state=open]` and
|
|
248
|
+
* `group-data-[disabled]`.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* <AccordionHeader hideDefaultChevron className="grid grid-cols-[1fr_auto]">
|
|
252
|
+
* <AccordionTitle>Section title</AccordionTitle>
|
|
253
|
+
* <AccordionChevron className="self-center" />
|
|
254
|
+
* </AccordionHeader>
|
|
255
|
+
*/
|
|
256
|
+
declare const AccordionChevron: ({ className, variant: variantProp, ...props }: AccordionChevronProps) => import("react/jsx-runtime").JSX.Element;
|
|
207
257
|
/**
|
|
208
258
|
* Renders below the content but stays visible regardless of the open state.
|
|
209
259
|
* Use for actions (buttons, links) that should be reachable even when the
|
|
@@ -220,5 +270,5 @@ declare const AccordionTitle: ({ className, component, variant: typographyVarian
|
|
|
220
270
|
* </AccordionItem>
|
|
221
271
|
*/
|
|
222
272
|
declare const AccordionFooter: ({ className, children, onClick, ...props }: AccordionFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
223
|
-
export { Accordion, AccordionContent, AccordionFooter, AccordionHeader, AccordionItem, AccordionTitle, accordionItemVariants, accordionTriggerVariants, accordionContentInnerVariants, accordionFooterVariants, accordionTitleVariants, };
|
|
273
|
+
export { Accordion, AccordionChevron, AccordionContent, AccordionFooter, AccordionHeader, AccordionItem, AccordionTitle, accordionChevronVariants, accordionItemVariants, accordionTriggerVariants, accordionContentInnerVariants, accordionFooterVariants, accordionTitleVariants, };
|
|
224
274
|
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EACL,KAAK,sBAAsB,IAAI,2BAA2B,EAC1D,KAAK,oBAAoB,IAAI,yBAAyB,EACvD,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EACL,KAAK,sBAAsB,IAAI,2BAA2B,EAC1D,KAAK,oBAAoB,IAAI,yBAAyB,EACvD,MAAM,2BAA2B,CAAA;AAGlC,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAEhE;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAA;AAE5E,mEAAmE;AACnE,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB;IACrE,yDAAyD;IACzD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,0DAA0D;IAC1D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,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,GACvB,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as b } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import { cva as
|
|
3
|
+
import * as g from "@radix-ui/react-accordion";
|
|
4
|
+
import { cva as p } from "class-variance-authority";
|
|
5
5
|
import { Typography as I } from "../Typography/Typography.js";
|
|
6
|
-
import { cn as
|
|
7
|
-
import { AltArrowDownOutline as
|
|
8
|
-
const N =
|
|
6
|
+
import { cn as i } from "../../utils/cn.js";
|
|
7
|
+
import { AltArrowDownOutline as A } from "@solar-icons/react-perf";
|
|
8
|
+
const N = p("relative w-full transition-colors", {
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
11
|
default: "rounded-comp-accordion-default-radius border border-stroke-base-primary bg-surface-base-secondary px-comp-accordion-default-p py-comp-accordion-default-p-ver has-[[data-slot=accordion-trigger]:hover]:border-stroke-brand-hover",
|
|
@@ -15,7 +15,7 @@ const N = u("relative w-full transition-colors", {
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: { variant: "default" }
|
|
18
|
-
}),
|
|
18
|
+
}), V = p(
|
|
19
19
|
"group flex w-full cursor-pointer items-center justify-between gap-4 transition-all outline-none [&[data-state=open]>svg]:rotate-180",
|
|
20
20
|
{
|
|
21
21
|
variants: {
|
|
@@ -28,7 +28,25 @@ const N = u("relative w-full transition-colors", {
|
|
|
28
28
|
},
|
|
29
29
|
defaultVariants: { variant: "default" }
|
|
30
30
|
}
|
|
31
|
-
),
|
|
31
|
+
), P = p(
|
|
32
|
+
i(
|
|
33
|
+
"shrink-0 text-comp-select-icon-brand-def",
|
|
34
|
+
"transition-transform duration-300",
|
|
35
|
+
"group-data-[state=open]:rotate-180",
|
|
36
|
+
"group-data-[disabled]:text-icon-dark-tertiary"
|
|
37
|
+
),
|
|
38
|
+
{
|
|
39
|
+
variants: {
|
|
40
|
+
variant: {
|
|
41
|
+
default: "size-comp-accordion-default-ico-size-md",
|
|
42
|
+
branded: "size-comp-accordion-branded-ico-size-md",
|
|
43
|
+
settings: "size-comp-accordion-default-ico-size-md",
|
|
44
|
+
inline: "size-comp-accordion-default-ico-size-md"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: { variant: "default" }
|
|
48
|
+
}
|
|
49
|
+
), S = p("text-inherit transition-colors", {
|
|
32
50
|
variants: {
|
|
33
51
|
variant: {
|
|
34
52
|
default: "group-hover:text-text-brand-hover",
|
|
@@ -38,7 +56,7 @@ const N = u("relative w-full transition-colors", {
|
|
|
38
56
|
}
|
|
39
57
|
},
|
|
40
58
|
defaultVariants: { variant: "default" }
|
|
41
|
-
}),
|
|
59
|
+
}), z = p("text-left", {
|
|
42
60
|
variants: {
|
|
43
61
|
variant: {
|
|
44
62
|
default: "pt-md",
|
|
@@ -48,7 +66,7 @@ const N = u("relative w-full transition-colors", {
|
|
|
48
66
|
}
|
|
49
67
|
},
|
|
50
68
|
defaultVariants: { variant: "default" }
|
|
51
|
-
}), T =
|
|
69
|
+
}), T = p("text-left", {
|
|
52
70
|
variants: {
|
|
53
71
|
variant: {
|
|
54
72
|
default: "pt-2xl",
|
|
@@ -60,34 +78,34 @@ const N = u("relative w-full transition-colors", {
|
|
|
60
78
|
defaultVariants: { variant: "default" }
|
|
61
79
|
}), C = l.createContext({
|
|
62
80
|
variant: "default"
|
|
63
|
-
}),
|
|
81
|
+
}), m = () => l.useContext(C), v = l.createContext({
|
|
64
82
|
isStatic: !1
|
|
65
|
-
}), w = () => l.useContext(v),
|
|
83
|
+
}), w = () => l.useContext(v), O = ({
|
|
66
84
|
className: o,
|
|
67
85
|
variant: r,
|
|
68
86
|
...t
|
|
69
87
|
}) => {
|
|
70
88
|
const e = r ?? (t.type === "single" ? "branded" : "default");
|
|
71
89
|
return /* @__PURE__ */ a(C.Provider, { value: { variant: e }, children: /* @__PURE__ */ a(
|
|
72
|
-
|
|
90
|
+
g.Root,
|
|
73
91
|
{
|
|
74
92
|
"data-slot": "accordion",
|
|
75
|
-
className:
|
|
93
|
+
className: i("flex w-full flex-col gap-md", o),
|
|
76
94
|
...t
|
|
77
95
|
}
|
|
78
96
|
) });
|
|
79
|
-
},
|
|
97
|
+
}, j = l.forwardRef(
|
|
80
98
|
({
|
|
81
99
|
className: o,
|
|
82
100
|
children: r,
|
|
83
101
|
clickableContent: t = !1,
|
|
84
102
|
static: e,
|
|
85
|
-
value:
|
|
86
|
-
disabled:
|
|
87
|
-
...
|
|
88
|
-
},
|
|
89
|
-
const { variant: x } =
|
|
90
|
-
h.current =
|
|
103
|
+
value: n,
|
|
104
|
+
disabled: c,
|
|
105
|
+
...s
|
|
106
|
+
}, d) => {
|
|
107
|
+
const { variant: x } = m(), h = l.useRef(null), k = (u) => {
|
|
108
|
+
h.current = u, typeof d == "function" ? d(u) : d && (d.current = u);
|
|
91
109
|
};
|
|
92
110
|
return e ? /* @__PURE__ */ a(v.Provider, { value: { isStatic: !0 }, children: /* @__PURE__ */ a(
|
|
93
111
|
"div",
|
|
@@ -95,49 +113,50 @@ const N = u("relative w-full transition-colors", {
|
|
|
95
113
|
ref: k,
|
|
96
114
|
"data-slot": "accordion-item",
|
|
97
115
|
"data-state": "open",
|
|
98
|
-
className:
|
|
99
|
-
...
|
|
116
|
+
className: i(N({ variant: x }), o),
|
|
117
|
+
...s,
|
|
100
118
|
children: r
|
|
101
119
|
}
|
|
102
120
|
) }) : /* @__PURE__ */ a(v.Provider, { value: { isStatic: !1 }, children: /* @__PURE__ */ a(
|
|
103
|
-
|
|
121
|
+
g.Item,
|
|
104
122
|
{
|
|
105
123
|
ref: k,
|
|
106
124
|
"data-slot": "accordion-item",
|
|
107
|
-
value:
|
|
108
|
-
disabled:
|
|
109
|
-
className:
|
|
125
|
+
value: n,
|
|
126
|
+
disabled: c,
|
|
127
|
+
className: i(
|
|
110
128
|
N({ variant: x }),
|
|
111
129
|
t && "cursor-pointer",
|
|
112
130
|
o
|
|
113
131
|
),
|
|
114
|
-
onClick: t ? (
|
|
132
|
+
onClick: t ? (u) => {
|
|
115
133
|
var y;
|
|
116
|
-
const
|
|
134
|
+
const f = (y = h.current) == null ? void 0 : y.querySelector(
|
|
117
135
|
'[data-slot="accordion-trigger"]'
|
|
118
136
|
);
|
|
119
|
-
|
|
137
|
+
f && !f.contains(u.target) && f.click();
|
|
120
138
|
} : void 0,
|
|
121
|
-
...
|
|
139
|
+
...s,
|
|
122
140
|
children: r
|
|
123
141
|
}
|
|
124
142
|
) });
|
|
125
143
|
}
|
|
126
144
|
);
|
|
127
|
-
|
|
128
|
-
const
|
|
145
|
+
j.displayName = "AccordionItem";
|
|
146
|
+
const B = ({
|
|
129
147
|
className: o,
|
|
130
148
|
children: r,
|
|
131
149
|
headerActions: t,
|
|
132
|
-
|
|
150
|
+
hideDefaultChevron: e = !1,
|
|
151
|
+
...n
|
|
133
152
|
}) => {
|
|
134
|
-
const { variant:
|
|
135
|
-
return
|
|
153
|
+
const { variant: c } = m(), { isStatic: s } = w();
|
|
154
|
+
return s ? /* @__PURE__ */ b("div", { className: "flex items-center", ...n, children: [
|
|
136
155
|
/* @__PURE__ */ a(
|
|
137
156
|
"div",
|
|
138
157
|
{
|
|
139
|
-
className:
|
|
140
|
-
|
|
158
|
+
className: i(
|
|
159
|
+
V({ variant: c }),
|
|
141
160
|
"cursor-default",
|
|
142
161
|
o
|
|
143
162
|
),
|
|
@@ -148,24 +167,24 @@ const O = ({
|
|
|
148
167
|
"div",
|
|
149
168
|
{
|
|
150
169
|
className: "flex shrink-0 items-center",
|
|
151
|
-
onClick: (
|
|
170
|
+
onClick: (d) => d.stopPropagation(),
|
|
152
171
|
children: t
|
|
153
172
|
}
|
|
154
173
|
)
|
|
155
|
-
] }) : /* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
|
|
174
|
+
] }) : /* @__PURE__ */ b(g.Header, { className: "flex items-center", ...n, children: [
|
|
175
|
+
/* @__PURE__ */ b(
|
|
176
|
+
g.Trigger,
|
|
158
177
|
{
|
|
159
178
|
"data-slot": "accordion-trigger",
|
|
160
|
-
className:
|
|
179
|
+
className: i(V({ variant: c }), o),
|
|
161
180
|
children: [
|
|
162
181
|
r,
|
|
163
|
-
/* @__PURE__ */ a(
|
|
164
|
-
|
|
182
|
+
!e && /* @__PURE__ */ a(
|
|
183
|
+
A,
|
|
165
184
|
{
|
|
166
|
-
className:
|
|
185
|
+
className: i(
|
|
167
186
|
"shrink-0 text-comp-select-icon-brand-def transition-transform duration-300 group-data-[disabled]:text-icon-dark-tertiary",
|
|
168
|
-
|
|
187
|
+
c === "branded" ? "size-comp-accordion-branded-ico-size-md" : "size-comp-accordion-default-ico-size-md"
|
|
169
188
|
)
|
|
170
189
|
}
|
|
171
190
|
)
|
|
@@ -176,25 +195,25 @@ const O = ({
|
|
|
176
195
|
"div",
|
|
177
196
|
{
|
|
178
197
|
className: "flex shrink-0 items-center",
|
|
179
|
-
onClick: (
|
|
198
|
+
onClick: (d) => d.stopPropagation(),
|
|
180
199
|
children: t
|
|
181
200
|
}
|
|
182
201
|
)
|
|
183
202
|
] });
|
|
184
|
-
},
|
|
203
|
+
}, E = ({
|
|
185
204
|
className: o,
|
|
186
205
|
children: r,
|
|
187
206
|
...t
|
|
188
207
|
}) => {
|
|
189
|
-
const { variant: e } =
|
|
190
|
-
return
|
|
208
|
+
const { variant: e } = m(), { isStatic: n } = w();
|
|
209
|
+
return n ? /* @__PURE__ */ a("div", { "data-slot": "accordion-content", ...t, children: /* @__PURE__ */ a(
|
|
191
210
|
"div",
|
|
192
211
|
{
|
|
193
|
-
className:
|
|
212
|
+
className: i(z({ variant: e }), o),
|
|
194
213
|
children: r
|
|
195
214
|
}
|
|
196
215
|
) }) : /* @__PURE__ */ a(
|
|
197
|
-
|
|
216
|
+
g.Content,
|
|
198
217
|
{
|
|
199
218
|
"data-slot": "accordion-content",
|
|
200
219
|
className: "overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
@@ -202,22 +221,22 @@ const O = ({
|
|
|
202
221
|
children: /* @__PURE__ */ a(
|
|
203
222
|
"div",
|
|
204
223
|
{
|
|
205
|
-
className:
|
|
224
|
+
className: i(z({ variant: e }), o),
|
|
206
225
|
children: r
|
|
207
226
|
}
|
|
208
227
|
)
|
|
209
228
|
}
|
|
210
229
|
);
|
|
211
|
-
},
|
|
230
|
+
}, G = ({
|
|
212
231
|
className: o,
|
|
213
232
|
component: r = "span",
|
|
214
233
|
variant: t = "title",
|
|
215
234
|
weight: e = "medium",
|
|
216
|
-
size:
|
|
217
|
-
fixY:
|
|
218
|
-
...
|
|
235
|
+
size: n = "base",
|
|
236
|
+
fixY: c = !0,
|
|
237
|
+
...s
|
|
219
238
|
}) => {
|
|
220
|
-
const { variant:
|
|
239
|
+
const { variant: d } = m();
|
|
221
240
|
return /* @__PURE__ */ a(
|
|
222
241
|
I,
|
|
223
242
|
{
|
|
@@ -225,26 +244,40 @@ const O = ({
|
|
|
225
244
|
component: r,
|
|
226
245
|
variant: t,
|
|
227
246
|
weight: e,
|
|
228
|
-
size:
|
|
229
|
-
fixY:
|
|
230
|
-
className:
|
|
231
|
-
...
|
|
247
|
+
size: n,
|
|
248
|
+
fixY: c,
|
|
249
|
+
className: i(S({ variant: d }), o),
|
|
250
|
+
...s
|
|
232
251
|
}
|
|
233
252
|
);
|
|
234
|
-
},
|
|
253
|
+
}, J = ({
|
|
254
|
+
className: o,
|
|
255
|
+
variant: r,
|
|
256
|
+
...t
|
|
257
|
+
}) => {
|
|
258
|
+
const { variant: e } = m();
|
|
259
|
+
return /* @__PURE__ */ a(
|
|
260
|
+
A,
|
|
261
|
+
{
|
|
262
|
+
"data-slot": "accordion-chevron",
|
|
263
|
+
className: i(P({ variant: r ?? e }), o),
|
|
264
|
+
...t
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
}, K = ({
|
|
235
268
|
className: o,
|
|
236
269
|
children: r,
|
|
237
270
|
onClick: t,
|
|
238
271
|
...e
|
|
239
272
|
}) => {
|
|
240
|
-
const { variant:
|
|
273
|
+
const { variant: n } = m();
|
|
241
274
|
return /* @__PURE__ */ a(
|
|
242
275
|
"div",
|
|
243
276
|
{
|
|
244
277
|
"data-slot": "accordion-footer",
|
|
245
|
-
className:
|
|
246
|
-
onClick: (
|
|
247
|
-
t == null || t(
|
|
278
|
+
className: i(T({ variant: n }), o),
|
|
279
|
+
onClick: (c) => {
|
|
280
|
+
t == null || t(c), c.stopPropagation();
|
|
248
281
|
},
|
|
249
282
|
...e,
|
|
250
283
|
children: r
|
|
@@ -252,15 +285,17 @@ const O = ({
|
|
|
252
285
|
);
|
|
253
286
|
};
|
|
254
287
|
export {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
288
|
+
O as Accordion,
|
|
289
|
+
J as AccordionChevron,
|
|
290
|
+
E as AccordionContent,
|
|
291
|
+
K as AccordionFooter,
|
|
292
|
+
B as AccordionHeader,
|
|
293
|
+
j as AccordionItem,
|
|
294
|
+
G as AccordionTitle,
|
|
295
|
+
P as accordionChevronVariants,
|
|
296
|
+
z as accordionContentInnerVariants,
|
|
262
297
|
T as accordionFooterVariants,
|
|
263
298
|
N as accordionItemVariants,
|
|
264
299
|
S as accordionTitleVariants,
|
|
265
|
-
|
|
300
|
+
V as accordionTriggerVariants
|
|
266
301
|
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const articleCardVariants: (props?: ({
|
|
4
|
+
variant?: "search" | "compact" | "heroLarge" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
declare const articleCardTitleVariants: (props?: ({
|
|
7
|
+
variant?: "search" | "compact" | "heroLarge" | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
declare const articleCardMetaVariants: (props?: ({
|
|
10
|
+
variant?: "search" | "compact" | "heroLarge" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
12
|
+
export type ArticleCardVariant = 'compact' | 'heroLarge' | 'search';
|
|
13
|
+
/** Props for the `ArticleCard.Skeleton` subcomponent. */
|
|
14
|
+
export interface ArticleCardSkeletonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
15
|
+
/**
|
|
16
|
+
* Visual layout variant — mirrors `ArticleCard.variant` so the skeleton
|
|
17
|
+
* reserves the same footprint as the card it stands in for.
|
|
18
|
+
*
|
|
19
|
+
* @default 'compact'
|
|
20
|
+
*/
|
|
21
|
+
variant?: ArticleCardVariant;
|
|
22
|
+
/**
|
|
23
|
+
* Skeleton color, forwarded to every inner `Skeleton` block. Use `'light'`
|
|
24
|
+
* when the skeleton sits on a tinted surface.
|
|
25
|
+
*
|
|
26
|
+
* @default 'default'
|
|
27
|
+
*/
|
|
28
|
+
color?: 'default' | 'light';
|
|
29
|
+
}
|
|
30
|
+
declare const ArticleCardSkeleton: {
|
|
31
|
+
({ variant, color, className, ...props }: ArticleCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Content props shared between the default-anchor and `asChild` shapes of
|
|
36
|
+
* ArticleCard. Variant/size/styling lives here; the link target and the
|
|
37
|
+
* children/asChild axis are split into the two members of the discriminated
|
|
38
|
+
* union below.
|
|
39
|
+
*/
|
|
40
|
+
export interface ArticleCardBaseProps extends Omit<VariantProps<typeof articleCardVariants>, 'variant' | 'size'> {
|
|
41
|
+
/** Article title — maps to the consumer's `name` field. */
|
|
42
|
+
name: string;
|
|
43
|
+
/**
|
|
44
|
+
* Image source — either a URL string (rendered as a plain `<img>`) or a
|
|
45
|
+
* custom React node such as a Next.js `<Image>` element. The wrapper
|
|
46
|
+
* around the image handles sizing, rounded corners, overflow, and the
|
|
47
|
+
* disabled dim; any direct `<img>` child (including the one Next's
|
|
48
|
+
* `<Image>` renders) is auto-stretched to fill the wrapper, so no extra
|
|
49
|
+
* styling is required on the consumer side.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // String form (built-in <img>)
|
|
53
|
+
* <ArticleCard image="/articles/hero.jpg" name="…" publicationDate={…} />
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Next.js <Image> (or any custom element)
|
|
57
|
+
* <ArticleCard
|
|
58
|
+
* image={<Image src={cover} alt="" fill />}
|
|
59
|
+
* name="…"
|
|
60
|
+
* publicationDate={…}
|
|
61
|
+
* />
|
|
62
|
+
*/
|
|
63
|
+
image: string | React.ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Alt text for the built-in `<img>` (used when `image` is a string).
|
|
66
|
+
*
|
|
67
|
+
* - `compact` / `search` — defaults to `name`.
|
|
68
|
+
* - `heroLarge` — defaults to `""` (the image is decorative; the title
|
|
69
|
+
* already conveys the meaning).
|
|
70
|
+
*
|
|
71
|
+
* Ignored when `image` is a custom React node — the consumer's element
|
|
72
|
+
* carries its own `alt`.
|
|
73
|
+
*/
|
|
74
|
+
imageAlt?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Resolved category labels rendered as Tag chips. Consumer is expected to
|
|
77
|
+
* resolve category IDs to display labels before passing them in.
|
|
78
|
+
*/
|
|
79
|
+
categories?: string[];
|
|
80
|
+
/**
|
|
81
|
+
* Maximum number of tag chips rendered before overflow collapses into a
|
|
82
|
+
* `+N` counter chip (mirrors `MultiSelect.maxNumberOfVisibleTags`).
|
|
83
|
+
*
|
|
84
|
+
* @default 2
|
|
85
|
+
*/
|
|
86
|
+
maxNumberOfVisibleTags?: number;
|
|
87
|
+
/** Article publication date — accepts a `Date` or any value parseable by `new Date()`. */
|
|
88
|
+
publicationDate: Date | string;
|
|
89
|
+
/**
|
|
90
|
+
* Optional reading time in minutes. When set, rendered next to the
|
|
91
|
+
* publication date using `readingTimeLabel` (or the locale default).
|
|
92
|
+
*/
|
|
93
|
+
readingTime?: number;
|
|
94
|
+
/** Override for the publication-date formatter. Defaults to `d. M. yyyy`. */
|
|
95
|
+
formatDate?: (date: Date) => string;
|
|
96
|
+
/**
|
|
97
|
+
* Override for the read-article CTA label.
|
|
98
|
+
*
|
|
99
|
+
* @default translations.articleCard.readArticle
|
|
100
|
+
*/
|
|
101
|
+
readArticleLabel?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Override for the reading-time label builder. Receives the duration in
|
|
104
|
+
* minutes.
|
|
105
|
+
*
|
|
106
|
+
* @default translations.articleCard.readingTime
|
|
107
|
+
*/
|
|
108
|
+
readingTimeLabel?: (minutes: number) => string;
|
|
109
|
+
/**
|
|
110
|
+
* Visual layout variant.
|
|
111
|
+
*
|
|
112
|
+
* - `compact` — 288×316 grid card with image on top.
|
|
113
|
+
* - `heroLarge` — large feature card with text overlaid on the image.
|
|
114
|
+
* - `search` — horizontal image-left card for search result lists.
|
|
115
|
+
*
|
|
116
|
+
* @default 'compact'
|
|
117
|
+
*/
|
|
118
|
+
variant?: 'compact' | 'heroLarge' | 'search';
|
|
119
|
+
/** Disabled visual state. Adds the disabled border, dims the image, and grays the text. The anchor's `href` is also stripped so the card is non-navigable. @default false */
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Default shape — ArticleCard renders an `<a href>` as its root and the
|
|
124
|
+
* structured content (image, tags, title, metadata, CTA) as its children.
|
|
125
|
+
*/
|
|
126
|
+
export interface ArticleCardLinkProps extends ArticleCardBaseProps, Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'title' | 'children' | 'href'> {
|
|
127
|
+
/**
|
|
128
|
+
* URL the card navigates to when activated. Required unless `asChild` is
|
|
129
|
+
* used. Stripped from the rendered DOM when `disabled` is true so the
|
|
130
|
+
* anchor becomes non-navigable while keeping its visual state.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* <ArticleCard href="/articles/123" name="…" image="…" publicationDate={…} />
|
|
134
|
+
*/
|
|
135
|
+
href: string;
|
|
136
|
+
/** Discriminant: omit (or set to `false`) for the built-in `<a>` shape. Set to `true` to switch to the `asChild` shape. */
|
|
137
|
+
asChild?: false;
|
|
138
|
+
/** Not accepted in the default `<a>` shape — the card composes its own structured content. Use `asChild` to inject a custom root. */
|
|
139
|
+
children?: never;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Escape-hatch shape — hand the root element off to a consumer-provided
|
|
143
|
+
* `<Link>` (Next.js, React Router, …) via Radix `Slot`. The card's
|
|
144
|
+
* structured content is rendered as the child's children, so the child
|
|
145
|
+
* must be self-closing.
|
|
146
|
+
*/
|
|
147
|
+
export interface ArticleCardAsChildProps extends ArticleCardBaseProps, Omit<React.HTMLAttributes<HTMLElement>, 'title' | 'children'> {
|
|
148
|
+
/**
|
|
149
|
+
* Renders the consumer's child as the root element via Radix `Slot`, so
|
|
150
|
+
* the card surface can be a router `<Link>` (Next.js, React Router, …)
|
|
151
|
+
* instead of the built-in `<a>`. The structured content (image, tags,
|
|
152
|
+
* title, metadata, CTA) is rendered as the child's children — pass a
|
|
153
|
+
* self-closing element.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* <ArticleCard asChild name="…" image="…" publicationDate={…}>
|
|
157
|
+
* <Link href="/articles/123" />
|
|
158
|
+
* </ArticleCard>
|
|
159
|
+
*/
|
|
160
|
+
asChild: true;
|
|
161
|
+
/** Self-closing element to use as the root. Its children are overwritten with the card's structured content. */
|
|
162
|
+
children: React.ReactElement;
|
|
163
|
+
/** Not accepted in the `asChild` shape — set `href` on the consumer-provided child instead. */
|
|
164
|
+
href?: never;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Props for the ArticleCard component.
|
|
168
|
+
*
|
|
169
|
+
* The card is a link by default. Pass `href` for the built-in `<a>`, or
|
|
170
|
+
* `asChild` with a self-closing child to swap in a router `<Link>`.
|
|
171
|
+
*/
|
|
172
|
+
export type ArticleCardProps = ArticleCardLinkProps | ArticleCardAsChildProps;
|
|
173
|
+
declare const ArticleCard: React.ForwardRefExoticComponent<ArticleCardProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
174
|
+
declare const ArticleCardWithSkeleton: typeof ArticleCard & {
|
|
175
|
+
Skeleton: typeof ArticleCardSkeleton;
|
|
176
|
+
};
|
|
177
|
+
export { ArticleCardWithSkeleton as ArticleCard, articleCardVariants, articleCardTitleVariants, articleCardMetaVariants, };
|
|
178
|
+
//# sourceMappingURL=ArticleCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleCard.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleCard/ArticleCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAWjE,QAAA,MAAM,mBAAmB;;8EAcxB,CAAA;AAED,QAAA,MAAM,wBAAwB;;8EAY5B,CAAA;AAEF,QAAA,MAAM,uBAAuB;;8EAY3B,CAAA;AAKF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;AAkInE,yDAAyD;AACzD,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9D;;;;;OAKG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CAC5B;AAED,QAAA,MAAM,mBAAmB;8CAKtB,w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