@marwes-ui/react 1.1.0 → 1.2.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/README.md +4 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +235 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
React components for the Marwes design system with default styling, typed theme tokens, accessibility contracts, and AI-readable semantics.
|
|
2
|
+
|
|
1
3
|
<div align="center">
|
|
2
4
|
|
|
3
|
-
<img alt="Marwes Design System" src="https://raw.githubusercontent.com/niklas-westman/marwes/main/.github/assets/
|
|
5
|
+
<img alt="Marwes Design System" src="https://raw.githubusercontent.com/niklas-westman/marwes/main/.github/assets/cover-v3.png" width="100%" style="border-radius: 40px;">
|
|
4
6
|
|
|
5
7
|
<br>
|
|
6
8
|
<br>
|
|
@@ -11,7 +13,7 @@
|
|
|
11
13
|
|
|
12
14
|
React 18+ • TypeScript-first • Default CSS included • ThemeInput • Google Fonts DX • Purpose components
|
|
13
15
|
|
|
14
|
-
[Documentation](https://github.com/niklas-westman/marwes/tree/main/docs) • [Storybook](https://
|
|
16
|
+
[Documentation](https://github.com/niklas-westman/marwes/tree/main/docs) • [React Storybook](https://storybook-react.marwes.io/latest/) • [GitHub](https://github.com/niklas-westman/marwes)
|
|
15
17
|
|
|
16
18
|
</div>
|
|
17
19
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ThemeInput, ThemePreference, ThemeMode, FontLoadingConfig, ThemeVariableStrategy, ResolvedTheme, ButtonOptions, InputOptions, SelectOptions, SelectAppearance as SelectAppearance$1, SelectOption as SelectOption$1, TextareaOptions, RichTextOptions, InputOtpOptions, CurrencyCode, iconRegistry, IconSize, IconStrokeWidth, AvatarOptions, CheckboxProps as CheckboxProps$1, DividerOptions, DividerSize, DividerOrientation, SpinnerOptions, SpacingOptions, SpacingSize, HeadingOptions, HeadingSize, ParagraphOptions, ParagraphSize, ToastOptions, ToastVariant, ToastIntent, ToastPlacement, TooltipOptions, IconNameType, RadioOptions, BadgeOptions, SwitchOptions, SliderOptions, TabOptions, DialogOptions } from '@marwes-ui/core';
|
|
2
|
+
import { ThemeInput, ThemePreference, ThemeMode, FontLoadingConfig, ThemeVariableStrategy, ResolvedTheme, ButtonOptions, InputOptions, SelectOptions, SelectAppearance as SelectAppearance$1, SelectOption as SelectOption$1, TextareaOptions, RichTextOptions, InputOtpOptions, CurrencyCode, iconRegistry, IconSize, IconStrokeWidth, AvatarOptions, CheckboxProps as CheckboxProps$1, DividerOptions, DividerSize, DividerOrientation, SpinnerOptions, SkeletonOptions, SpacingOptions, SpacingSize, HeadingOptions, HeadingSize, ParagraphOptions, ParagraphSize, StatTileOptions, StatTileTrendDirection, StatTileTone, DatePickerOptions, DatePickerDevice, DatePickerDay, ToastOptions, ToastVariant, ToastIntent, ToastPlacement, TooltipOptions, IconNameType, RadioOptions, BadgeOptions, SwitchOptions, SliderOptions, TabOptions, DialogOptions } from '@marwes-ui/core';
|
|
3
3
|
export { AvatarSize, AvatarType, BadgeVariant, ButtonAction, ButtonSize, ButtonVariant, Density, FontLoadingConfig, FontLoadingMode, FontLoadingOptions, IconName, MarwesThemeScriptOptions, MarwesThemeStyleOptions, MwAvailableFont, MwFontFallback, MwGoogleFontFamily, MwStyledTheme, MwThemeVarName, MwThemeVarNames, MwThemeVarReference, MwThemeVars, ResolvedTheme, SpacingSize, Spacings, SwitchSize, Theme, ThemeInput, ThemeMode, ThemeModeAttribute, ThemeModeRootTarget, ThemePreference, ThemeVariableStrategy, ToneName, createFontStack, mwAvailableFonts, mwFontFallbacks, mwGoogleFontFamilies, mwStyledTheme, mwThemeVarNames, mwThemeVars, mwVar } from '@marwes-ui/core';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
export { MarwesThemeScript, MarwesThemeScriptProps, MarwesThemeStyle, MarwesThemeStyleProps, createMarwesThemeScript, createMarwesThemeStyle } from './ssr.js';
|
|
@@ -253,6 +253,7 @@ type InputOtpProps = Omit<InputOtpOptions, "describedBy"> & {
|
|
|
253
253
|
};
|
|
254
254
|
declare function InputOtp(props: InputOtpProps): React.ReactElement;
|
|
255
255
|
|
|
256
|
+
type SelectFieldVariant = "default" | "date";
|
|
256
257
|
type SelectFieldProps = {
|
|
257
258
|
id?: string;
|
|
258
259
|
label: string;
|
|
@@ -260,6 +261,7 @@ type SelectFieldProps = {
|
|
|
260
261
|
error?: string;
|
|
261
262
|
select: SelectProps;
|
|
262
263
|
ariaDescribedBy?: string;
|
|
264
|
+
variant?: SelectFieldVariant;
|
|
263
265
|
};
|
|
264
266
|
declare function SelectField(props: SelectFieldProps): React.ReactElement;
|
|
265
267
|
|
|
@@ -958,6 +960,11 @@ declare function ButtonSpinner(props: ButtonSpinnerProps): React.ReactElement;
|
|
|
958
960
|
type EmptyStateSpinnerProps = SpinnerProps;
|
|
959
961
|
declare function EmptyStateSpinner(props: EmptyStateSpinnerProps): React.ReactElement;
|
|
960
962
|
|
|
963
|
+
interface SkeletonProps extends SkeletonOptions, Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
964
|
+
dataAttributes?: Record<string, string>;
|
|
965
|
+
}
|
|
966
|
+
declare function Skeleton(props: SkeletonProps): React.ReactElement;
|
|
967
|
+
|
|
961
968
|
/**
|
|
962
969
|
* React adapter for Marwes Spacing component.
|
|
963
970
|
* - Renders a decorative, aria-hidden div using the core spacing recipe.
|
|
@@ -1253,6 +1260,28 @@ type ParagraphProps = ParagraphOptions & {
|
|
|
1253
1260
|
*/
|
|
1254
1261
|
declare function Paragraph(props: ParagraphProps): React.ReactElement;
|
|
1255
1262
|
|
|
1263
|
+
interface StatTileProps extends Omit<React.HTMLAttributes<HTMLElement>, "children" | "title">, Pick<StatTileOptions, "dataAttributes"> {
|
|
1264
|
+
label: React.ReactNode;
|
|
1265
|
+
value: React.ReactNode;
|
|
1266
|
+
subtitle?: React.ReactNode;
|
|
1267
|
+
trendValue?: React.ReactNode;
|
|
1268
|
+
trendDirection?: StatTileTrendDirection;
|
|
1269
|
+
tone?: StatTileTone;
|
|
1270
|
+
}
|
|
1271
|
+
declare function StatTile(props: StatTileProps): React.ReactElement;
|
|
1272
|
+
|
|
1273
|
+
interface DatePickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "children" | "onSelect">, Pick<DatePickerOptions, "monthLabel" | "weekdayLabels" | "weeks" | "previousYearLabel" | "previousMonthLabel" | "nextMonthLabel" | "nextYearLabel" | "cancelLabel" | "applyLabel" | "calendarLabel" | "dataAttributes"> {
|
|
1274
|
+
device?: DatePickerDevice;
|
|
1275
|
+
onPreviousYear?: () => void;
|
|
1276
|
+
onPreviousMonth?: () => void;
|
|
1277
|
+
onNextMonth?: () => void;
|
|
1278
|
+
onNextYear?: () => void;
|
|
1279
|
+
onDaySelect?: (day: DatePickerDay) => void;
|
|
1280
|
+
onCancel?: () => void;
|
|
1281
|
+
onApply?: () => void;
|
|
1282
|
+
}
|
|
1283
|
+
declare function DatePicker(props: DatePickerProps): React.ReactElement;
|
|
1284
|
+
|
|
1256
1285
|
interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
1257
1286
|
/** Optional title rendered above the body content */
|
|
1258
1287
|
title?: React.ReactNode;
|
|
@@ -2132,4 +2161,4 @@ type InfoDialogProps = Omit<DialogModalProps, "footer"> & {
|
|
|
2132
2161
|
};
|
|
2133
2162
|
declare function InfoDialog(props: InfoDialogProps): React.ReactElement;
|
|
2134
2163
|
|
|
2135
|
-
export { Accordion, AccordionField, type AccordionFieldItem, type AccordionFieldProps, type AccordionProps, Avatar, AvatarBadge, type AvatarBadgeProps, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarProps, Badge, BadgeGroup, type BadgeGroupProps, type BadgeProps, BrightnessSlider, type BrightnessSliderProps, Button, type ButtonProps, ButtonSpinner, type ButtonSpinnerProps, CancelButton, type CancelButtonProps, Card, type CardProps, Checkbox, CheckboxField, type CheckboxFieldProps, CheckboxGroupField, type CheckboxGroupFieldOption, type CheckboxGroupFieldProps, type CheckboxProps, CloseButton, type CloseButtonProps, ConfirmButton, type ConfirmButtonProps, ConfirmDialog, type ConfirmDialogProps, ContentTabs, type ContentTabsProps, CopyButton, type CopyButtonProps, CreateButton, type CreateButtonProps, CurrencyField, type CurrencyFieldProps, DateOfBirthField, type DateOfBirthFieldProps, DestructiveButton, type DestructiveButtonProps, DestructiveDialog, type DestructiveDialogProps, Dialog, type DialogFooterControls, DialogModal, type DialogModalProps, type DialogProps, Divider, type DividerProps, DownloadButton, type DownloadButtonProps, DropdownButton, type DropdownButtonProps, DropdownField, type DropdownFieldProps, EditButton, type EditButtonProps, EmailField, type EmailFieldProps, EmptyStateSpinner, type EmptyStateSpinnerProps, ErrorToast, type ErrorToastProps, FAQAccordion, type FAQAccordionProps, FeatureToggle, type FeatureToggleProps, FilterButton, type FilterButtonProps, H1, type H1Props, H2, type H2Props, H3, type H3Props, Icon, type IconProps, InfoDialog, type InfoDialogProps, InfoToast, type InfoToastProps, Input, InputField, type InputFieldProps, InputOtp, type InputOtpProps, type InputProps, LinkButton, type LinkButtonProps, type ManagedToast, MarwesProvider, type MarwesProviderProps, NavigationTabs, type NavigationTabsProps, NotificationBadge, type NotificationBadgeProps, OptionRadioGroup, type OptionRadioGroupProps, Paragraph, type ParagraphProps, PasswordField, type PasswordFieldProps, PermissionSwitch, type PermissionSwitchProps, PhoneField, type PhoneFieldProps, PreferenceSwitch, type PreferenceSwitchProps, PresenceAvatar, type PresenceAvatarProps, PrimaryButton, type PrimaryButtonProps, PriorityBadge, type PriorityBadgeProps, ProductCard, type ProductCardProps, ProfileAvatar, type ProfileAvatarProps, ProfileCard, type ProfileCardProps, Radio, RadioGroupField, type RadioGroupFieldOption, type RadioGroupFieldProps, type RadioProps, RadiusSlider, type RadiusSliderProps, RatingRadioGroup, type RatingRadioGroupProps, RefreshButton, type RefreshButtonProps, RichText, RichTextField, type RichTextFieldProps, type RichTextProps, SaveButton, type SaveButtonProps, SearchButton, type SearchButtonProps, SearchField, type SearchFieldProps, SecondaryButton, type SecondaryButtonProps, SectionsAccordion, type SectionsAccordionProps, Select, type SelectAppearance, SelectField, type SelectFieldProps, type SelectOption, type SelectProps, SettingsAccordion, type SettingsAccordionProps, SettingsTabs, type SettingsTabsProps, type ShowToastOptions, Slider, SliderField, type SliderFieldProps, type SliderProps, SortButton, type SortButtonProps, Spacer, type SpacerProps, Spacing, type SpacingProps, Spinner, type SpinnerProps, StatCard, type StatCardProps, StatusBadge, type StatusBadgeProps, SubmitButton, type SubmitButtonProps, SuccessButton, type SuccessButtonProps, SuccessToast, type SuccessToastProps, Switch, SwitchField, type SwitchFieldProps, type SwitchProps, Tab, TabGroup, type TabGroupItem, type TabGroupProps, TabPanel, type TabPanelProps, type TabProps, TeamAvatarGroup, type TeamAvatarGroupProps, TextButton, type TextButtonProps, Textarea, TextareaField, type TextareaFieldProps, type TextareaProps, type ThemeModeContextValue, Toast, ToastContainer, type ToastContainerProps, type ToastController, type ToastProps, ToastProvider, type ToastProviderProps, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipProps, URLField, type URLFieldProps, UploadButton, type UploadButtonProps, VerifyButton, type VerifyButtonProps, VolumeSlider, type VolumeSliderProps, WarningToast, type WarningToastProps, YesNoRadioGroup, type YesNoRadioGroupProps, ZipCodeField, type ZipCodeFieldProps, useTheme, useThemeMode, useToast };
|
|
2164
|
+
export { Accordion, AccordionField, type AccordionFieldItem, type AccordionFieldProps, type AccordionProps, Avatar, AvatarBadge, type AvatarBadgeProps, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarProps, Badge, BadgeGroup, type BadgeGroupProps, type BadgeProps, BrightnessSlider, type BrightnessSliderProps, Button, type ButtonProps, ButtonSpinner, type ButtonSpinnerProps, CancelButton, type CancelButtonProps, Card, type CardProps, Checkbox, CheckboxField, type CheckboxFieldProps, CheckboxGroupField, type CheckboxGroupFieldOption, type CheckboxGroupFieldProps, type CheckboxProps, CloseButton, type CloseButtonProps, ConfirmButton, type ConfirmButtonProps, ConfirmDialog, type ConfirmDialogProps, ContentTabs, type ContentTabsProps, CopyButton, type CopyButtonProps, CreateButton, type CreateButtonProps, CurrencyField, type CurrencyFieldProps, DateOfBirthField, type DateOfBirthFieldProps, DatePicker, type DatePickerProps, DestructiveButton, type DestructiveButtonProps, DestructiveDialog, type DestructiveDialogProps, Dialog, type DialogFooterControls, DialogModal, type DialogModalProps, type DialogProps, Divider, type DividerProps, DownloadButton, type DownloadButtonProps, DropdownButton, type DropdownButtonProps, DropdownField, type DropdownFieldProps, EditButton, type EditButtonProps, EmailField, type EmailFieldProps, EmptyStateSpinner, type EmptyStateSpinnerProps, ErrorToast, type ErrorToastProps, FAQAccordion, type FAQAccordionProps, FeatureToggle, type FeatureToggleProps, FilterButton, type FilterButtonProps, H1, type H1Props, H2, type H2Props, H3, type H3Props, Icon, type IconProps, InfoDialog, type InfoDialogProps, InfoToast, type InfoToastProps, Input, InputField, type InputFieldProps, InputOtp, type InputOtpProps, type InputProps, LinkButton, type LinkButtonProps, type ManagedToast, MarwesProvider, type MarwesProviderProps, NavigationTabs, type NavigationTabsProps, NotificationBadge, type NotificationBadgeProps, OptionRadioGroup, type OptionRadioGroupProps, Paragraph, type ParagraphProps, PasswordField, type PasswordFieldProps, PermissionSwitch, type PermissionSwitchProps, PhoneField, type PhoneFieldProps, PreferenceSwitch, type PreferenceSwitchProps, PresenceAvatar, type PresenceAvatarProps, PrimaryButton, type PrimaryButtonProps, PriorityBadge, type PriorityBadgeProps, ProductCard, type ProductCardProps, ProfileAvatar, type ProfileAvatarProps, ProfileCard, type ProfileCardProps, Radio, RadioGroupField, type RadioGroupFieldOption, type RadioGroupFieldProps, type RadioProps, RadiusSlider, type RadiusSliderProps, RatingRadioGroup, type RatingRadioGroupProps, RefreshButton, type RefreshButtonProps, RichText, RichTextField, type RichTextFieldProps, type RichTextProps, SaveButton, type SaveButtonProps, SearchButton, type SearchButtonProps, SearchField, type SearchFieldProps, SecondaryButton, type SecondaryButtonProps, SectionsAccordion, type SectionsAccordionProps, Select, type SelectAppearance, SelectField, type SelectFieldProps, type SelectOption, type SelectProps, SettingsAccordion, type SettingsAccordionProps, SettingsTabs, type SettingsTabsProps, type ShowToastOptions, Skeleton, type SkeletonProps, Slider, SliderField, type SliderFieldProps, type SliderProps, SortButton, type SortButtonProps, Spacer, type SpacerProps, Spacing, type SpacingProps, Spinner, type SpinnerProps, StatCard, type StatCardProps, StatTile, type StatTileProps, StatusBadge, type StatusBadgeProps, SubmitButton, type SubmitButtonProps, SuccessButton, type SuccessButtonProps, SuccessToast, type SuccessToastProps, Switch, SwitchField, type SwitchFieldProps, type SwitchProps, Tab, TabGroup, type TabGroupItem, type TabGroupProps, TabPanel, type TabPanelProps, type TabProps, TeamAvatarGroup, type TeamAvatarGroupProps, TextButton, type TextButtonProps, Textarea, TextareaField, type TextareaFieldProps, type TextareaProps, type ThemeModeContextValue, Toast, ToastContainer, type ToastContainerProps, type ToastController, type ToastProps, ToastProvider, type ToastProviderProps, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipProps, URLField, type URLFieldProps, UploadButton, type UploadButtonProps, VerifyButton, type VerifyButtonProps, VolumeSlider, type VolumeSliderProps, WarningToast, type WarningToastProps, YesNoRadioGroup, type YesNoRadioGroupProps, ZipCodeField, type ZipCodeFieldProps, useTheme, useThemeMode, useToast };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { MarwesThemeScript, MarwesThemeStyle, createMarwesThemeScript, createMarwesThemeStyle } from './chunk-VFY2GW62.js';
|
|
2
2
|
import '@marwes-ui/presets/firstEdition/styles.css';
|
|
3
|
-
import { createRichTextRecipe, resolveRichTextAllowedFormats, normalizeRichTextHtml, isRichTextHtmlEmpty, createDividerRecipe, createSpacingRecipe, createSliderRecipe, richTextCommandByFormat, resolveIconSize, resolveIconStrokeWidth, iconRegistry, resolveIconA11y, ThemeMode, resolveThemePreference, nextThemeMode, resolveThemeInput, createSpinnerRecipe, createButtonRecipe, ButtonAction, ButtonVariant, IconName, createInputRecipe, createSelectRecipe, resolveSelectMode, createTextareaRecipe, paragraphRecipe, buildInputFieldA11yIds, sanitizeInputOtpValue, createInputOtpRecipe, buildRichTextFieldA11yIds, buildCurrencyHelperText, getCurrencySymbol, createAvatarRecipe, createPurposeSemanticAttributes, checkboxRecipe, buildCheckboxFieldA11yIds, buildCheckboxGroupFieldA11yIds, headingRecipe, createCardRecipe, createToastRecipe, createTooltipRecipe, createAccordionRecipe, buildAccordionFieldA11yIds, radioRecipe, buildRadioGroupFieldA11yIds, createBadgeRecipe, createSwitchRecipe, buildSwitchFieldA11yIds, buildSliderFieldA11yIds, createTabRecipe, resolveTabValue, buildTabGroupA11yIds, moveTabSelection, createDialogRecipe, sanitizeCurrencyValue, isThemePreference, themeToCSSVars, extractUsedWeights, extractFontFamilyName, shouldLoadGoogleFont, buildGoogleFontsUrl } from '@marwes-ui/core';
|
|
3
|
+
import { createRichTextRecipe, resolveRichTextAllowedFormats, normalizeRichTextHtml, isRichTextHtmlEmpty, createDividerRecipe, createSpacingRecipe, createSliderRecipe, richTextCommandByFormat, resolveIconSize, resolveIconStrokeWidth, iconRegistry, resolveIconA11y, ThemeMode, resolveThemePreference, nextThemeMode, resolveThemeInput, createSpinnerRecipe, createButtonRecipe, ButtonAction, ButtonVariant, IconName, createInputRecipe, createSelectRecipe, resolveSelectMode, createTextareaRecipe, paragraphRecipe, buildInputFieldA11yIds, sanitizeInputOtpValue, createInputOtpRecipe, buildRichTextFieldA11yIds, buildCurrencyHelperText, getCurrencySymbol, createAvatarRecipe, createPurposeSemanticAttributes, checkboxRecipe, buildCheckboxFieldA11yIds, buildCheckboxGroupFieldA11yIds, createSkeletonRecipe, headingRecipe, createStatTileRecipe, createDatePickerRecipe, createCardRecipe, createToastRecipe, createTooltipRecipe, createAccordionRecipe, buildAccordionFieldA11yIds, radioRecipe, buildRadioGroupFieldA11yIds, createBadgeRecipe, createSwitchRecipe, buildSwitchFieldA11yIds, buildSliderFieldA11yIds, createTabRecipe, resolveTabValue, buildTabGroupA11yIds, moveTabSelection, createDialogRecipe, sanitizeCurrencyValue, isThemePreference, themeToCSSVars, extractUsedWeights, extractFontFamilyName, shouldLoadGoogleFont, buildGoogleFontsUrl } from '@marwes-ui/core';
|
|
4
4
|
export { AvatarSize, AvatarType, BadgeVariant, ButtonAction, ButtonSize, ButtonVariant, IconName, Spacings, SwitchSize, ThemeMode, createFontStack, mwAvailableFonts, mwFontFallbacks, mwGoogleFontFamilies, mwStyledTheme, mwThemeVarNames, mwThemeVars, mwVar } from '@marwes-ui/core';
|
|
5
5
|
import * as React2 from 'react';
|
|
6
6
|
import { useEffect } from 'react';
|
|
@@ -1625,7 +1625,7 @@ function getNextEnabledOptionIndex(options, currentIndex, direction) {
|
|
|
1625
1625
|
return currentIndex;
|
|
1626
1626
|
}
|
|
1627
1627
|
function MarwesSelectFieldControl(props) {
|
|
1628
|
-
const { id, select } = props;
|
|
1628
|
+
const { id, label, select } = props;
|
|
1629
1629
|
const listboxId = `${id}-listbox`;
|
|
1630
1630
|
const isControlled = select.value !== void 0;
|
|
1631
1631
|
const [internalValue, setInternalValue] = React2.useState(() => getInitialSelectValue2(select));
|
|
@@ -1639,6 +1639,7 @@ function MarwesSelectFieldControl(props) {
|
|
|
1639
1639
|
const selectedOption = select.options.find((option) => option.value === value) ?? (select.placeholder === void 0 ? select.options[0] : void 0);
|
|
1640
1640
|
const placeholderSelected = select.placeholder !== void 0 && value === "";
|
|
1641
1641
|
const displayText = placeholderSelected ? select.placeholder : selectedOption?.label ?? "";
|
|
1642
|
+
const accessibleName = select.ariaLabel ?? (hasTextContent3(label) ? label : void 0) ?? (hasTextContent3(displayText) ? displayText : void 0);
|
|
1642
1643
|
React2.useEffect(() => {
|
|
1643
1644
|
if (!open) {
|
|
1644
1645
|
return;
|
|
@@ -1775,6 +1776,7 @@ function MarwesSelectFieldControl(props) {
|
|
|
1775
1776
|
"aria-controls": listboxId,
|
|
1776
1777
|
"aria-expanded": open,
|
|
1777
1778
|
"aria-haspopup": "listbox",
|
|
1779
|
+
"aria-label": accessibleName,
|
|
1778
1780
|
"aria-describedby": select.describedBy,
|
|
1779
1781
|
"aria-invalid": select.invalid ? "true" : void 0,
|
|
1780
1782
|
"aria-required": select.required ? "true" : void 0,
|
|
@@ -1880,6 +1882,7 @@ function SelectField(props) {
|
|
|
1880
1882
|
"mw-input-field",
|
|
1881
1883
|
"mw-input-field--select",
|
|
1882
1884
|
mode === "marwes" && "mw-input-field--select-marwes",
|
|
1885
|
+
props.variant === "date" && "mw-input-field--select-date",
|
|
1883
1886
|
disabled && "mw-input-field--disabled",
|
|
1884
1887
|
invalid && "mw-input-field--invalid"
|
|
1885
1888
|
);
|
|
@@ -1893,7 +1896,7 @@ function SelectField(props) {
|
|
|
1893
1896
|
}
|
|
1894
1897
|
return /* @__PURE__ */ jsxs("div", { className: wrapperClass, children: [
|
|
1895
1898
|
/* @__PURE__ */ jsx("label", { className: "mw-input-field__label", htmlFor: id, children: /* @__PURE__ */ jsx(Paragraph, { size: "md", children: props.label }) }),
|
|
1896
|
-
/* @__PURE__ */ jsx("div", { className: "mw-input-field__input-wrapper", children: mode === "native" ? /* @__PURE__ */ jsx(Select, { ...selectProps, native: true }) : /* @__PURE__ */ jsx(MarwesSelectFieldControl, { id, select: selectProps }) }),
|
|
1899
|
+
/* @__PURE__ */ jsx("div", { className: "mw-input-field__input-wrapper", children: mode === "native" ? /* @__PURE__ */ jsx(Select, { ...selectProps, native: true }) : /* @__PURE__ */ jsx(MarwesSelectFieldControl, { id, label: props.label, select: selectProps }) }),
|
|
1897
1900
|
hasHelperText && !hasError && /* @__PURE__ */ jsx("div", { className: "mw-input-field__helper", id: helperTextId, children: /* @__PURE__ */ jsx(Paragraph, { size: "sm", children: props.helperText }) }),
|
|
1898
1901
|
hasError && /* @__PURE__ */ jsx("div", { className: "mw-input-field__error", id: errorId, "aria-live": "polite", children: /* @__PURE__ */ jsx(Paragraph, { size: "sm", children: props.error }) })
|
|
1899
1902
|
] });
|
|
@@ -2511,6 +2514,51 @@ var Divider = React2.forwardRef((props, ref) => {
|
|
|
2511
2514
|
return /* @__PURE__ */ jsx("hr", { ref, ...kit.a11y, ...kit.dataAttributes, className, style });
|
|
2512
2515
|
});
|
|
2513
2516
|
Divider.displayName = "Divider";
|
|
2517
|
+
function Skeleton(props) {
|
|
2518
|
+
const {
|
|
2519
|
+
className,
|
|
2520
|
+
style,
|
|
2521
|
+
dataAttributes,
|
|
2522
|
+
variant,
|
|
2523
|
+
width,
|
|
2524
|
+
height,
|
|
2525
|
+
radius,
|
|
2526
|
+
animation,
|
|
2527
|
+
decorative,
|
|
2528
|
+
ariaLabel,
|
|
2529
|
+
id,
|
|
2530
|
+
...nativeSpanProps
|
|
2531
|
+
} = props;
|
|
2532
|
+
const resolvedAriaLabel = ariaLabel ?? (typeof nativeSpanProps["aria-label"] === "string" ? nativeSpanProps["aria-label"] : void 0);
|
|
2533
|
+
const skeletonOptions = {
|
|
2534
|
+
...variant !== void 0 ? { variant } : {},
|
|
2535
|
+
...width !== void 0 ? { width } : {},
|
|
2536
|
+
...height !== void 0 ? { height } : {},
|
|
2537
|
+
...radius !== void 0 ? { radius } : {},
|
|
2538
|
+
...animation !== void 0 ? { animation } : {},
|
|
2539
|
+
...decorative !== void 0 ? { decorative } : {},
|
|
2540
|
+
...resolvedAriaLabel !== void 0 ? { ariaLabel: resolvedAriaLabel } : {},
|
|
2541
|
+
...id !== void 0 ? { id } : {}
|
|
2542
|
+
};
|
|
2543
|
+
const renderKit = createSkeletonRecipe(skeletonOptions);
|
|
2544
|
+
const mergedClassName = [renderKit.className, className].filter(Boolean).join(" ");
|
|
2545
|
+
const mergedStyle = { ...renderKit.vars, ...style };
|
|
2546
|
+
return /* @__PURE__ */ jsx(
|
|
2547
|
+
"span",
|
|
2548
|
+
{
|
|
2549
|
+
...nativeSpanProps,
|
|
2550
|
+
...renderKit.dataAttributes,
|
|
2551
|
+
...dataAttributes,
|
|
2552
|
+
className: mergedClassName,
|
|
2553
|
+
style: mergedStyle,
|
|
2554
|
+
role: renderKit.a11y.role,
|
|
2555
|
+
id: renderKit.a11y.id,
|
|
2556
|
+
"aria-hidden": renderKit.a11y.ariaHidden ? "true" : void 0,
|
|
2557
|
+
"aria-label": renderKit.a11y.ariaLabel,
|
|
2558
|
+
"aria-live": renderKit.a11y.ariaLive
|
|
2559
|
+
}
|
|
2560
|
+
);
|
|
2561
|
+
}
|
|
2514
2562
|
var Spacing = React2.forwardRef((props, ref) => {
|
|
2515
2563
|
const { className: customClassName, scale, size, spacing, style: customStyle } = props;
|
|
2516
2564
|
const resolvedSize = spacing ?? size;
|
|
@@ -2548,6 +2596,189 @@ function H3(props) {
|
|
|
2548
2596
|
const className = customClassName ? `${kit.className} ${customClassName}` : kit.className;
|
|
2549
2597
|
return /* @__PURE__ */ jsx("h3", { id: kit.a11y.id, "aria-label": kit.a11y.ariaLabel, className, style, children });
|
|
2550
2598
|
}
|
|
2599
|
+
function StatTile(props) {
|
|
2600
|
+
const {
|
|
2601
|
+
className,
|
|
2602
|
+
dataAttributes,
|
|
2603
|
+
label,
|
|
2604
|
+
value,
|
|
2605
|
+
subtitle,
|
|
2606
|
+
trendValue,
|
|
2607
|
+
trendDirection,
|
|
2608
|
+
tone,
|
|
2609
|
+
...nativeArticleProps
|
|
2610
|
+
} = props;
|
|
2611
|
+
const kit = createStatTileRecipe({
|
|
2612
|
+
...tone !== void 0 ? { tone } : {},
|
|
2613
|
+
...trendDirection !== void 0 ? { trendDirection } : {},
|
|
2614
|
+
...typeof trendValue === "string" ? { trendValue } : {},
|
|
2615
|
+
...dataAttributes !== void 0 ? { dataAttributes } : {}
|
|
2616
|
+
});
|
|
2617
|
+
const mergedClassName = [kit.className, className].filter(Boolean).join(" ");
|
|
2618
|
+
return /* @__PURE__ */ jsxs("article", { ...nativeArticleProps, ...kit.dataAttributes, className: mergedClassName, children: [
|
|
2619
|
+
/* @__PURE__ */ jsxs("div", { className: kit.slots.headerClassName, children: [
|
|
2620
|
+
/* @__PURE__ */ jsx("span", { className: kit.slots.labelClassName, children: label }),
|
|
2621
|
+
trendValue ? /* @__PURE__ */ jsxs(
|
|
2622
|
+
"span",
|
|
2623
|
+
{
|
|
2624
|
+
...kit.trendDataAttributes,
|
|
2625
|
+
className: kit.slots.trendClassName,
|
|
2626
|
+
"aria-label": kit.a11y.trendAriaLabel,
|
|
2627
|
+
children: [
|
|
2628
|
+
kit.trendIcon ? /* @__PURE__ */ jsx("span", { className: kit.slots.trendIconClassName, "aria-hidden": "true", children: kit.trendIcon }) : null,
|
|
2629
|
+
/* @__PURE__ */ jsx("span", { className: kit.slots.trendValueClassName, children: trendValue })
|
|
2630
|
+
]
|
|
2631
|
+
}
|
|
2632
|
+
) : null
|
|
2633
|
+
] }),
|
|
2634
|
+
/* @__PURE__ */ jsx("div", { className: kit.slots.valueClassName, children: value }),
|
|
2635
|
+
subtitle ? /* @__PURE__ */ jsx("div", { className: kit.slots.subtitleClassName, children: subtitle }) : null
|
|
2636
|
+
] });
|
|
2637
|
+
}
|
|
2638
|
+
function DatePicker(props) {
|
|
2639
|
+
const {
|
|
2640
|
+
className,
|
|
2641
|
+
monthLabel,
|
|
2642
|
+
weekdayLabels,
|
|
2643
|
+
weeks,
|
|
2644
|
+
device,
|
|
2645
|
+
previousYearLabel,
|
|
2646
|
+
previousMonthLabel,
|
|
2647
|
+
nextMonthLabel,
|
|
2648
|
+
nextYearLabel,
|
|
2649
|
+
cancelLabel,
|
|
2650
|
+
applyLabel,
|
|
2651
|
+
calendarLabel,
|
|
2652
|
+
dataAttributes,
|
|
2653
|
+
onPreviousYear,
|
|
2654
|
+
onPreviousMonth,
|
|
2655
|
+
onNextMonth,
|
|
2656
|
+
onNextYear,
|
|
2657
|
+
onDaySelect,
|
|
2658
|
+
onCancel,
|
|
2659
|
+
onApply,
|
|
2660
|
+
...nativeProps
|
|
2661
|
+
} = props;
|
|
2662
|
+
const kit = createDatePickerRecipe({
|
|
2663
|
+
...monthLabel !== void 0 ? { monthLabel } : {},
|
|
2664
|
+
...weekdayLabels !== void 0 ? { weekdayLabels } : {},
|
|
2665
|
+
...weeks !== void 0 ? { weeks } : {},
|
|
2666
|
+
...device !== void 0 ? { device } : {},
|
|
2667
|
+
...previousYearLabel !== void 0 ? { previousYearLabel } : {},
|
|
2668
|
+
...previousMonthLabel !== void 0 ? { previousMonthLabel } : {},
|
|
2669
|
+
...nextMonthLabel !== void 0 ? { nextMonthLabel } : {},
|
|
2670
|
+
...nextYearLabel !== void 0 ? { nextYearLabel } : {},
|
|
2671
|
+
...cancelLabel !== void 0 ? { cancelLabel } : {},
|
|
2672
|
+
...applyLabel !== void 0 ? { applyLabel } : {},
|
|
2673
|
+
...calendarLabel !== void 0 ? { calendarLabel } : {},
|
|
2674
|
+
...dataAttributes !== void 0 ? { dataAttributes } : {}
|
|
2675
|
+
});
|
|
2676
|
+
const mergedClassName = [kit.className, className].filter(Boolean).join(" ");
|
|
2677
|
+
return /* @__PURE__ */ jsxs(
|
|
2678
|
+
"section",
|
|
2679
|
+
{
|
|
2680
|
+
...nativeProps,
|
|
2681
|
+
...kit.dataAttributes,
|
|
2682
|
+
className: mergedClassName,
|
|
2683
|
+
"aria-label": kit.labels.calendar,
|
|
2684
|
+
children: [
|
|
2685
|
+
/* @__PURE__ */ jsxs("header", { className: kit.slots.headerClassName, children: [
|
|
2686
|
+
/* @__PURE__ */ jsxs("div", { className: kit.slots.navGroupClassName, children: [
|
|
2687
|
+
/* @__PURE__ */ jsx(
|
|
2688
|
+
"button",
|
|
2689
|
+
{
|
|
2690
|
+
type: "button",
|
|
2691
|
+
className: kit.slots.navButtonClassName,
|
|
2692
|
+
"aria-label": kit.labels.previousYear,
|
|
2693
|
+
onClick: onPreviousYear,
|
|
2694
|
+
children: "\xAB"
|
|
2695
|
+
}
|
|
2696
|
+
),
|
|
2697
|
+
/* @__PURE__ */ jsx(
|
|
2698
|
+
"button",
|
|
2699
|
+
{
|
|
2700
|
+
type: "button",
|
|
2701
|
+
className: kit.slots.navButtonClassName,
|
|
2702
|
+
"aria-label": kit.labels.previousMonth,
|
|
2703
|
+
onClick: onPreviousMonth,
|
|
2704
|
+
children: "\u2039"
|
|
2705
|
+
}
|
|
2706
|
+
)
|
|
2707
|
+
] }),
|
|
2708
|
+
/* @__PURE__ */ jsx("div", { className: kit.slots.monthLabelClassName, children: kit.monthLabel }),
|
|
2709
|
+
/* @__PURE__ */ jsxs("div", { className: kit.slots.navGroupClassName, children: [
|
|
2710
|
+
/* @__PURE__ */ jsx(
|
|
2711
|
+
"button",
|
|
2712
|
+
{
|
|
2713
|
+
type: "button",
|
|
2714
|
+
className: kit.slots.navButtonClassName,
|
|
2715
|
+
"aria-label": kit.labels.nextMonth,
|
|
2716
|
+
onClick: onNextMonth,
|
|
2717
|
+
children: "\u203A"
|
|
2718
|
+
}
|
|
2719
|
+
),
|
|
2720
|
+
/* @__PURE__ */ jsx(
|
|
2721
|
+
"button",
|
|
2722
|
+
{
|
|
2723
|
+
type: "button",
|
|
2724
|
+
className: kit.slots.navButtonClassName,
|
|
2725
|
+
"aria-label": kit.labels.nextYear,
|
|
2726
|
+
onClick: onNextYear,
|
|
2727
|
+
children: "\xBB"
|
|
2728
|
+
}
|
|
2729
|
+
)
|
|
2730
|
+
] })
|
|
2731
|
+
] }),
|
|
2732
|
+
/* @__PURE__ */ jsxs("table", { className: kit.slots.gridClassName, "aria-label": kit.monthLabel, children: [
|
|
2733
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { className: "mw-date-picker__weekdays", children: kit.weekdayLabels.map((weekday) => /* @__PURE__ */ jsx("th", { className: kit.slots.weekdayClassName, scope: "col", children: weekday }, weekday)) }) }),
|
|
2734
|
+
/* @__PURE__ */ jsx("tbody", { children: kit.weeks.map((week, weekIndex) => /* @__PURE__ */ jsx(
|
|
2735
|
+
"tr",
|
|
2736
|
+
{
|
|
2737
|
+
className: kit.slots.weekClassName,
|
|
2738
|
+
children: week.map((day, dayIndex) => {
|
|
2739
|
+
const dayKit = kit.dayKits[weekIndex]?.[dayIndex];
|
|
2740
|
+
if (!dayKit) return null;
|
|
2741
|
+
return /* @__PURE__ */ jsx(
|
|
2742
|
+
"td",
|
|
2743
|
+
{
|
|
2744
|
+
className: kit.slots.cellClassName,
|
|
2745
|
+
children: /* @__PURE__ */ jsx(
|
|
2746
|
+
"button",
|
|
2747
|
+
{
|
|
2748
|
+
type: "button",
|
|
2749
|
+
...dayKit.dataAttributes,
|
|
2750
|
+
className: dayKit.className,
|
|
2751
|
+
"aria-label": dayKit.ariaLabel,
|
|
2752
|
+
"aria-pressed": dayKit.selected ? "true" : void 0,
|
|
2753
|
+
disabled: dayKit.disabled,
|
|
2754
|
+
onClick: () => onDaySelect?.(day),
|
|
2755
|
+
children: day.label
|
|
2756
|
+
}
|
|
2757
|
+
)
|
|
2758
|
+
},
|
|
2759
|
+
day.date ?? `${weekIndex}-${dayIndex}`
|
|
2760
|
+
);
|
|
2761
|
+
})
|
|
2762
|
+
},
|
|
2763
|
+
week.map((day) => day.date ?? day.label).join("-")
|
|
2764
|
+
)) })
|
|
2765
|
+
] }),
|
|
2766
|
+
/* @__PURE__ */ jsxs("footer", { className: kit.slots.footerClassName, children: [
|
|
2767
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: kit.slots.footerButtonClassName, onClick: onCancel, children: kit.labels.cancel }),
|
|
2768
|
+
kit.labels.apply ? /* @__PURE__ */ jsx(
|
|
2769
|
+
"button",
|
|
2770
|
+
{
|
|
2771
|
+
type: "button",
|
|
2772
|
+
className: `${kit.slots.footerButtonClassName} mw-date-picker__footer-button--primary`,
|
|
2773
|
+
onClick: onApply,
|
|
2774
|
+
children: kit.labels.apply
|
|
2775
|
+
}
|
|
2776
|
+
) : null
|
|
2777
|
+
] })
|
|
2778
|
+
]
|
|
2779
|
+
}
|
|
2780
|
+
);
|
|
2781
|
+
}
|
|
2551
2782
|
function Card(props) {
|
|
2552
2783
|
const { title, children, className, dataAttributes, ...nativeDivProps } = props;
|
|
2553
2784
|
const kit = createCardRecipe(dataAttributes ? { dataAttributes } : {});
|
|
@@ -4407,6 +4638,6 @@ function InfoDialog(props) {
|
|
|
4407
4638
|
);
|
|
4408
4639
|
}
|
|
4409
4640
|
|
|
4410
|
-
export { Accordion, AccordionField, Avatar, AvatarBadge, AvatarGroup, Badge, BadgeGroup, BrightnessSlider, Button, ButtonSpinner, CancelButton, Card, Checkbox, CheckboxField, CheckboxGroupField, CloseButton, ConfirmButton, ConfirmDialog, ContentTabs, CopyButton, CreateButton, CurrencyField, DateOfBirthField, DestructiveButton, DestructiveDialog, Dialog, DialogModal, Divider, DownloadButton, DropdownButton, DropdownField, EditButton, EmailField, EmptyStateSpinner, ErrorToast, FAQAccordion, FeatureToggle, FilterButton, H1, H2, H3, Icon, InfoDialog, InfoToast, Input, InputField, InputOtp, LinkButton, MarwesProvider, NavigationTabs, NotificationBadge, OptionRadioGroup, Paragraph, PasswordField, PermissionSwitch, PhoneField, PreferenceSwitch, PresenceAvatar, PrimaryButton, PriorityBadge, ProductCard, ProfileAvatar, ProfileCard, Radio, RadioGroupField, RadiusSlider, RatingRadioGroup, RefreshButton, RichText, RichTextField, SaveButton, SearchButton, SearchField, SecondaryButton, SectionsAccordion, Select, SelectField, SettingsAccordion, SettingsTabs, Slider, SliderField, SortButton, Spacer, Spacing, Spinner, StatCard, StatusBadge, SubmitButton, SuccessButton, SuccessToast, Switch, SwitchField, Tab, TabGroup, TabPanel, TeamAvatarGroup, TextButton, Textarea, TextareaField, Toast, ToastContainer, ToastProvider, Tooltip, TooltipGroup, URLField, UploadButton, VerifyButton, VolumeSlider, WarningToast, YesNoRadioGroup, ZipCodeField, useTheme, useThemeMode, useToast };
|
|
4641
|
+
export { Accordion, AccordionField, Avatar, AvatarBadge, AvatarGroup, Badge, BadgeGroup, BrightnessSlider, Button, ButtonSpinner, CancelButton, Card, Checkbox, CheckboxField, CheckboxGroupField, CloseButton, ConfirmButton, ConfirmDialog, ContentTabs, CopyButton, CreateButton, CurrencyField, DateOfBirthField, DatePicker, DestructiveButton, DestructiveDialog, Dialog, DialogModal, Divider, DownloadButton, DropdownButton, DropdownField, EditButton, EmailField, EmptyStateSpinner, ErrorToast, FAQAccordion, FeatureToggle, FilterButton, H1, H2, H3, Icon, InfoDialog, InfoToast, Input, InputField, InputOtp, LinkButton, MarwesProvider, NavigationTabs, NotificationBadge, OptionRadioGroup, Paragraph, PasswordField, PermissionSwitch, PhoneField, PreferenceSwitch, PresenceAvatar, PrimaryButton, PriorityBadge, ProductCard, ProfileAvatar, ProfileCard, Radio, RadioGroupField, RadiusSlider, RatingRadioGroup, RefreshButton, RichText, RichTextField, SaveButton, SearchButton, SearchField, SecondaryButton, SectionsAccordion, Select, SelectField, SettingsAccordion, SettingsTabs, Skeleton, Slider, SliderField, SortButton, Spacer, Spacing, Spinner, StatCard, StatTile, StatusBadge, SubmitButton, SuccessButton, SuccessToast, Switch, SwitchField, Tab, TabGroup, TabPanel, TeamAvatarGroup, TextButton, Textarea, TextareaField, Toast, ToastContainer, ToastProvider, Tooltip, TooltipGroup, URLField, UploadButton, VerifyButton, VolumeSlider, WarningToast, YesNoRadioGroup, ZipCodeField, useTheme, useThemeMode, useToast };
|
|
4411
4642
|
//# sourceMappingURL=index.js.map
|
|
4412
4643
|
//# sourceMappingURL=index.js.map
|