@rarui/components 1.31.0 → 1.32.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/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  `@rarui/components` components is a component library built with [Lit](https://lit.dev/).
4
4
 
5
+ ## 2026-01-19 `1.32.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - **Modal Header title Property**: Added `title` and `subtitle` properties to ModalHeader component for simplified modal header creation. When provided, automatically renders title as `<rarui-title as="h5">` and subtitle as `<rarui-text>` with appropriate styling, eliminating the need for manual slot content for common use cases. ([#151](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/151) by [@junior](https://git.rarolabs.com.br/junior))
10
+
11
+ #### 🐛 Bug fixes
12
+
13
+ - **Select Form Value Clear Fix**: Fixed Select component not clearing form values when clicking the clear all options button in multiple selection mode. Added missing `_updateFormValue()` call in `handleResetOptions()` method to properly sync FormData with ElementInternals API, ensuring form submission reflects cleared state. ([#151](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/151) by [@junior](https://git.rarolabs.com.br/junior))
14
+ - **Banner Tonal Close Button Color**: Fixed Banner component close button color inconsistency in tonal variant. Implemented `getTonalColorButtonClose` mapping to ensure close button uses appropriate appearance colors (brand, warning, error, success, primary) based on banner appearance when tonal variant is enabled, improving visual consistency and readability. ([#151](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/151) by [@junior](https://git.rarolabs.com.br/junior))
15
+ - **RadioButton Shape Preservation**: Fixed RadioButton component visual deformation when label text becomes too large. Radio button now maintains its circular shape with proper `minWidth` and `minHeight` constraints (1.25rem for small, 1.5rem for large), preventing flex container from shrinking the radio circle regardless of label length. ([#151](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/151) by [@junior](https://git.rarolabs.com.br/junior))
16
+
17
+ ## 2025-11-26 `1.31.1`
18
+
19
+ #### 🎉 New features
20
+
21
+ - **IconButton `as` Property**: Added `as` property to IconButton component allowing it to render as either `button` (default) or `a` elements. When `as="a"` is used, the component accepts `href` and `target` properties for link behavior while maintaining the same visual styling and click event handling. Form-related functionality (submit/reset) is only active when `as="button"`. Also added `PassThroughAttributesMixin` for data-* attribute support and improved property bindings with `reflect: true` for better debugging. ([#150](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/150) by [@junior](https://git.rarolabs.com.br/junior))
22
+ - **RadioButton Screen Reader Group Announcement**: Enhanced RadioButton component with ARIA group position attributes (`aria-setsize`, `aria-posinset`) for proper screen reader announcements. Radio buttons now correctly announce their position within the group (e.g., "option 1 of 4" instead of "option 1 of 1"). Includes automatic group detection via MutationObserver for dynamic DOM updates. ([#150](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/150) by [@junior](https://git.rarolabs.com.br/junior))
23
+
24
+ #### 🐛 Bug fixes
25
+
26
+ - **Select Keyboard Navigation**: Fixed Select component keyboard navigation where Enter key on options was not closing the menu. Moved `@keydown` handler from dropdown to trigger element only, preventing option events from propagating and triggering menu toggle. ([#150](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/150) by [@junior](https://git.rarolabs.com.br/junior))
27
+ - **Checkbox Readonly Focus Ring**: Fixed Checkbox component showing focus ring when in readonly state. Added `:focus-within:not(:read-only)` CSS selector to prevent focus ring, set `tabindex="-1"` to make readonly checkboxes non-focusable, and added `aria-readonly` attribute for screen readers. Updated hover overlay styles to exclude readonly state. ([#150](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/150) by [@junior](https://git.rarolabs.com.br/junior))
28
+ - **Select Clear Button Keyboard Navigation**: Fixed Select multiple clear options button not working with Space key. Added `stopPropagation()` for Space/Enter keyboard events on the clear button to prevent the events from bubbling up to parent trigger's keydown handler which was opening the menu instead of clearing options. ([#150](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/150) by [@junior](https://git.rarolabs.com.br/junior))
29
+
30
+ #### 💡 Others
31
+
32
+ - **Toggle Property Binding Improvements**: Enhanced Toggle component property bindings following Lit best practices. Added `reflect: true` to all visual and state properties (size, error, selected, disabled, required) for better CSS styling support and debugging visibility. Removed unnecessary boolean converters as Lit handles boolean attributes automatically. Added explicit default values for `selected` and `disabled` properties for consistency. ([#150](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/150) by [@junior](https://git.rarolabs.com.br/junior))
33
+ - **RadioButton Property Binding Improvements**: Enhanced RadioButton component property bindings following Lit best practices. Added `reflect: true` to all visual and state properties (disabled, size, error, selected, required, readonly) for better CSS styling support and debugging visibility. Removed unnecessary boolean converters and optional types on properties with default values. ([#150](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/150) by [@junior](https://git.rarolabs.com.br/junior))
34
+ - **Screen Reader Improvements**: Added `aria-hidden="true"` to decorative text elements (Toggle label, Checkbox label, RadioButton label) to prevent duplicate screen reader announcements. Labels are now properly announced via `aria-label` on input elements only. ([#150](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/150) by [@junior](https://git.rarolabs.com.br/junior))
35
+
5
36
  ## 2025-11-25 `1.31.0`
6
37
 
7
38
  #### 🎉 New features
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.30.3",
2
+ "version": "1.31.1",
3
3
  "tags": [
4
4
  {
5
5
  "name": "rarui-avatar",
@@ -2493,6 +2493,33 @@
2493
2493
  }
2494
2494
  ],
2495
2495
  "default": "solid"
2496
+ },
2497
+ {
2498
+ "name": "min-width",
2499
+ "description": "The **`min-width`** CSS property sets the minimum width of an element. It prevents the used value of the `width` property from becoming smaller than the value specified for `min-width`. It is also possible to pass a specific value.\n\n\n**Initial value**: `auto`\n\nThis property supports responsive values. You can pass a single value like `\"auto\"`.\n\n Or an object like:\n \n ```\n{\n \"xs\": \"auto\",\n \"md\": \"fit-content\",\n \"lg\": \"intrinsic\",\n \"xl\": \"max-content\"\n}\n```\n\n- auto\n- fit-content\n- intrinsic\n- max-content\n- min-content\n- min-intrinsic\n- stretch",
2500
+ "values": [
2501
+ {
2502
+ "name": "auto"
2503
+ },
2504
+ {
2505
+ "name": "fit-content"
2506
+ },
2507
+ {
2508
+ "name": "intrinsic"
2509
+ },
2510
+ {
2511
+ "name": "max-content"
2512
+ },
2513
+ {
2514
+ "name": "min-content"
2515
+ },
2516
+ {
2517
+ "name": "min-intrinsic"
2518
+ },
2519
+ {
2520
+ "name": "stretch"
2521
+ }
2522
+ ]
2496
2523
  }
2497
2524
  ]
2498
2525
  },
@@ -3212,9 +3239,24 @@
3212
3239
  "type": "boolean",
3213
3240
  "default": false
3214
3241
  },
3242
+ {
3243
+ "name": "as",
3244
+ "description": "Defines the HTML element type to render.\n\n- a\n- button\n\n@default button",
3245
+ "type": "string",
3246
+ "values": [
3247
+ {
3248
+ "name": "a"
3249
+ },
3250
+ {
3251
+ "name": "button",
3252
+ "description": "(default)"
3253
+ }
3254
+ ],
3255
+ "default": "button"
3256
+ },
3215
3257
  {
3216
3258
  "name": "type",
3217
- "description": "Defines the native button type.\n\n- button\n- reset\n- submit\n\n@default button",
3259
+ "description": "Defines the native button type. Only applies when as=\"button\".\n\n- button\n- reset\n- submit\n\n@default button",
3218
3260
  "type": "string",
3219
3261
  "values": [
3220
3262
  {
@@ -3232,18 +3274,42 @@
3232
3274
  },
3233
3275
  {
3234
3276
  "name": "name",
3235
- "description": "The name of the button for form submission.",
3277
+ "description": "The name of the button for form submission. Only applies when as=\"button\".",
3236
3278
  "type": "string"
3237
3279
  },
3238
3280
  {
3239
3281
  "name": "value",
3240
- "description": "The value of the button for form submission.",
3282
+ "description": "The value of the button for form submission. Only applies when as=\"button\".",
3241
3283
  "type": "string"
3242
3284
  },
3243
3285
  {
3244
3286
  "name": "form",
3245
- "description": "Associates the button with a form element by ID.",
3287
+ "description": "Associates the button with a form element by ID. Only applies when as=\"button\".",
3288
+ "type": "string"
3289
+ },
3290
+ {
3291
+ "name": "href",
3292
+ "description": "The URL to navigate to. Only applies when as=\"a\".",
3246
3293
  "type": "string"
3294
+ },
3295
+ {
3296
+ "name": "target",
3297
+ "description": "Specifies where to open the linked document. Only applies when as=\"a\".\n\n- _blank\n- _parent\n- _self\n- _top",
3298
+ "type": "string",
3299
+ "values": [
3300
+ {
3301
+ "name": "_blank"
3302
+ },
3303
+ {
3304
+ "name": "_parent"
3305
+ },
3306
+ {
3307
+ "name": "_self"
3308
+ },
3309
+ {
3310
+ "name": "_top"
3311
+ }
3312
+ ]
3247
3313
  }
3248
3314
  ]
3249
3315
  },
package/dist/index.d.ts CHANGED
@@ -17020,7 +17020,9 @@ declare const styles$3: {
17020
17020
  size: {
17021
17021
  small: {
17022
17022
  width: "1.25rem";
17023
+ minWidth: "1.25rem";
17023
17024
  height: "1.25rem";
17025
+ minHeight: "1.25rem";
17024
17026
  ":before": {
17025
17027
  width: "2rem";
17026
17028
  height: "2rem";
@@ -17032,7 +17034,9 @@ declare const styles$3: {
17032
17034
  };
17033
17035
  large: {
17034
17036
  width: "1.5rem";
17037
+ minWidth: "1.5rem";
17035
17038
  height: "1.5rem";
17039
+ minHeight: "1.5rem";
17036
17040
  ":before": {
17037
17041
  width: "2.75rem";
17038
17042
  height: "2.75rem";
@@ -17259,6 +17263,8 @@ declare const statusStyles: {
17259
17263
  };
17260
17264
 
17261
17265
  type StatusVariants = NonNullable<RecipeVariants<typeof statusStyles.status>>;
17266
+ type StatusDynamicProperties = Pick<StandardLonghandProperties, "minWidth">;
17267
+ type StatusSprinkle = StatusDynamicProperties;
17262
17268
 
17263
17269
  declare const bannerStyles: {
17264
17270
  banner: RuntimeFn<{
@@ -18014,7 +18020,7 @@ interface StatusTyping {
18014
18020
  */
18015
18021
  dot?: boolean;
18016
18022
  }
18017
- type StatusProps = StatusTyping & StatusVariants;
18023
+ type StatusProps = StatusTyping & StatusVariants & StatusSprinkle;
18018
18024
 
18019
18025
  interface ButtonTyping {
18020
18026
  /**
@@ -18900,6 +18906,13 @@ type StatusManifestProperties = StatusProps;
18900
18906
  type StatusProperties = WebComponentProperties<StatusManifestProperties>;
18901
18907
 
18902
18908
  declare const RaruiStatus_base: (new (...args: any[]) => {
18909
+ cssProps: Record<string, any>;
18910
+ sprinkleAttrs: Record<string, any>;
18911
+ }) & (new (...args: any[]) => {
18912
+ ariaLabel: string | null;
18913
+ ariaLabelledBy: string | null;
18914
+ ariaDescribedBy: string | null;
18915
+ }) & (new (...args: any[]) => {
18903
18916
  ariaLabel: string | null;
18904
18917
  ariaLabelledBy: string | null;
18905
18918
  ariaDescribedBy: string | null;
@@ -19370,26 +19383,44 @@ declare global {
19370
19383
  */
19371
19384
  type IconButtonManifestProperties = IconButtonProps & {
19372
19385
  /**
19373
- * Defines the native button type.
19386
+ * Defines the HTML element type to render.
19387
+ * @default button
19388
+ */
19389
+ as?: "button" | "a";
19390
+ /**
19391
+ * Defines the native button type. Only applies when as="button".
19374
19392
  * @default button
19375
19393
  */
19376
19394
  type?: "button" | "submit" | "reset";
19377
19395
  /**
19378
- * The name of the button for form submission.
19396
+ * The name of the button for form submission. Only applies when as="button".
19379
19397
  */
19380
19398
  name?: string;
19381
19399
  /**
19382
- * The value of the button for form submission.
19400
+ * The value of the button for form submission. Only applies when as="button".
19383
19401
  */
19384
19402
  value?: string;
19385
19403
  /**
19386
- * Associates the button with a form element by ID.
19404
+ * Associates the button with a form element by ID. Only applies when as="button".
19387
19405
  */
19388
19406
  form?: string;
19407
+ /**
19408
+ * The URL to navigate to. Only applies when as="a".
19409
+ */
19410
+ href?: string;
19411
+ /**
19412
+ * Specifies where to open the linked document. Only applies when as="a".
19413
+ */
19414
+ target?: "_blank" | "_self" | "_parent" | "_top";
19389
19415
  };
19390
19416
  type IconButtonProperties = WebComponentProperties<IconButtonManifestProperties>;
19391
19417
 
19392
19418
  declare const RaruiIconButton_base: (new (...args: any[]) => {
19419
+ getPassThroughAttributes(allowedPrefixes?: string[], excludedAttributes?: string[]): Record<string, string>;
19420
+ isManagedAttribute(attrName: string, additionalManagedAttrs?: string[]): boolean;
19421
+ getDataAttributes(excludedAttributes?: string[]): Record<string, string>;
19422
+ getDataAndAriaAttributes(excludedAttributes?: string[]): Record<string, string>;
19423
+ }) & (new (...args: any[]) => {
19393
19424
  ariaLabel: string | null;
19394
19425
  ariaLabelledBy: string | null;
19395
19426
  ariaDescribedBy: string | null;
@@ -19401,20 +19432,24 @@ declare class RaruiIconButton extends RaruiIconButton_base {
19401
19432
  serializable?: boolean;
19402
19433
  slotAssignment?: SlotAssignmentMode;
19403
19434
  };
19435
+ type: IconButtonProperties["type"];
19404
19436
  size: IconButtonProperties["size"];
19405
19437
  variant: IconButtonProperties["variant"];
19406
19438
  appearance: IconButtonProperties["appearance"];
19407
19439
  disabled: IconButtonProperties["disabled"];
19408
19440
  rounded: IconButtonProperties["rounded"];
19409
- type: IconButtonProperties["type"];
19410
19441
  name: IconButtonProperties["name"];
19411
19442
  value: IconButtonProperties["value"];
19412
19443
  form: IconButtonProperties["form"];
19444
+ as: IconButtonProperties["as"];
19445
+ href: IconButtonProperties["href"];
19446
+ target: IconButtonProperties["target"];
19413
19447
  ariaPressed: "true" | "false" | "mixed" | null;
19414
19448
  ariaExpanded: "true" | "false" | null;
19415
19449
  static styles: CSSResult;
19416
- private handleClick;
19450
+ private renderContent;
19417
19451
  render(): TemplateResult<1>;
19452
+ private _handleClick;
19418
19453
  }
19419
19454
 
19420
19455
  declare global {
@@ -19581,17 +19616,20 @@ declare const RaruiRadioButton_base: (new (...args: any[]) => {
19581
19616
  }) & typeof LitElement;
19582
19617
  declare class RaruiRadioButton extends RaruiRadioButton_base {
19583
19618
  id: string;
19584
- disabled: boolean;
19619
+ disabled: RadioButtonProperties["disabled"];
19585
19620
  name?: string;
19586
19621
  label?: RadioButtonProperties["label"];
19587
- size?: RadioButtonProperties["size"];
19588
- error?: RadioButtonProperties["error"];
19589
- selected?: RadioButtonProperties["selected"];
19622
+ size: RadioButtonProperties["size"];
19623
+ error: RadioButtonProperties["error"];
19624
+ selected: RadioButtonProperties["selected"];
19590
19625
  value: RadioButtonProperties["value"];
19591
19626
  form: RadioButtonProperties["form"];
19592
19627
  required: RadioButtonProperties["required"];
19593
19628
  readonly: RadioButtonProperties["readonly"];
19594
19629
  private _internals;
19630
+ private _groupSize;
19631
+ private _positionInGroup;
19632
+ private _groupObserver?;
19595
19633
  static formAssociated: boolean;
19596
19634
  constructor();
19597
19635
  connectedCallback(): void;
@@ -19602,6 +19640,8 @@ declare class RaruiRadioButton extends RaruiRadioButton_base {
19602
19640
  private _onChange;
19603
19641
  private _handleRadioGroupChange;
19604
19642
  private _notifyRadioGroupSelection;
19643
+ private _updateGroupInfo;
19644
+ private _setupGroupObserver;
19605
19645
  focus(): void;
19606
19646
  blur(): void;
19607
19647
  formResetCallback(): void;
@@ -19932,10 +19972,10 @@ declare class RaruiToggle extends RaruiToggle_base {
19932
19972
  };
19933
19973
  name: ToggleProperties["name"];
19934
19974
  label: ToggleProperties["label"];
19935
- size?: ToggleProperties["size"];
19975
+ size: ToggleProperties["size"];
19936
19976
  error: ToggleProperties["error"];
19937
- selected?: ToggleProperties["selected"];
19938
- disabled?: ToggleProperties["disabled"];
19977
+ selected: ToggleProperties["selected"];
19978
+ disabled: ToggleProperties["disabled"];
19939
19979
  value: ToggleProperties["value"];
19940
19980
  form: ToggleProperties["form"];
19941
19981
  required: ToggleProperties["required"];