@rarui/components 1.24.0 → 1.24.1

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,25 @@
2
2
 
3
3
  `@rarui/components` components is a component library built with [Lit](https://lit.dev/).
4
4
 
5
+ ## 2025-09-18 `1.25.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - Enhanced form integration across all input components with native HTML form association using ElementInternals API for seamless form submission, validation, and reset capabilities. ([#135](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/135) by [@junior](https://git.rarolabs.com.br/junior))
10
+ - Standardized custom event naming convention with `rarui-*` pattern across all components (Button, Checkbox, Input, Select, Textarea, Chip) for consistent event handling and better namespace organization. ([#135](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/135) by [@junior](https://git.rarolabs.com.br/junior))
11
+ - Implemented comprehensive label integration system with automatic focus management through `rarui-label-click` communication pattern for seamless label-to-control association. ([#135](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/135) by [@junior](https://git.rarolabs.com.br/junior))
12
+ - Enhanced Button component with intelligent form interaction (automatic submit/reset based on type) and standardized custom event `rarui-button-click` for consistent interaction handling. ([#135](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/135) by [@junior](https://git.rarolabs.com.br/junior))
13
+ - Enhanced Label component with proper HTML semantics (standardized `for` attribute replacing `htmlFor`) and automatic form control association through custom event system. ([#135](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/135) by [@junior](https://git.rarolabs.com.br/junior))
14
+
15
+ #### 🛠 Breaking changes
16
+
17
+ - Changed Label component `htmlFor` property to `for` for standard HTML label attribute compliance. ([#135](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/135) by [@junior](https://git.rarolabs.com.br/junior))
18
+ - Updated custom event names across all components: `input-change` → `rarui-input-change`, `select-change` → `rarui-select-change`, `textarea-change` → `rarui-textarea-change`, `change` → `rarui-checkbox-change`, `chip-click` → `rarui-chip-click`, `chip-close` → `rarui-chip-close`. ([#135](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/135) by [@junior](https://git.rarolabs.com.br/junior))
19
+
20
+ #### 💡 Others
21
+
22
+ - Enhanced Chip component type definitions with comprehensive event documentation for better developer experience. ([#135](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/135) by [@junior](https://git.rarolabs.com.br/junior))
23
+
5
24
  ## 2025-09-05 `1.24.0`
6
25
 
7
26
  #### 🎉 New features
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.23.0",
2
+ "version": "1.24.0",
3
3
  "tags": [
4
4
  {
5
5
  "name": "rarui-avatar",
package/dist/index.d.ts CHANGED
@@ -16928,29 +16928,6 @@ declare const styles$6: {
16928
16928
 
16929
16929
  type InputVariants = NonNullable<RecipeVariants<typeof styles$6.container> & RecipeVariants<typeof styles$6.input>>;
16930
16930
 
16931
- declare const styles$5: {
16932
- label: RuntimeFn<{
16933
- /**
16934
- * Specifies whether the label is hidden or not
16935
- * @default false
16936
- */
16937
- hidden: {
16938
- true: {
16939
- border: "0";
16940
- clip: "rect(0 0 0 0)";
16941
- height: "1px";
16942
- margin: "-1px";
16943
- overflow: "hidden";
16944
- padding: "0";
16945
- position: "absolute";
16946
- width: "1px";
16947
- };
16948
- };
16949
- }>;
16950
- };
16951
-
16952
- type LabelVariants = RecipeVariants<typeof styles$5.label>;
16953
-
16954
16931
  declare const styles$4: {
16955
16932
  link: RuntimeFn<{
16956
16933
  /**
@@ -17894,14 +17871,6 @@ interface TextProps extends TextSprinkle {
17894
17871
  lineClamp?: number;
17895
17872
  }
17896
17873
 
17897
- interface LabelTyping {
17898
- /**
17899
- * The for attribute specifies which form element a label is bound to.
17900
- */
17901
- htmlFor?: string;
17902
- }
17903
- type LabelProps = LabelTyping & LabelVariants;
17904
-
17905
17874
  interface TooltipTyping {
17906
17875
  /**
17907
17876
  * Conditional for displaying the popover arrow.
@@ -18453,14 +18422,20 @@ declare global {
18453
18422
  *
18454
18423
  See [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/exhibition/label) for more details.
18455
18424
  */
18456
- type LabelManifestProperties = LabelProps;
18425
+ type LabelManifestProperties = {
18426
+ /**
18427
+ * The for attribute specifies which form element a label is bound to.
18428
+ */
18429
+ for?: string;
18430
+ };
18457
18431
  type LabelProperties = WebComponentProperties<LabelManifestProperties>;
18458
18432
 
18459
18433
  declare class RaruiLabel extends LitElement {
18460
- htmlFor: LabelProperties["html-for"];
18434
+ for: LabelProperties["for"];
18461
18435
  hidden: boolean;
18462
18436
  static styles: CSSResult;
18463
18437
  render(): TemplateResult<1>;
18438
+ private _handleClick;
18464
18439
  }
18465
18440
 
18466
18441
  declare global {
@@ -18770,6 +18745,7 @@ declare class RaruiButton extends LitElement {
18770
18745
  form: ButtonProperties["form"];
18771
18746
  static styles: CSSResult;
18772
18747
  render(): TemplateResult<1>;
18748
+ private _handleClick;
18773
18749
  }
18774
18750
 
18775
18751
  declare global {
@@ -18839,13 +18815,22 @@ declare class RaruiCheckbox extends LitElement {
18839
18815
  value?: CheckboxProperties["value"];
18840
18816
  form?: CheckboxProperties["form"];
18841
18817
  private _hasCheckedAttribute;
18818
+ private _internals;
18842
18819
  private input;
18820
+ static formAssociated: boolean;
18821
+ constructor();
18843
18822
  static styles: CSSResult;
18844
18823
  connectedCallback(): void;
18824
+ disconnectedCallback(): void;
18845
18825
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
18846
18826
  updated(changedProperties: Map<string, any>): void;
18847
18827
  render(): TemplateResult<1>;
18848
18828
  private _onChange;
18829
+ private _updateFormValue;
18830
+ focus(): void;
18831
+ blur(): void;
18832
+ private _handleLabelClick;
18833
+ formResetCallback(): void;
18849
18834
  private getAriaCheckedValue;
18850
18835
  }
18851
18836
 
@@ -18884,6 +18869,19 @@ type ChipManifestProperties = ChipProps & {
18884
18869
  * Associates the chip with a form element by ID.
18885
18870
  */
18886
18871
  form?: string;
18872
+ /**
18873
+ * @events
18874
+ * rarui-chip-click: Fired when the chip is clicked (only when not closeable)
18875
+ * rarui-chip-close: Fired when the close button is clicked (only when closeable is true)
18876
+ */
18877
+ _events?: {
18878
+ "rarui-chip-click": {
18879
+ detail: MouseEvent;
18880
+ };
18881
+ "rarui-chip-close": {
18882
+ detail: MouseEvent | KeyboardEvent;
18883
+ };
18884
+ };
18887
18885
  };
18888
18886
  type ChipProperties = WebComponentProperties<ChipManifestProperties>;
18889
18887
 
@@ -19122,7 +19120,11 @@ type InputManifestProperties = InputProps & {
19122
19120
  /**
19123
19121
  * The name of the input for form submission.
19124
19122
  */
19125
- name?: string;
19123
+ name: string;
19124
+ /**
19125
+ * The id of the input for form submission.
19126
+ */
19127
+ id: string;
19126
19128
  /**
19127
19129
  * Associates the input with a form element by ID.
19128
19130
  */
@@ -19168,10 +19170,19 @@ declare class RaruiInput extends LitElement {
19168
19170
  minlength: InputProperties["minlength"];
19169
19171
  maxlength: InputProperties["maxlength"];
19170
19172
  pattern: InputProperties["pattern"];
19173
+ private _internals;
19174
+ static formAssociated: boolean;
19175
+ constructor();
19176
+ connectedCallback(): void;
19177
+ disconnectedCallback(): void;
19171
19178
  static styles: CSSResult;
19172
19179
  render(): TemplateResult<1>;
19173
19180
  private _focusInput;
19174
19181
  private _onInput;
19182
+ focus(): void;
19183
+ blur(): void;
19184
+ private _handleLabelClick;
19185
+ formResetCallback(): void;
19175
19186
  }
19176
19187
 
19177
19188
  declare global {
@@ -19294,7 +19305,10 @@ type TextareaProperties = WebComponentProperties<TextareaManifestProperties>;
19294
19305
 
19295
19306
  declare class RaruiTextarea extends LitElement {
19296
19307
  disabled: boolean;
19297
- value?: string;
19308
+ value: string;
19309
+ private _internals;
19310
+ static formAssociated: boolean;
19311
+ constructor();
19298
19312
  appearance?: TextareaProperties["appearance"];
19299
19313
  lines?: TextareaProperties["lines"];
19300
19314
  name: TextareaProperties["name"];
@@ -19306,6 +19320,13 @@ declare class RaruiTextarea extends LitElement {
19306
19320
  maxlength: TextareaProperties["maxlength"];
19307
19321
  static styles: CSSResult;
19308
19322
  render(): TemplateResult<1>;
19323
+ connectedCallback(): void;
19324
+ disconnectedCallback(): void;
19325
+ private _onInput;
19326
+ focus(): void;
19327
+ blur(): void;
19328
+ private _handleLabelClick;
19329
+ formResetCallback(): void;
19309
19330
  }
19310
19331
 
19311
19332
  declare global {