@rarui/components 1.7.0 → 1.8.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/dist/index.d.ts CHANGED
@@ -16193,14 +16193,17 @@ interface DividerSprinkle {
16193
16193
  size?: string | Conditions<string>;
16194
16194
  /**
16195
16195
  * The **`type`** shorthand CSS property sets the line style for all four sides of an element's.
16196
+ * @default solid
16196
16197
  */
16197
16198
  type?: AddDollar<DividerBorderStyle> | Conditions<AddDollar<DividerBorderStyle>>;
16198
16199
  /**
16199
16200
  * The **`thickness`** shorthand CSS property sets the width of an element's.
16201
+ * @default $1
16200
16202
  */
16201
16203
  thickness?: AddDollar<keyof typeof dividerBorderWidthProperties> | Conditions<AddDollar<keyof typeof dividerBorderWidthProperties>>;
16202
16204
  /**
16203
16205
  * The **`color`** CSS property sets an element's color.
16206
+ * @default $divider
16204
16207
  */
16205
16208
  color?: AddDollar<keyof typeof borderColorProperties> | Conditions<AddDollar<keyof typeof borderColorProperties>>;
16206
16209
  }
@@ -16379,7 +16382,7 @@ declare const badgeStyles: {
16379
16382
  };
16380
16383
  /**
16381
16384
  * Specifies the size of the badge, controlling its dimensions.
16382
- * @defaiult medium
16385
+ * @default medium
16383
16386
  */
16384
16387
  size: {
16385
16388
  large: {
@@ -16407,7 +16410,7 @@ declare const badgeStyles: {
16407
16410
  };
16408
16411
  /**
16409
16412
  * Defines the visual variant of the badge, affecting its background style.
16410
- * @defaiult solid
16413
+ * @default solid
16411
16414
  */
16412
16415
  variant: {
16413
16416
  solid: {};
@@ -16437,6 +16440,7 @@ declare const buttonStyles: {
16437
16440
  /**
16438
16441
  * Defines the appearance variants for the button component.
16439
16442
  * Each appearance variant corresponds to a specific background color, border color, and text color.
16443
+ * @default brand
16440
16444
  */
16441
16445
  appearance: {
16442
16446
  brand: {
@@ -16472,7 +16476,7 @@ declare const buttonStyles: {
16472
16476
  };
16473
16477
  /**
16474
16478
  * Defines the size of the button component.
16475
- * @default "large"
16479
+ * @default large
16476
16480
  */
16477
16481
  size: {
16478
16482
  large: {
@@ -16496,6 +16500,7 @@ declare const buttonStyles: {
16496
16500
  };
16497
16501
  /**
16498
16502
  * Defines the visual variant of the badge, affecting its background style, border and text.
16503
+ * @default solid
16499
16504
  */
16500
16505
  variant: {
16501
16506
  solid: {
@@ -16732,6 +16737,50 @@ declare const textareaStyles: {
16732
16737
 
16733
16738
  type TextareaVariants = NonNullable<RecipeVariants<typeof textareaStyles.textarea>>;
16734
16739
 
16740
+ declare const styles: {
16741
+ tooltip: RuntimeFn<{
16742
+ /**
16743
+ * Specifies whether the color scheme should be inverted
16744
+ * @default false
16745
+ */
16746
+ inverted: {
16747
+ true: {
16748
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16749
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16750
+ };
16751
+ false: {
16752
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16753
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16754
+ };
16755
+ };
16756
+ /**
16757
+ * Specifies the padding for the tooltip
16758
+ * @default base
16759
+ */
16760
+ padding: {
16761
+ base: {
16762
+ padding: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16763
+ };
16764
+ none: {
16765
+ padding: number;
16766
+ };
16767
+ };
16768
+ }>;
16769
+ header: RuntimeFn<{
16770
+ padding: {
16771
+ base: {
16772
+ padding: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16773
+ };
16774
+ none: {
16775
+ padding: number;
16776
+ };
16777
+ };
16778
+ }>;
16779
+ container: string;
16780
+ };
16781
+
16782
+ type TooltipVariants = NonNullable<RecipeVariants<typeof styles.tooltip>>;
16783
+
16735
16784
  declare const cardStyles: {
16736
16785
  card: RuntimeFn<{
16737
16786
  /**
@@ -16781,6 +16830,7 @@ type AvatarProps = AvatarTypings & AvatarVariants;
16781
16830
  interface DividerProps extends DividerSprinkle {
16782
16831
  /**
16783
16832
  * The direction of the Divider.
16833
+ * @default horizontal
16784
16834
  */
16785
16835
  direction?: "vertical" | "horizontal";
16786
16836
  }
@@ -16805,6 +16855,54 @@ interface TextProps extends TextSprinkle {
16805
16855
  lineClamp?: number;
16806
16856
  }
16807
16857
 
16858
+ interface TooltipTyping {
16859
+ /**
16860
+ * Conditional for displaying the popover arrow.
16861
+ * @default true
16862
+ */
16863
+ arrow?: boolean;
16864
+ /**
16865
+ * A common feature of select dropdowns is that the dropdown matches the width of the reference regardless of its contents.
16866
+ * @default false
16867
+ */
16868
+ matchReferenceWidth?: boolean;
16869
+ /**
16870
+ * Adds hover event listeners that change the open state, like CSS :hover.
16871
+ * @default false
16872
+ */
16873
+ enabledHover?: boolean;
16874
+ /**
16875
+ * Adds click event listeners that change the open state.
16876
+ * @default true
16877
+ */
16878
+ enabledClick?: boolean;
16879
+ /**
16880
+ * Adds listeners that dismiss (close) the floating element.
16881
+ * @default true
16882
+ */
16883
+ enabledDismiss?: boolean;
16884
+ /**
16885
+ * Offest displaces the floating element from its core placement along the specified axes.
16886
+ * @default 10
16887
+ */
16888
+ offset?: number;
16889
+ /**
16890
+ * Specifies the ID of the portal element where the tooltip should be rendered.
16891
+ * This can be useful for rendering the tooltip in a different part of the DOM, such as a modal or overlay.
16892
+ */
16893
+ portalId?: string;
16894
+ /**
16895
+ * If true, the component is shown.
16896
+ */
16897
+ visible?: boolean;
16898
+ /**
16899
+ * Function to control popover opening and closing.
16900
+ * @TJS-type (visible: boolean) => void;
16901
+ */
16902
+ onVisibility?: (visible: boolean) => void;
16903
+ }
16904
+ type TooltipProps = TooltipTyping & TooltipVariants;
16905
+
16808
16906
  interface ProgressTyping {
16809
16907
  /**
16810
16908
  * The progress percentage, represented as a number between 0 and 100.
@@ -16984,6 +17082,83 @@ declare class RaruiTitle extends LitElement {
16984
17082
  render(): TemplateResult<1>;
16985
17083
  }
16986
17084
 
17085
+ declare type AlignedPlacement = `${Side}-${Alignment}`;
17086
+
17087
+ declare type Alignment = 'start' | 'end';
17088
+
17089
+ declare type Placement = Prettify<Side | AlignedPlacement>;
17090
+
17091
+ declare type Prettify<T> = {
17092
+ [K in keyof T]: T[K];
17093
+ } & {};
17094
+
17095
+ declare type Side = 'top' | 'right' | 'bottom' | 'left';
17096
+
17097
+ declare global {
17098
+ interface HTMLElementTagNameMap {
17099
+ "rarui-tooltip": RaruiTooltip;
17100
+ }
17101
+ }
17102
+ /**
17103
+ * ## Rarui Tootip
17104
+ * ---
17105
+ * Tooltips are informative, specific, and action-oriented text labels that provide contextual support
17106
+ *
17107
+ * See [a complete document](https://rarui.rarolabs.com.br/docs/components/exhibition/tooltip) for more details.
17108
+ */
17109
+ type TooltipProperties = Partial<Omit<TooltipProps, "visible" | "onVisibility" | "portalId">> & {
17110
+ /**
17111
+ * Position of the popover.
17112
+ * @default bottom
17113
+ */
17114
+ position?: Placement;
17115
+ /**
17116
+ * CSS positioning strategy used for the tooltip.
17117
+ *
17118
+ * - `"fixed"` (default) positions the tooltip relative to the viewport,
17119
+ * so it stays in the same place even when the page is scrolled.
17120
+ * - `"absolute"` positions the tooltip relative to the nearest positioned ancestor,
17121
+ * which can be useful when you want the tooltip to move with page content.
17122
+ *
17123
+ * Use `"fixed"` for tooltips that should remain visible on scroll,
17124
+ * and `"absolute"` when tooltips need to be positioned within scrollable containers.
17125
+ * @default fixed
17126
+ */
17127
+ strategy?: "fixed" | "absolute";
17128
+ };
17129
+
17130
+ declare class RaruiTooltip extends LitElement {
17131
+ arrow: TooltipProperties["arrow"];
17132
+ padding: TooltipProperties["padding"];
17133
+ offset: TooltipProperties["offset"];
17134
+ inverted: TooltipProperties["inverted"];
17135
+ enabledDismiss: TooltipProperties["enabledDismiss"];
17136
+ enabledClick: TooltipProperties["enabledClick"];
17137
+ enabledHover: TooltipProperties["enabledHover"];
17138
+ matchReferenceWidth: TooltipProperties["matchReferenceWidth"];
17139
+ position: TooltipProperties["position"];
17140
+ strategy: TooltipProperties["strategy"];
17141
+ open: boolean;
17142
+ reference: HTMLElement;
17143
+ floating: HTMLElement;
17144
+ arrowEl: HTMLElement;
17145
+ cleanupAutoUpdate?: () => void;
17146
+ static styles: CSSResult;
17147
+ private updatePositionDebounceId;
17148
+ connectedCallback(): void;
17149
+ disconnectedCallback(): void;
17150
+ updated(changed: Map<string, any>): void;
17151
+ private scheduleUpdatePosition;
17152
+ private handleClickOutside;
17153
+ private handleClick;
17154
+ private handleMouseEnter;
17155
+ private handleMouseLeave;
17156
+ private getMiddleware;
17157
+ updatePosition(): Promise<void>;
17158
+ computePosition(): Promise<void>;
17159
+ render(): TemplateResult<1>;
17160
+ }
17161
+
16987
17162
  declare global {
16988
17163
  interface HTMLElementTagNameMap {
16989
17164
  "rarui-progress-circle": RaruiProgressCircle;
@@ -17039,14 +17214,22 @@ declare global {
17039
17214
  *
17040
17215
  * See [a complete document](https://rarui.rarolabs.com.br/docs/components/input/button) for more details.
17041
17216
  */
17042
- type ButtonProperties = Partial<ButtonProps>;
17217
+ type ButtonProperties = Partial<ButtonProps> & {
17218
+ /**
17219
+ * Defines the native button type.
17220
+ * Can be 'button', 'submit', or 'reset'.
17221
+ * @default button
17222
+ */
17223
+ type?: "button" | "submit" | "reset";
17224
+ };
17043
17225
 
17044
17226
  declare class RaruiButton extends LitElement {
17045
- appearance: ButtonProperties["appearance"];
17227
+ type: ButtonProperties["type"];
17046
17228
  size: ButtonProperties["size"];
17047
17229
  variant: ButtonProperties["variant"];
17230
+ appearance: ButtonProperties["appearance"];
17231
+ disabled: ButtonProperties["disabled"];
17048
17232
  full: ButtonProperties["full"];
17049
- disabled: boolean;
17050
17233
  static styles: CSSResult;
17051
17234
  render(): TemplateResult<1>;
17052
17235
  }