@rarui/components 1.13.0 → 1.14.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,13 @@
2
2
 
3
3
  `@rarui/components` components is a component library built with [Lit](https://lit.dev/).
4
4
 
5
+ ## 2025-06-26 `1.14.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - Added new exhibition `Label` component. ([#122](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/122) by [@junior](https://git.rarolabs.com.br/junior))
10
+ - Added new input `Toggle` component. ([#122](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/122) by [@junior](https://git.rarolabs.com.br/junior))
11
+
5
12
  ## 2025-06-23 `1.13.0`
6
13
 
7
14
  #### 🎉 New features
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.12.0",
2
+ "version": "1.13.0",
3
3
  "tags": [
4
4
  {
5
5
  "name": "rarui-avatar",
@@ -1355,6 +1355,23 @@
1355
1355
  }
1356
1356
  ]
1357
1357
  },
1358
+ {
1359
+ "name": "rarui-label",
1360
+ "description": "## Rarui Label\n---\nThe label component allows us to name elements within a form.\n\nSee [a complete document](https://rarui.rarolabs.com.br/docs/components/exhibition/label) for more details.",
1361
+ "attributes": [
1362
+ {
1363
+ "name": "html-for",
1364
+ "description": "The for attribute specifies which form element a label is bound to.",
1365
+ "type": "string"
1366
+ },
1367
+ {
1368
+ "name": "hidden",
1369
+ "default": false,
1370
+ "description": "Specifies whether the label is hidden or not",
1371
+ "type": "boolean"
1372
+ }
1373
+ ]
1374
+ },
1358
1375
  {
1359
1376
  "name": "rarui-stepper",
1360
1377
  "description": "## Rarui Stepper\n---\nStepper transmit progress through steps.\n\nSee [a complete document](https://rarui.rarolabs.com.br/docs/components/exhibition/stepper) for more details.",
@@ -2832,6 +2849,59 @@
2832
2849
  }
2833
2850
  ]
2834
2851
  },
2852
+ {
2853
+ "name": "rarui-toggle",
2854
+ "description": "## Rarui Toggle\n---\nToggle switches activate or deactivate the state of a single item.\n\nSee [a complete document](https://rarui.rarolabs.com.br/docs/components/input/toggle) for more details.",
2855
+ "attributes": [
2856
+ {
2857
+ "name": "name",
2858
+ "description": "The name of the input element.",
2859
+ "type": "string"
2860
+ },
2861
+ {
2862
+ "name": "selected",
2863
+ "description": "Sets toggle state to activated or deactivated.",
2864
+ "type": "boolean"
2865
+ },
2866
+ {
2867
+ "name": "label",
2868
+ "description": "Text to be rendered inside the component",
2869
+ "type": "string"
2870
+ },
2871
+ {
2872
+ "name": "size",
2873
+ "default": "large",
2874
+ "description": "Specifies the size of the toggle, controlling its dimensions.\n\n- large\n- small",
2875
+ "type": "string",
2876
+ "values": [
2877
+ {
2878
+ "name": "large",
2879
+ "description": "(default)"
2880
+ },
2881
+ {
2882
+ "name": "small"
2883
+ }
2884
+ ]
2885
+ },
2886
+ {
2887
+ "name": "error",
2888
+ "default": false,
2889
+ "description": "Specifies whether the radiobutton is in error state",
2890
+ "type": "boolean"
2891
+ },
2892
+ {
2893
+ "name": "disabled",
2894
+ "default": false,
2895
+ "description": "Defines if Toggle is disabled.\nWhen `true`, the component cannot be interacted.",
2896
+ "type": "boolean"
2897
+ },
2898
+ {
2899
+ "name": "id",
2900
+ "description": "Single ID associated with Toggle Input.If not provided,\nThe name will be used as Fallback to `id`.",
2901
+ "type": "string"
2902
+ }
2903
+ ]
2904
+ },
2835
2905
  {
2836
2906
  "name": "rarui-box",
2837
2907
  "description": "## Rarui Box\n---\nA low-level `utility` component that provides stylized system accessories to allow for custom styling with theme reconfection.\n\nSee [a complete document](https://rarui.rarolabs.com.br/docs/components/layout/box) for more details.",
package/dist/index.d.ts CHANGED
@@ -16793,6 +16793,29 @@ declare const iconButtonStyles: {
16793
16793
 
16794
16794
  type IconButtonVariants = NonNullable<RecipeVariants<typeof iconButtonStyles.iconButton>>;
16795
16795
 
16796
+ declare const styles$5: {
16797
+ label: RuntimeFn<{
16798
+ /**
16799
+ * Specifies whether the label is hidden or not
16800
+ * @default false
16801
+ */
16802
+ hidden: {
16803
+ true: {
16804
+ border: "0";
16805
+ clip: "rect(0 0 0 0)";
16806
+ height: "1px";
16807
+ margin: "-1px";
16808
+ overflow: "hidden";
16809
+ padding: "0";
16810
+ position: "absolute";
16811
+ width: "1px";
16812
+ };
16813
+ };
16814
+ }>;
16815
+ };
16816
+
16817
+ type LabelVariants = RecipeVariants<typeof styles$5.label>;
16818
+
16796
16819
  declare const styles$4: {
16797
16820
  link: RuntimeFn<{
16798
16821
  /**
@@ -17111,6 +17134,117 @@ declare const textareaStyles: {
17111
17134
 
17112
17135
  type TextareaVariants = NonNullable<RecipeVariants<typeof textareaStyles.textarea>>;
17113
17136
 
17137
+ declare const styles$1: {
17138
+ toggle: RuntimeFn<{
17139
+ /**
17140
+ * Specifies the size of the toggle, controlling its dimensions.
17141
+ * @default large
17142
+ */
17143
+ size: {
17144
+ large: {
17145
+ ":before": {
17146
+ width: "1.5rem";
17147
+ height: "1.5rem";
17148
+ };
17149
+ ":after": {
17150
+ top: "-.3125rem";
17151
+ left: "-.3125rem";
17152
+ height: "2.75rem";
17153
+ width: "2.75rem";
17154
+ };
17155
+ };
17156
+ small: {
17157
+ ":before": {
17158
+ width: "1rem";
17159
+ height: "1rem";
17160
+ };
17161
+ ":after": {
17162
+ top: "-.4375rem";
17163
+ left: "-.5rem";
17164
+ height: "2.5rem";
17165
+ width: "2.5rem";
17166
+ };
17167
+ };
17168
+ };
17169
+ /**
17170
+ * Specifies whether the radiobutton is in error state
17171
+ * @default false
17172
+ */
17173
+ error: {
17174
+ true: {
17175
+ ":before": {
17176
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17177
+ };
17178
+ selectors: {
17179
+ "&:has(input:checked):before": {
17180
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17181
+ };
17182
+ };
17183
+ };
17184
+ };
17185
+ }>;
17186
+ input: string;
17187
+ slider: RuntimeFn<{
17188
+ size: {
17189
+ large: {
17190
+ width: "3.25rem";
17191
+ height: "2rem";
17192
+ ":after": {
17193
+ content: "";
17194
+ };
17195
+ };
17196
+ small: {
17197
+ width: "2.75rem";
17198
+ height: "1.5rem";
17199
+ };
17200
+ };
17201
+ error: {
17202
+ true: {
17203
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17204
+ borderColor: `var(--${string})` | `var(--${string}, ${string})`;
17205
+ "&[aria-disabled='true']": {
17206
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17207
+ borderColor: `var(--${string})` | `var(--${string}, ${string})`;
17208
+ };
17209
+ };
17210
+ };
17211
+ }>;
17212
+ unchecked: RuntimeFn<{
17213
+ size: {
17214
+ large: {
17215
+ left: "1rem";
17216
+ height: "1.5rem";
17217
+ width: "1.5rem";
17218
+ borderRadius: "0.75rem";
17219
+ };
17220
+ small: {
17221
+ left: "0.75rem";
17222
+ width: "1rem";
17223
+ height: "1rem";
17224
+ borderRadius: "0.5rem";
17225
+ };
17226
+ };
17227
+ }>;
17228
+ checked: RuntimeFn<{
17229
+ size: {
17230
+ large: {
17231
+ left: "2.25rem";
17232
+ height: "1.5rem";
17233
+ width: "1.5rem";
17234
+ borderRadius: "0.75rem";
17235
+ };
17236
+ small: {
17237
+ left: "2rem";
17238
+ width: "1rem";
17239
+ height: "1rem";
17240
+ borderRadius: "0.5rem";
17241
+ };
17242
+ };
17243
+ }>;
17244
+ };
17245
+
17246
+ type ToggleVariants = RecipeVariants<typeof styles$1.toggle>;
17247
+
17114
17248
  declare const styles: {
17115
17249
  tooltip: RuntimeFn<{
17116
17250
  /**
@@ -17321,6 +17455,14 @@ interface TextProps extends TextSprinkle {
17321
17455
  lineClamp?: number;
17322
17456
  }
17323
17457
 
17458
+ interface LabelTyping {
17459
+ /**
17460
+ * The for attribute specifies which form element a label is bound to.
17461
+ */
17462
+ htmlFor?: string;
17463
+ }
17464
+ type LabelProps = LabelTyping & LabelVariants;
17465
+
17324
17466
  interface TooltipTyping {
17325
17467
  /**
17326
17468
  * Conditional for displaying the popover arrow.
@@ -17460,6 +17602,22 @@ interface TextareaProps extends TextareaVariants {
17460
17602
  lines?: number;
17461
17603
  }
17462
17604
 
17605
+ interface ToggleTyping {
17606
+ /**
17607
+ * The name of the input element.
17608
+ */
17609
+ name: string;
17610
+ /**
17611
+ * Sets toggle state to activated or deactivated.
17612
+ */
17613
+ selected?: boolean;
17614
+ /**
17615
+ * Text to be rendered inside the component
17616
+ */
17617
+ label?: string;
17618
+ }
17619
+ type ToggleProps = ToggleTyping & ToggleVariants;
17620
+
17463
17621
  interface BannerTyping {
17464
17622
  /**
17465
17623
  * A function to be called when the user closes the banner. This function is typically used to handle the closing action.
@@ -17595,6 +17753,27 @@ declare class RaruiIcon extends LitElement {
17595
17753
  render(): TemplateResult<1> | null;
17596
17754
  }
17597
17755
 
17756
+ declare global {
17757
+ interface HTMLElementTagNameMap {
17758
+ "rarui-label": RaruiLabel;
17759
+ }
17760
+ }
17761
+ /**
17762
+ * ## Rarui Label
17763
+ * ---
17764
+ * The label component allows us to name elements within a form.
17765
+ *
17766
+ * See [a complete document](https://rarui.rarolabs.com.br/docs/components/exhibition/label) for more details.
17767
+ */
17768
+ type LabelProperties = Partial<LabelProps>;
17769
+
17770
+ declare class RaruiLabel extends LitElement {
17771
+ htmlFor: LabelProperties["htmlFor"];
17772
+ hidden: boolean;
17773
+ static styles: CSSResult;
17774
+ render(): TemplateResult<1>;
17775
+ }
17776
+
17598
17777
  declare global {
17599
17778
  interface HTMLElementTagNameMap {
17600
17779
  "rarui-stepper-step": RaruiStepperStep;
@@ -18019,6 +18198,44 @@ declare class RaruiTextarea extends LitElement {
18019
18198
  private _onChange;
18020
18199
  }
18021
18200
 
18201
+ declare global {
18202
+ interface HTMLElementTagNameMap {
18203
+ "rarui-toggle": RaruiToggle;
18204
+ }
18205
+ }
18206
+ /**
18207
+ * ## Rarui Toggle
18208
+ * ---
18209
+ * Toggle switches activate or deactivate the state of a single item.
18210
+ *
18211
+ * See [a complete document](https://rarui.rarolabs.com.br/docs/components/input/toggle) for more details.
18212
+ */
18213
+ type ToggleProperties = Partial<ToggleProps> & {
18214
+ /**
18215
+ * Defines if Toggle is disabled.
18216
+ * When `true`, the component cannot be interacted.
18217
+ * @default false
18218
+ */
18219
+ disabled?: boolean;
18220
+ /**
18221
+ * Single ID associated with Toggle Input.If not provided,
18222
+ * The name will be used as Fallback to `id`.
18223
+ */
18224
+ id?: string;
18225
+ };
18226
+
18227
+ declare class RaruiToggle extends LitElement {
18228
+ name: ToggleProperties["name"];
18229
+ label: ToggleProperties["label"];
18230
+ size?: ToggleProperties["size"];
18231
+ error: ToggleProperties["error"];
18232
+ selected?: ToggleProperties["selected"];
18233
+ disabled?: ToggleProperties["disabled"];
18234
+ static styles: CSSResult;
18235
+ private handleChange;
18236
+ render(): TemplateResult<1>;
18237
+ }
18238
+
18022
18239
  declare global {
18023
18240
  interface HTMLElementTagNameMap {
18024
18241
  "rarui-link": RaruiLink;