@marwes-ui/core 1.4.1 → 1.5.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 CHANGED
@@ -152,10 +152,10 @@ Use these helpers when custom styling needs to stay connected to the active prov
152
152
  - `mwThemeVars` is the default custom styling API. It returns CSS `var(...)` references such as `"var(--mw-spacing-sp-24)"`.
153
153
  - `mwThemeVarNames` returns raw custom property names such as `"--mw-spacing-sp-24"` for assignment, inspection, tests, and bridge packages.
154
154
  - `mwVar()` wraps a custom `--mw-*` property name in `var(...)`, with optional fallback support.
155
- - `mwStyledTheme` mirrors `mwThemeVars` as a plain object for styled-components and Emotion theme providers.
155
+ - `mwTheme` mirrors `mwThemeVars` as a plain object for styled-components and Emotion theme providers. `mwStyledTheme` remains as a deprecated compatibility alias.
156
156
 
157
157
  ```ts
158
- import { mwStyledTheme, mwThemeVarNames, mwThemeVars, mwVar } from "@marwes-ui/core"
158
+ import { mwTheme, mwThemeVarNames, mwThemeVars, mwVar } from "@marwes-ui/core"
159
159
 
160
160
  mwThemeVars.spacing.sp24 // "var(--mw-spacing-sp-24)"
161
161
  mwThemeVars.color.text // "var(--mw-color-text)"
@@ -164,11 +164,13 @@ mwThemeVars.ui.radius // "var(--mw-ui-radius)"
164
164
 
165
165
  mwThemeVarNames.spacing.sp24 // "--mw-spacing-sp-24"
166
166
  mwVar("--mw-color-text", "#141414") // "var(--mw-color-text, #141414)"
167
- mwStyledTheme.spacing.sp24 // "var(--mw-spacing-sp-24)"
167
+ mwTheme.spacing.sp24 // "var(--mw-spacing-sp-24)"
168
168
  ```
169
169
 
170
170
  This enables one theme contract across plain CSS, CSS Modules, CSS-in-JS, vanilla-extract, Tailwind-style config files, inline style objects, React, Vue, Svelte, and future adapters. Because the helpers only expose CSS variable references and names, they remain framework-agnostic and follow any `ThemeInput` resolved by the provider.
171
171
 
172
+ `mwTheme`, `mwStyledTheme`, and `mwThemeVars` are CSS-reference objects, not resolved runtime themes. Values such as `"var(--mw-color-primary-base)"` are intended for CSS evaluation inside the provider scope and can be empty when JavaScript tries to resolve them from `:root`. Never use these helpers as the source for JavaScript color calculations, aliases, charts, or design-tool bridges. Use the adapter's `useTheme()` hook when logic needs concrete values such as `"#2457FF"`.
173
+
172
174
  Keep the APIs separate:
173
175
  - `Spacings.sp24` returns `"sp-24"` for Marwes component props.
174
176
  - `mwThemeVars.spacing.sp24` returns `"var(--mw-spacing-sp-24)"` for custom styling.
@@ -264,7 +266,8 @@ Theme:
264
266
  - `createMarwesThemeStyle`
265
267
  - `mwThemeVars`
266
268
  - `mwThemeVarNames`
267
- - `mwStyledTheme`
269
+ - `mwTheme`
270
+ - `mwStyledTheme` (deprecated compatibility alias)
268
271
  - `mwVar`
269
272
  - `lightThemeDefaults`
270
273
  - `darkThemeDefaults`
package/dist/index.d.ts CHANGED
@@ -5139,6 +5139,20 @@ interface ResolvedButtonLoading {
5139
5139
  spinnerVariant: SpinnerVariant;
5140
5140
  loadingLabel?: string;
5141
5141
  }
5142
+ /** Accessible-name contract for controls that never render visible text. */
5143
+ type AccessibleButtonName = {
5144
+ label: string;
5145
+ ariaLabel?: string;
5146
+ ariaLabelledBy?: string;
5147
+ } | {
5148
+ label?: string;
5149
+ ariaLabel: string;
5150
+ ariaLabelledBy?: string;
5151
+ } | {
5152
+ label?: string;
5153
+ ariaLabel?: string;
5154
+ ariaLabelledBy: string;
5155
+ };
5142
5156
  type ButtonOptions = {
5143
5157
  as?: "button" | "a";
5144
5158
  href?: string;
@@ -10483,4 +10497,4 @@ interface SkipLinkRenderKit {
10483
10497
 
10484
10498
  declare function createSkipLinkRecipe(opts: SkipLinkOptions): SkipLinkRenderKit;
10485
10499
 
10486
- export { type AccordionA11yProps, type AccordionOptions, type AccordionRenderKit, type AvatarA11yProps, type AvatarDataAttributes, type AvatarOptions, type AvatarRenderContent, type AvatarRenderKit, AvatarSize, AvatarType, type BadgeA11yProps, type BadgeOptions, type BadgeRenderKit, BadgeVariant, type BannerA11yProps, type BannerOptions, type BannerRenderKit, BannerVariant, type BreadcrumbA11yProps, type BreadcrumbEntryRenderKit, type BreadcrumbHomeA11yProps, type BreadcrumbHomeRenderKit, type BreadcrumbItem, type BreadcrumbItemA11yProps, type BreadcrumbItemRenderKit, type BreadcrumbListA11yProps, type BreadcrumbOptions, type BreadcrumbRenderKit, type BreadcrumbSeparatorA11yProps, type ButtonA11yProps, ButtonAction, type ButtonLoadingOptions, type ButtonOptions, type ButtonRenderKit, ButtonSize, ButtonVariant, type CardOptions, type CardRenderKit, type CheckboxA11y, type CheckboxProps, type CheckboxRenderKit, type CheckboxState, type ColorInput, type ColorRole, type ContextMenuA11yProps, type ContextMenuActionItem, type ContextMenuActionItemRenderKit, type ContextMenuDividerA11yProps, type ContextMenuDividerItem, type ContextMenuDividerRenderKit, type ContextMenuEntry, type ContextMenuEntryRenderKit, type ContextMenuItemA11yProps, type ContextMenuItemKind, type ContextMenuOptions, type ContextMenuRenderKit, type CssVars, type CurrencyCode, DEFAULT_PROGRESS_BAR_LABEL, DEFAULT_PROGRESS_BAR_MAX, DEFAULT_PROGRESS_BAR_MIN, DENSITY_SCALES, type DatePickerA11yProps, type DatePickerDataAttributes, type DatePickerDay, type DatePickerDayRenderKit, type DatePickerDayState, type DatePickerDevice, type DatePickerOptions, type DatePickerRenderKit, type Density, type DensityScale, type DialogA11yProps, type DialogOptions, type DialogRenderKit, type DialogSize, type DividerA11y, type DividerDataAttributes, type DividerOptions, type DividerOrientation, type DividerRenderKit, type DividerSize, type DrawerA11yProps, type DrawerOptions, type DrawerPanelRenderKit, type DrawerPlacement, type DrawerRenderKit, type DrawerScrimRenderKit, type DrawerSize, type FamilySemanticDefinition, type FieldComparisonRow, type FontLoadingConfig, type FontLoadingMode, type FontLoadingOptions, type HeadingA11y, type HeadingLevel, type HeadingOptions, type HeadingRenderKit, type HeadingSize, type IconA11yProps, type IconColor, IconName, IconName as IconNameType, type IconOptions, type IconPreset, type IconRenderKit, type IconSize, type IconSizeKey, type IconStrokeWidth, type IconStrokeWidthKey, type InputA11yProps, type InputOptions, type InputOtpA11yProps, type InputOtpOptions, type InputOtpRenderKit, type InputRenderKit, type InputTone, type LabeledCopy, type MarwesThemeScriptOptions, type MarwesThemeStyleOptions, type MwAvailableFont, type MwFontFallback, type MwGoogleFontFamily, type MwStyledTheme, type MwTheme, type MwThemeMedia, type MwThemeVarName, type MwThemeVarNames, type MwThemeVarReference, type MwThemeVars, type PaginationA11yProps, type PaginationAdaptiveMaxVisibleItemsOptions, type PaginationAdaptiveProfile, type PaginationAdaptiveProfileOptions, type PaginationControlA11yProps, type PaginationControlDirection, type PaginationControlDisplay, type PaginationControlOptions, type PaginationControlRenderKit, type PaginationEllipsisA11yProps, type PaginationEllipsisRenderKit, type PaginationGetItemAriaLabel, type PaginationItem, type PaginationItemAriaLabelOptions, type PaginationItemType, type PaginationListA11yProps, type PaginationListItemRenderKit, type PaginationListRenderKit, type PaginationOptions, type PaginationPageA11yProps, type PaginationPageOptions, type PaginationPageRenderKit, type PaginationRenderKit, type PaginationReservedItemCountOptions, type PaginationResolvedControlDisplay, type ParagraphA11y, type ParagraphOptions, type ParagraphRenderKit, type ParagraphSize, type PersonalityName, type ProgressBarA11yProps, type ProgressBarDataAttributes, type ProgressBarOptions, type ProgressBarRenderKit, ProgressBarSize, ProgressBarState, type PurposeSemanticDefinition, type RadioA11y, type RadioOptions, type RadioRenderKit, type ResolvedButtonLoading, type ResolvedTheme, type RichTextA11yProps, type RichTextFormat, type RichTextOptions, type RichTextRenderKit, type SecondaryColorRole, type SegmentedControlA11yProps, type SegmentedControlItemA11yProps, type SegmentedControlItemOptions, type SegmentedControlItemRenderKit, type SegmentedControlItemState, type SegmentedControlNavigationDirection, type SegmentedControlOptions, type SegmentedControlRenderKit, type SegmentedControlSize, type SegmentedControlVariant, type SelectA11yProps, type SelectAppearance, type SelectMode, type SelectOption, type SelectOptions, type SelectRenderKit, type SemanticAttributeDefinition, type SemanticAttributeName, type SemanticAttributeValue, type SemanticAttributes, type SemanticFamily, type SemanticHeadingLevel, type SemanticIntent, type SemanticLayer, type SemanticOrientation, type SemanticOutcome, type SemanticPurpose, type SkeletonA11yProps, SkeletonAnimation, type SkeletonDataAttributes, type SkeletonDimension, type SkeletonOptions, type SkeletonRenderKit, SkeletonVariant, type SkipLinkOptions, type SkipLinkRenderKit, type SliderA11yProps, type SliderDataAttributes, type SliderOptions, type SliderRenderKit, type SpacingA11y, type SpacingDataAttributes, type SpacingOptions, type SpacingRenderKit, type SpacingSize, Spacings, type SpinnerA11yProps, type SpinnerDataAttributes, type SpinnerOptions, type SpinnerRenderKit, type SpinnerSize, type SpinnerSvgDefinition, type SpinnerSvgElement, type SpinnerSvgNode, SpinnerVariant, SpinnerVariants, type StatTileA11yProps, type StatTileDataAttributes, type StatTileOptions, type StatTileRenderKit, type StatTileTone, type StatTileTrendDirection, type SvgElementType, type SvgNode, type SwitchA11yProps, type SwitchOptions, type SwitchRenderKit, SwitchSize, type SystemThemeMode, type TabA11yProps, type TabGroupA11yIds, type TabGroupItemState, type TabNavigationDirection, type TabOptions, type TabRenderKit, type TextA11y, type TextAs, type TextOptions, type TextRenderKit, type TextTransform, type TextTypographyStyle, TextVariant, type TextareaA11yProps, type TextareaOptions, type TextareaRenderKit, type TextareaResize, type Theme, type ThemeBreakpointName, type ThemeBreakpoints, type ThemeInput, type ThemeInputColor, ThemeMode, type ThemeModeAttribute, type ThemeModeCSSRulesOptions, type ThemeModeRootTarget, type ThemePreference, type ThemeVariableStrategy, type ToastA11yProps, type ToastContainerOptions, type ToastIntent, type ToastOptions, type ToastPlacement, type ToastRenderKit, type ToastVariant, type ToneName, type TooltipA11yProps, type TooltipDataAttributes, type TooltipOptions, type TooltipRenderKit, type TypographyStyle, accordionPurposeComponentReference, accordionWhyPurposeComponents, avatarPurposeSemantics, avatarPurposes, badgePurposeComponentReference, badgePurposeSemantics, badgePurposes, badgeWhyPurposeComponents, bannerPurposeSemantics, bannerPurposes, buildAccordionFieldA11yIds, buildCheckboxA11y, buildCheckboxFieldA11yIds, buildCheckboxGroupFieldA11yIds, buildCurrencyHelperText, buildGoogleFontsUrl, buildHeadingA11y, buildInputFieldA11yIds, buildRadioA11y, buildRadioGroupFieldA11yIds, buildRichTextFieldA11yIds, buildSliderFieldA11yIds, buildSwitchFieldA11yIds, buildTabGroupA11yIds, buttonActionSemanticPurposes, buttonPurposeSemantics, buttonPurposes, buttonVariantVisualStyles, buttonWhySemanticComponents, canonicalSemanticAttributeNames, canonicalSemanticAttributeRegistry, canonicalSemanticAttributes, cardPurposeComponentReference, cardWhyPurposeComponents, checkboxRecipe, clampPaginationPage, clampProgressBarValue, createAccordionRecipe, createAvatarRecipe, createBadgeRecipe, createBannerRecipe, createBreadcrumbRecipe, createButtonRecipe, createCardRecipe, createContextMenuRecipe, createDatePickerRecipe, createDialogRecipe, createDividerRecipe, createDrawerRecipe, createFamilySemanticAttributes, createFontStack, createIconRecipe, createInputOtpRecipe, createInputRecipe, createMarwesThemeScript, createMarwesThemeStyle, createMwTheme, createMwThemeMedia, createPaginationControlRecipe, createPaginationEllipsisRecipe, createPaginationItems, createPaginationListItemRecipe, createPaginationListRecipe, createPaginationPageRecipe, createPaginationRecipe, createProgressBarRecipe, createPurposeSemanticAttributes, createRichTextRecipe, createSegmentedControlItemRecipe, createSegmentedControlRecipe, createSelectRecipe, createSkeletonRecipe, createSkipLinkRecipe, createSliderRecipe, createSpacingRecipe, createSpinnerRecipe, createStatTileRecipe, createSwitchRecipe, createTabRecipe, createTextareaRecipe, createToastRecipe, createTooltipRecipe, currencyCodes, darkThemeDefaults, defaultThemeBreakpoints, densityToCSSVars, dialogPurposeComponentReference, dialogPurposeSemantics, dialogPurposes, dialogWhyPurposeComponents, emptySemanticAttributes, escapeRichTextHtml, extractFontFamilyName, extractUsedWeights, familySemanticsRegistry, fieldComparisonRows, fieldWhyPurposeComponents, filterUndefinedSemanticAttributes, getCurrencySymbol, headingRecipe, iconNames, iconNamesList, iconRegistry, iconSizeScale, iconStrokeWidthScale, isRichTextHtmlEmpty, isSystemFont, isThemeMode, isThemePreference, lightThemeDefaults, mergeIdRefs, mergeSemanticAttributes, moveSegmentedControlSelection, moveTabSelection, mwAvailableFonts, mwFontFallbacks, mwGoogleFontFamilies, mwStyledTheme, mwTheme, mwThemeVarNames, mwThemeVars, mwVar, nextThemeMode, normalizeRichTextHtml, paragraphRecipe, progressBarSizes, progressBarStates, purposeSemanticsRegistry, radioPurposeComponentReference, radioRecipe, radioWhyPurposeComponents, resolveAccordionA11y, resolveAvatarA11y, resolveBadgeA11y, resolveBannerA11y, resolveBreadcrumbA11y, resolveBreadcrumbHomeA11y, resolveBreadcrumbItemA11y, resolveBreadcrumbListA11y, resolveBreadcrumbSeparatorA11y, resolveButtonLoading, resolveContextMenuA11y, resolveContextMenuDividerA11y, resolveContextMenuItemA11y, resolveDatePickerDayLabel, resolveDialogA11y, resolveDrawerA11y, resolveIconA11y, resolveIconSize, resolveIconStrokeWidth, resolvePaginationA11y, resolvePaginationAdaptiveMaxVisibleItems, resolvePaginationAdaptiveProfile, resolvePaginationControlA11y, resolvePaginationEllipsisA11y, resolvePaginationItemAriaLabel, resolvePaginationListA11y, resolvePaginationPageA11y, resolvePaginationReservedItemCount, resolveProgressBarA11y, resolveProgressBarBounds, resolveRichTextAllowedFormats, resolveSegmentedControlA11y, resolveSegmentedControlItemA11y, resolveSegmentedControlValue, resolveSelectMode, resolveServerThemeMode, resolveSkeletonA11y, resolveSliderA11y, resolveSpinnerA11y, resolveSpinnerSize, resolveStatTileTrendLabel, resolveSwitchA11y, resolveTabA11y, resolveTabValue, resolveThemeInput, resolveThemePreference, resolveToastA11y, resolveTone, resolveTooltipA11y, richTextCommandByFormat, richTextFormattingReference, richTextWhyUseIt, sanitizeCurrencyValue, sanitizeInputOtpValue, semanticFamilies, semanticFrameworkSupport, semanticIntents, semanticLayers, semanticOrientations, semanticOutcomes, semanticPurposes, shouldLoadGoogleFont, skeletonAnimations, skeletonVariants, sliderPurposeComponentReference, sliderWhyPurposeComponents, spinnerSizeScale, spinnerSizes, spinnerVariants, storybookA11yPolicy, storybookButtonGeneralArgTypes, storybookButtonIconArgTypes, storybookButtonPurposeArgTypes, storybookCheckboxArgTypes, storybookDatePickerArgTypes, storybookDividerArgTypes, storybookDocsDescription, storybookIconButtonArgTypes, storybookIconGalleryArgTypes, storybookIconGalleryDefaults, storybookIconNames, storybookLayout, storybookOptionalIconNames, storybookProgressBarArgTypes, storybookRadioArgTypes, storybookSkeletonArgTypes, storybookSliderArgTypes, storybookSpacingArgTypes, storybookSpinnerArgTypes, storybookStatTileArgTypes, switchPurposeComponentReference, switchWhyPurposeComponents, tabPurposeComponentReference, tabWhyPurposeComponents, textRecipe, themeModesToCSSRules, themeToCSSRule, themeToCSSVars, toastPurposeComponentReference, toastPurposeSemantics, toastPurposes, toastWhyPurposeComponents, validateSemanticRegistry };
10500
+ export { type AccessibleButtonName, type AccordionA11yProps, type AccordionOptions, type AccordionRenderKit, type AvatarA11yProps, type AvatarDataAttributes, type AvatarOptions, type AvatarRenderContent, type AvatarRenderKit, AvatarSize, AvatarType, type BadgeA11yProps, type BadgeOptions, type BadgeRenderKit, BadgeVariant, type BannerA11yProps, type BannerOptions, type BannerRenderKit, BannerVariant, type BreadcrumbA11yProps, type BreadcrumbEntryRenderKit, type BreadcrumbHomeA11yProps, type BreadcrumbHomeRenderKit, type BreadcrumbItem, type BreadcrumbItemA11yProps, type BreadcrumbItemRenderKit, type BreadcrumbListA11yProps, type BreadcrumbOptions, type BreadcrumbRenderKit, type BreadcrumbSeparatorA11yProps, type ButtonA11yProps, ButtonAction, type ButtonLoadingOptions, type ButtonOptions, type ButtonRenderKit, ButtonSize, ButtonVariant, type CardOptions, type CardRenderKit, type CheckboxA11y, type CheckboxProps, type CheckboxRenderKit, type CheckboxState, type ColorInput, type ColorRole, type ContextMenuA11yProps, type ContextMenuActionItem, type ContextMenuActionItemRenderKit, type ContextMenuDividerA11yProps, type ContextMenuDividerItem, type ContextMenuDividerRenderKit, type ContextMenuEntry, type ContextMenuEntryRenderKit, type ContextMenuItemA11yProps, type ContextMenuItemKind, type ContextMenuOptions, type ContextMenuRenderKit, type CssVars, type CurrencyCode, DEFAULT_PROGRESS_BAR_LABEL, DEFAULT_PROGRESS_BAR_MAX, DEFAULT_PROGRESS_BAR_MIN, DENSITY_SCALES, type DatePickerA11yProps, type DatePickerDataAttributes, type DatePickerDay, type DatePickerDayRenderKit, type DatePickerDayState, type DatePickerDevice, type DatePickerOptions, type DatePickerRenderKit, type Density, type DensityScale, type DialogA11yProps, type DialogOptions, type DialogRenderKit, type DialogSize, type DividerA11y, type DividerDataAttributes, type DividerOptions, type DividerOrientation, type DividerRenderKit, type DividerSize, type DrawerA11yProps, type DrawerOptions, type DrawerPanelRenderKit, type DrawerPlacement, type DrawerRenderKit, type DrawerScrimRenderKit, type DrawerSize, type FamilySemanticDefinition, type FieldComparisonRow, type FontLoadingConfig, type FontLoadingMode, type FontLoadingOptions, type HeadingA11y, type HeadingLevel, type HeadingOptions, type HeadingRenderKit, type HeadingSize, type IconA11yProps, type IconColor, IconName, IconName as IconNameType, type IconOptions, type IconPreset, type IconRenderKit, type IconSize, type IconSizeKey, type IconStrokeWidth, type IconStrokeWidthKey, type InputA11yProps, type InputOptions, type InputOtpA11yProps, type InputOtpOptions, type InputOtpRenderKit, type InputRenderKit, type InputTone, type LabeledCopy, type MarwesThemeScriptOptions, type MarwesThemeStyleOptions, type MwAvailableFont, type MwFontFallback, type MwGoogleFontFamily, type MwStyledTheme, type MwTheme, type MwThemeMedia, type MwThemeVarName, type MwThemeVarNames, type MwThemeVarReference, type MwThemeVars, type PaginationA11yProps, type PaginationAdaptiveMaxVisibleItemsOptions, type PaginationAdaptiveProfile, type PaginationAdaptiveProfileOptions, type PaginationControlA11yProps, type PaginationControlDirection, type PaginationControlDisplay, type PaginationControlOptions, type PaginationControlRenderKit, type PaginationEllipsisA11yProps, type PaginationEllipsisRenderKit, type PaginationGetItemAriaLabel, type PaginationItem, type PaginationItemAriaLabelOptions, type PaginationItemType, type PaginationListA11yProps, type PaginationListItemRenderKit, type PaginationListRenderKit, type PaginationOptions, type PaginationPageA11yProps, type PaginationPageOptions, type PaginationPageRenderKit, type PaginationRenderKit, type PaginationReservedItemCountOptions, type PaginationResolvedControlDisplay, type ParagraphA11y, type ParagraphOptions, type ParagraphRenderKit, type ParagraphSize, type PersonalityName, type ProgressBarA11yProps, type ProgressBarDataAttributes, type ProgressBarOptions, type ProgressBarRenderKit, ProgressBarSize, ProgressBarState, type PurposeSemanticDefinition, type RadioA11y, type RadioOptions, type RadioRenderKit, type ResolvedButtonLoading, type ResolvedTheme, type RichTextA11yProps, type RichTextFormat, type RichTextOptions, type RichTextRenderKit, type SecondaryColorRole, type SegmentedControlA11yProps, type SegmentedControlItemA11yProps, type SegmentedControlItemOptions, type SegmentedControlItemRenderKit, type SegmentedControlItemState, type SegmentedControlNavigationDirection, type SegmentedControlOptions, type SegmentedControlRenderKit, type SegmentedControlSize, type SegmentedControlVariant, type SelectA11yProps, type SelectAppearance, type SelectMode, type SelectOption, type SelectOptions, type SelectRenderKit, type SemanticAttributeDefinition, type SemanticAttributeName, type SemanticAttributeValue, type SemanticAttributes, type SemanticFamily, type SemanticHeadingLevel, type SemanticIntent, type SemanticLayer, type SemanticOrientation, type SemanticOutcome, type SemanticPurpose, type SkeletonA11yProps, SkeletonAnimation, type SkeletonDataAttributes, type SkeletonDimension, type SkeletonOptions, type SkeletonRenderKit, SkeletonVariant, type SkipLinkOptions, type SkipLinkRenderKit, type SliderA11yProps, type SliderDataAttributes, type SliderOptions, type SliderRenderKit, type SpacingA11y, type SpacingDataAttributes, type SpacingOptions, type SpacingRenderKit, type SpacingSize, Spacings, type SpinnerA11yProps, type SpinnerDataAttributes, type SpinnerOptions, type SpinnerRenderKit, type SpinnerSize, type SpinnerSvgDefinition, type SpinnerSvgElement, type SpinnerSvgNode, SpinnerVariant, SpinnerVariants, type StatTileA11yProps, type StatTileDataAttributes, type StatTileOptions, type StatTileRenderKit, type StatTileTone, type StatTileTrendDirection, type SvgElementType, type SvgNode, type SwitchA11yProps, type SwitchOptions, type SwitchRenderKit, SwitchSize, type SystemThemeMode, type TabA11yProps, type TabGroupA11yIds, type TabGroupItemState, type TabNavigationDirection, type TabOptions, type TabRenderKit, type TextA11y, type TextAs, type TextOptions, type TextRenderKit, type TextTransform, type TextTypographyStyle, TextVariant, type TextareaA11yProps, type TextareaOptions, type TextareaRenderKit, type TextareaResize, type Theme, type ThemeBreakpointName, type ThemeBreakpoints, type ThemeInput, type ThemeInputColor, ThemeMode, type ThemeModeAttribute, type ThemeModeCSSRulesOptions, type ThemeModeRootTarget, type ThemePreference, type ThemeVariableStrategy, type ToastA11yProps, type ToastContainerOptions, type ToastIntent, type ToastOptions, type ToastPlacement, type ToastRenderKit, type ToastVariant, type ToneName, type TooltipA11yProps, type TooltipDataAttributes, type TooltipOptions, type TooltipRenderKit, type TypographyStyle, accordionPurposeComponentReference, accordionWhyPurposeComponents, avatarPurposeSemantics, avatarPurposes, badgePurposeComponentReference, badgePurposeSemantics, badgePurposes, badgeWhyPurposeComponents, bannerPurposeSemantics, bannerPurposes, buildAccordionFieldA11yIds, buildCheckboxA11y, buildCheckboxFieldA11yIds, buildCheckboxGroupFieldA11yIds, buildCurrencyHelperText, buildGoogleFontsUrl, buildHeadingA11y, buildInputFieldA11yIds, buildRadioA11y, buildRadioGroupFieldA11yIds, buildRichTextFieldA11yIds, buildSliderFieldA11yIds, buildSwitchFieldA11yIds, buildTabGroupA11yIds, buttonActionSemanticPurposes, buttonPurposeSemantics, buttonPurposes, buttonVariantVisualStyles, buttonWhySemanticComponents, canonicalSemanticAttributeNames, canonicalSemanticAttributeRegistry, canonicalSemanticAttributes, cardPurposeComponentReference, cardWhyPurposeComponents, checkboxRecipe, clampPaginationPage, clampProgressBarValue, createAccordionRecipe, createAvatarRecipe, createBadgeRecipe, createBannerRecipe, createBreadcrumbRecipe, createButtonRecipe, createCardRecipe, createContextMenuRecipe, createDatePickerRecipe, createDialogRecipe, createDividerRecipe, createDrawerRecipe, createFamilySemanticAttributes, createFontStack, createIconRecipe, createInputOtpRecipe, createInputRecipe, createMarwesThemeScript, createMarwesThemeStyle, createMwTheme, createMwThemeMedia, createPaginationControlRecipe, createPaginationEllipsisRecipe, createPaginationItems, createPaginationListItemRecipe, createPaginationListRecipe, createPaginationPageRecipe, createPaginationRecipe, createProgressBarRecipe, createPurposeSemanticAttributes, createRichTextRecipe, createSegmentedControlItemRecipe, createSegmentedControlRecipe, createSelectRecipe, createSkeletonRecipe, createSkipLinkRecipe, createSliderRecipe, createSpacingRecipe, createSpinnerRecipe, createStatTileRecipe, createSwitchRecipe, createTabRecipe, createTextareaRecipe, createToastRecipe, createTooltipRecipe, currencyCodes, darkThemeDefaults, defaultThemeBreakpoints, densityToCSSVars, dialogPurposeComponentReference, dialogPurposeSemantics, dialogPurposes, dialogWhyPurposeComponents, emptySemanticAttributes, escapeRichTextHtml, extractFontFamilyName, extractUsedWeights, familySemanticsRegistry, fieldComparisonRows, fieldWhyPurposeComponents, filterUndefinedSemanticAttributes, getCurrencySymbol, headingRecipe, iconNames, iconNamesList, iconRegistry, iconSizeScale, iconStrokeWidthScale, isRichTextHtmlEmpty, isSystemFont, isThemeMode, isThemePreference, lightThemeDefaults, mergeIdRefs, mergeSemanticAttributes, moveSegmentedControlSelection, moveTabSelection, mwAvailableFonts, mwFontFallbacks, mwGoogleFontFamilies, mwStyledTheme, mwTheme, mwThemeVarNames, mwThemeVars, mwVar, nextThemeMode, normalizeRichTextHtml, paragraphRecipe, progressBarSizes, progressBarStates, purposeSemanticsRegistry, radioPurposeComponentReference, radioRecipe, radioWhyPurposeComponents, resolveAccordionA11y, resolveAvatarA11y, resolveBadgeA11y, resolveBannerA11y, resolveBreadcrumbA11y, resolveBreadcrumbHomeA11y, resolveBreadcrumbItemA11y, resolveBreadcrumbListA11y, resolveBreadcrumbSeparatorA11y, resolveButtonLoading, resolveContextMenuA11y, resolveContextMenuDividerA11y, resolveContextMenuItemA11y, resolveDatePickerDayLabel, resolveDialogA11y, resolveDrawerA11y, resolveIconA11y, resolveIconSize, resolveIconStrokeWidth, resolvePaginationA11y, resolvePaginationAdaptiveMaxVisibleItems, resolvePaginationAdaptiveProfile, resolvePaginationControlA11y, resolvePaginationEllipsisA11y, resolvePaginationItemAriaLabel, resolvePaginationListA11y, resolvePaginationPageA11y, resolvePaginationReservedItemCount, resolveProgressBarA11y, resolveProgressBarBounds, resolveRichTextAllowedFormats, resolveSegmentedControlA11y, resolveSegmentedControlItemA11y, resolveSegmentedControlValue, resolveSelectMode, resolveServerThemeMode, resolveSkeletonA11y, resolveSliderA11y, resolveSpinnerA11y, resolveSpinnerSize, resolveStatTileTrendLabel, resolveSwitchA11y, resolveTabA11y, resolveTabValue, resolveThemeInput, resolveThemePreference, resolveToastA11y, resolveTone, resolveTooltipA11y, richTextCommandByFormat, richTextFormattingReference, richTextWhyUseIt, sanitizeCurrencyValue, sanitizeInputOtpValue, semanticFamilies, semanticFrameworkSupport, semanticIntents, semanticLayers, semanticOrientations, semanticOutcomes, semanticPurposes, shouldLoadGoogleFont, skeletonAnimations, skeletonVariants, sliderPurposeComponentReference, sliderWhyPurposeComponents, spinnerSizeScale, spinnerSizes, spinnerVariants, storybookA11yPolicy, storybookButtonGeneralArgTypes, storybookButtonIconArgTypes, storybookButtonPurposeArgTypes, storybookCheckboxArgTypes, storybookDatePickerArgTypes, storybookDividerArgTypes, storybookDocsDescription, storybookIconButtonArgTypes, storybookIconGalleryArgTypes, storybookIconGalleryDefaults, storybookIconNames, storybookLayout, storybookOptionalIconNames, storybookProgressBarArgTypes, storybookRadioArgTypes, storybookSkeletonArgTypes, storybookSliderArgTypes, storybookSpacingArgTypes, storybookSpinnerArgTypes, storybookStatTileArgTypes, switchPurposeComponentReference, switchWhyPurposeComponents, tabPurposeComponentReference, tabWhyPurposeComponents, textRecipe, themeModesToCSSRules, themeToCSSRule, themeToCSSVars, toastPurposeComponentReference, toastPurposeSemantics, toastPurposes, toastWhyPurposeComponents, validateSemanticRegistry };
package/dist/index.js CHANGED
@@ -5478,26 +5478,27 @@ function isDev2() {
5478
5478
  return true;
5479
5479
  }
5480
5480
  var __DEV__2 = isDev2();
5481
+ function nonEmptyName(value) {
5482
+ const normalized = value?.trim();
5483
+ return normalized ? normalized : void 0;
5484
+ }
5481
5485
  function resolveButtonA11y(opts, resolvedLoading) {
5482
5486
  const tag = opts.as === "a" || !!opts.href ? "a" : "button";
5483
5487
  const isDisabled = !!opts.disabled || resolvedLoading.isLoading && resolvedLoading.disableWhileLoading;
5488
+ const ariaLabelledBy = nonEmptyName(opts.ariaLabelledBy);
5489
+ const ariaLabel = nonEmptyName(opts.ariaLabel) ?? nonEmptyName(opts.label);
5490
+ const loadingAccessibleLabel = resolvedLoading.isLoading ? nonEmptyName(resolvedLoading.loadingLabel) : void 0;
5484
5491
  if (__DEV__2) {
5485
5492
  const iconOnly = opts.iconOnly || opts.hasVisibleText === false;
5486
- const accessibleLabel = opts.ariaLabel ?? opts.label;
5487
- const loadingAccessibleLabel = resolvedLoading.isLoading ? resolvedLoading.loadingLabel : void 0;
5488
- if (iconOnly && !accessibleLabel && !loadingAccessibleLabel) {
5493
+ if (iconOnly && !ariaLabelledBy && !ariaLabel && !loadingAccessibleLabel) {
5489
5494
  console.warn(
5490
- "[marwes] Icon-only Button requires ariaLabel, label, or loadingLabel while loading."
5495
+ "[marwes] Icon-only Button requires label, ariaLabel, ariaLabelledBy, or loadingLabel while loading."
5491
5496
  );
5492
5497
  }
5493
5498
  }
5494
5499
  const common = {};
5495
- if (opts.ariaLabelledBy) {
5496
- common.ariaLabelledBy = opts.ariaLabelledBy;
5497
- } else {
5498
- const accessibleLabel = opts.ariaLabel ?? opts.label;
5499
- if (accessibleLabel) common.ariaLabel = accessibleLabel;
5500
- }
5500
+ if (ariaLabelledBy) common.ariaLabelledBy = ariaLabelledBy;
5501
+ else if (ariaLabel) common.ariaLabel = ariaLabel;
5501
5502
  if (resolvedLoading.isLoading) common.ariaBusy = true;
5502
5503
  if (isDisabled) common.ariaDisabled = true;
5503
5504
  if (opts.toggle) common.ariaPressed = !!opts.pressed;