@rarui/components 1.6.0 → 1.8.0-rc.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/dist/index.d.ts CHANGED
@@ -1,88 +1,3 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
-
7
- /** TemplateResult types */
8
- declare const HTML_RESULT = 1;
9
- declare const SVG_RESULT = 2;
10
- declare const MATHML_RESULT = 3;
11
- type ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;
12
- /**
13
- * The return type of the template tag functions, {@linkcode html} and
14
- * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.
15
- *
16
- * A `TemplateResult` object holds all the information about a template
17
- * expression required to render it: the template strings, expression values,
18
- * and type of template (html or svg).
19
- *
20
- * `TemplateResult` objects do not create any DOM on their own. To create or
21
- * update DOM you need to render the `TemplateResult`. See
22
- * [Rendering](https://lit.dev/docs/components/rendering) for more information.
23
- *
24
- */
25
- type UncompiledTemplateResult<T extends ResultType = ResultType> = {
26
- ['_$litType$']: T;
27
- strings: TemplateStringsArray;
28
- values: unknown[];
29
- };
30
- /**
31
- * The return type of the template tag functions, {@linkcode html} and
32
- * {@linkcode svg}.
33
- *
34
- * A `TemplateResult` object holds all the information about a template
35
- * expression required to render it: the template strings, expression values,
36
- * and type of template (html or svg).
37
- *
38
- * `TemplateResult` objects do not create any DOM on their own. To create or
39
- * update DOM you need to render the `TemplateResult`. See
40
- * [Rendering](https://lit.dev/docs/components/rendering) for more information.
41
- *
42
- * In Lit 4, this type will be an alias of
43
- * MaybeCompiledTemplateResult, so that code will get type errors if it assumes
44
- * that Lit templates are not compiled. When deliberately working with only
45
- * one, use either {@linkcode CompiledTemplateResult} or
46
- * {@linkcode UncompiledTemplateResult} explicitly.
47
- */
48
- type TemplateResult<T extends ResultType = ResultType> = UncompiledTemplateResult<T>;
49
- /**
50
- * Object specifying options for controlling lit-html rendering. Note that
51
- * while `render` may be called multiple times on the same `container` (and
52
- * `renderBefore` reference node) to efficiently update the rendered content,
53
- * only the options passed in during the first render are respected during
54
- * the lifetime of renders to that unique `container` + `renderBefore`
55
- * combination.
56
- */
57
- interface RenderOptions {
58
- /**
59
- * An object to use as the `this` value for event listeners. It's often
60
- * useful to set this to the host component rendering a template.
61
- */
62
- host?: object;
63
- /**
64
- * A DOM node before which to render content in the container.
65
- */
66
- renderBefore?: ChildNode | null;
67
- /**
68
- * Node used for cloning the template (`importNode` will be called on this
69
- * node). This controls the `ownerDocument` of the rendered DOM, along with
70
- * any inherited context. Defaults to the global `document`.
71
- */
72
- creationScope?: {
73
- importNode(node: Node, deep?: boolean): Node;
74
- };
75
- /**
76
- * The initial connected state for the top-level part being rendered. If no
77
- * `isConnected` option is set, `AsyncDirective`s will be connected by
78
- * default. Set to `false` if the initial render occurs in a disconnected tree
79
- * and `AsyncDirective`s should see `isConnected === false` for their initial
80
- * render. The `part.setConnected()` method must be used subsequent to initial
81
- * render to change the connected state of the part.
82
- */
83
- isConnected?: boolean;
84
- }
85
-
86
1
  /**
87
2
  * A CSSResult or native CSSStyleSheet.
88
3
  *
@@ -914,6 +829,49 @@ declare abstract class ReactiveElement extends HTMLElement implements ReactiveCo
914
829
  protected firstUpdated(_changedProperties: PropertyValues): void;
915
830
  }
916
831
 
832
+ /**
833
+ * @license
834
+ * Copyright 2017 Google LLC
835
+ * SPDX-License-Identifier: BSD-3-Clause
836
+ */
837
+
838
+ /**
839
+ * Object specifying options for controlling lit-html rendering. Note that
840
+ * while `render` may be called multiple times on the same `container` (and
841
+ * `renderBefore` reference node) to efficiently update the rendered content,
842
+ * only the options passed in during the first render are respected during
843
+ * the lifetime of renders to that unique `container` + `renderBefore`
844
+ * combination.
845
+ */
846
+ interface RenderOptions {
847
+ /**
848
+ * An object to use as the `this` value for event listeners. It's often
849
+ * useful to set this to the host component rendering a template.
850
+ */
851
+ host?: object;
852
+ /**
853
+ * A DOM node before which to render content in the container.
854
+ */
855
+ renderBefore?: ChildNode | null;
856
+ /**
857
+ * Node used for cloning the template (`importNode` will be called on this
858
+ * node). This controls the `ownerDocument` of the rendered DOM, along with
859
+ * any inherited context. Defaults to the global `document`.
860
+ */
861
+ creationScope?: {
862
+ importNode(node: Node, deep?: boolean): Node;
863
+ };
864
+ /**
865
+ * The initial connected state for the top-level part being rendered. If no
866
+ * `isConnected` option is set, `AsyncDirective`s will be connected by
867
+ * default. Set to `false` if the initial render occurs in a disconnected tree
868
+ * and `AsyncDirective`s should see `isConnected === false` for their initial
869
+ * render. The `part.setConnected()` method must be used subsequent to initial
870
+ * render to change the connected state of the part.
871
+ */
872
+ isConnected?: boolean;
873
+ }
874
+
917
875
  /**
918
876
  * @license
919
877
  * Copyright 2017 Google LLC
@@ -16588,6 +16546,47 @@ declare const checkboxStyles: {
16588
16546
 
16589
16547
  type CheckboxVariants = NonNullable<RecipeVariants<typeof checkboxStyles.checkbox>>;
16590
16548
 
16549
+ declare const progressStyles: {
16550
+ progress: string;
16551
+ bar: string;
16552
+ circle: RuntimeFn<{
16553
+ /**
16554
+ * Specifies the size of the progress indicator.
16555
+ * This prop accepts one of the following values: "large" or "small".
16556
+ * @default large
16557
+ */
16558
+ size: {
16559
+ large: {
16560
+ width: "8.75rem";
16561
+ height: "8.75rem";
16562
+ };
16563
+ small: {
16564
+ width: "5rem";
16565
+ height: "5rem";
16566
+ };
16567
+ };
16568
+ }>;
16569
+ circleBase: string;
16570
+ circleProgress: string;
16571
+ circleText: string;
16572
+ };
16573
+ declare const progressColorProperties: {
16574
+ info: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16575
+ success: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16576
+ brand: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16577
+ };
16578
+
16579
+ type ProgressVariants = NonNullable<RecipeVariants<typeof progressStyles.circle>>;
16580
+ interface ProgressSprinkle {
16581
+ /**
16582
+ * Specifies the color of the progress.
16583
+ * This prop accepts one of the following values: "$info", "$success" or "$brand"
16584
+ * @default $info
16585
+ * @examples ["$brand", { xs: "$brand", md: "$info" }]
16586
+ */
16587
+ color?: AddDollar<keyof typeof progressColorProperties>;
16588
+ }
16589
+
16591
16590
  declare const styles$3: {
16592
16591
  radioButton: RuntimeFn<{
16593
16592
  /**
@@ -16691,6 +16690,48 @@ declare const textareaStyles: {
16691
16690
 
16692
16691
  type TextareaVariants = NonNullable<RecipeVariants<typeof textareaStyles.textarea>>;
16693
16692
 
16693
+ declare const styles: {
16694
+ tooltip: RuntimeFn<{
16695
+ /**
16696
+ * Specifies whether the color scheme should be inverted
16697
+ */
16698
+ inverted: {
16699
+ true: {
16700
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16701
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16702
+ };
16703
+ false: {
16704
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16705
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16706
+ };
16707
+ };
16708
+ /**
16709
+ * Specifies the padding for the tooltip
16710
+ */
16711
+ padding: {
16712
+ base: {
16713
+ padding: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16714
+ };
16715
+ none: {
16716
+ padding: number;
16717
+ };
16718
+ };
16719
+ }>;
16720
+ header: RuntimeFn<{
16721
+ padding: {
16722
+ base: {
16723
+ padding: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
16724
+ };
16725
+ none: {
16726
+ padding: number;
16727
+ };
16728
+ };
16729
+ }>;
16730
+ container: string;
16731
+ };
16732
+
16733
+ type TooltipVariants = NonNullable<RecipeVariants<typeof styles.tooltip>>;
16734
+
16694
16735
  declare const cardStyles: {
16695
16736
  card: RuntimeFn<{
16696
16737
  /**
@@ -16764,6 +16805,65 @@ interface TextProps extends TextSprinkle {
16764
16805
  lineClamp?: number;
16765
16806
  }
16766
16807
 
16808
+ interface TooltipTyping {
16809
+ /**
16810
+ * Conditional for displaying the popover arrow.
16811
+ * @default true
16812
+ */
16813
+ arrow?: boolean;
16814
+ /**
16815
+ * A common feature of select dropdowns is that the dropdown matches the width of the reference regardless of its contents.
16816
+ * @default false
16817
+ */
16818
+ matchReferenceWidth?: boolean;
16819
+ /**
16820
+ * Adds hover event listeners that change the open state, like CSS :hover.
16821
+ * @default false
16822
+ */
16823
+ enabledHover?: boolean;
16824
+ /**
16825
+ * Adds click event listeners that change the open state.
16826
+ * @default true
16827
+ */
16828
+ enabledClick?: boolean;
16829
+ /**
16830
+ * Adds listeners that dismiss (close) the floating element.
16831
+ * @default true
16832
+ */
16833
+ enabledDismiss?: boolean;
16834
+ /**
16835
+ * Offest displaces the floating element from its core placement along the specified axes.
16836
+ * @default 10
16837
+ */
16838
+ offset?: number;
16839
+ /**
16840
+ * Specifies the ID of the portal element where the tooltip should be rendered.
16841
+ * This can be useful for rendering the tooltip in a different part of the DOM, such as a modal or overlay.
16842
+ */
16843
+ portalId?: string;
16844
+ /**
16845
+ * If true, the component is shown.
16846
+ */
16847
+ visible?: boolean;
16848
+ /**
16849
+ * Function to control popover opening and closing.
16850
+ * @TJS-type (visible: boolean) => void;
16851
+ */
16852
+ onVisibility?: (visible: boolean) => void;
16853
+ }
16854
+ type TooltipProps = TooltipTyping & TooltipVariants;
16855
+
16856
+ interface ProgressTyping {
16857
+ /**
16858
+ * The progress percentage, represented as a number between 0 and 100.
16859
+ * This indicates the completion level of the process.
16860
+ */
16861
+ percentage: number;
16862
+ }
16863
+ type ProgressProps = ProgressTyping & ProgressSprinkle;
16864
+
16865
+ type ProgressCircleProps = ProgressProps & ProgressVariants;
16866
+
16767
16867
  interface ButtonTyping {
16768
16868
  /**
16769
16869
  * Disables the button, disallowing user interaction.
@@ -16932,6 +17032,126 @@ declare class RaruiTitle extends LitElement {
16932
17032
  render(): TemplateResult<1>;
16933
17033
  }
16934
17034
 
17035
+ declare type AlignedPlacement = `${Side}-${Alignment}`;
17036
+
17037
+ declare type Alignment = 'start' | 'end';
17038
+
17039
+ declare type Placement = Prettify<Side | AlignedPlacement>;
17040
+
17041
+ declare type Prettify<T> = {
17042
+ [K in keyof T]: T[K];
17043
+ } & {};
17044
+
17045
+ declare type Side = 'top' | 'right' | 'bottom' | 'left';
17046
+
17047
+ declare global {
17048
+ interface HTMLElementTagNameMap {
17049
+ "rarui-tooltip": RaruiTooltip;
17050
+ }
17051
+ }
17052
+ /**
17053
+ * ## Rarui Tooltip
17054
+ * ---
17055
+ * A Divider is a thin line used to separate or group content in lists and layouts.
17056
+ *
17057
+ * See [a complete document](https://rarui.rarolabs.com.br/docs/components/exhibition/divider) for more details.
17058
+ */
17059
+ type TooltipProperties = Partial<TooltipProps> & {
17060
+ /**
17061
+ * Position of the popover.
17062
+ * @default bottom
17063
+ */
17064
+ position?: Placement;
17065
+ /**
17066
+ * CSS positioning strategy used for the tooltip.
17067
+ *
17068
+ * - `"fixed"` (default) positions the tooltip relative to the viewport,
17069
+ * so it stays in the same place even when the page is scrolled.
17070
+ * - `"absolute"` positions the tooltip relative to the nearest positioned ancestor,
17071
+ * which can be useful when you want the tooltip to move with page content.
17072
+ *
17073
+ * Use `"fixed"` for tooltips that should remain visible on scroll,
17074
+ * and `"absolute"` when tooltips need to be positioned within scrollable containers.
17075
+ * @default fixed
17076
+ */
17077
+ strategy?: "fixed" | "absolute";
17078
+ };
17079
+
17080
+ declare class RaruiTooltip extends LitElement {
17081
+ padding: TooltipProperties["padding"];
17082
+ offset: TooltipProperties["offset"];
17083
+ inverted: TooltipProperties["inverted"];
17084
+ arrow: TooltipProperties["arrow"];
17085
+ enabledDismiss: TooltipProperties["enabledDismiss"];
17086
+ enabledClick: TooltipProperties["enabledClick"];
17087
+ enabledHover: TooltipProperties["enabledHover"];
17088
+ matchReferenceWidth: TooltipProperties["matchReferenceWidth"];
17089
+ position: TooltipProperties["position"];
17090
+ strategy: TooltipProperties["strategy"];
17091
+ open: boolean;
17092
+ reference: HTMLElement;
17093
+ floating: HTMLElement;
17094
+ arrowEl: HTMLElement;
17095
+ cleanupAutoUpdate?: () => void;
17096
+ static styles: CSSResult;
17097
+ private updatePositionDebounceId;
17098
+ connectedCallback(): void;
17099
+ disconnectedCallback(): void;
17100
+ updated(changed: Map<string, any>): void;
17101
+ private scheduleUpdatePosition;
17102
+ private handleClickOutside;
17103
+ private handleClick;
17104
+ private handleMouseEnter;
17105
+ private handleMouseLeave;
17106
+ private getMiddleware;
17107
+ updatePosition(): Promise<void>;
17108
+ computePosition(): Promise<void>;
17109
+ render(): TemplateResult<1>;
17110
+ }
17111
+
17112
+ declare global {
17113
+ interface HTMLElementTagNameMap {
17114
+ "rarui-progress-circle": RaruiProgressCircle;
17115
+ }
17116
+ }
17117
+ /**
17118
+ * ## Rarui Card Body
17119
+ * ---
17120
+ * The Card component contains textual content, images, and actions about a topic.
17121
+ *
17122
+ * See [a complete document](https://rarui.rarolabs.com.br/docs/components/surface/card) for more details.
17123
+ */
17124
+ type ProgressCircleProperties = Partial<ProgressCircleProps>;
17125
+
17126
+ declare class RaruiProgressCircle extends LitElement {
17127
+ size?: ProgressCircleProperties["size"];
17128
+ percentage?: ProgressCircleProperties["percentage"];
17129
+ color?: ProgressCircleProperties["color"];
17130
+ static styles: CSSResult;
17131
+ render(): TemplateResult<1>;
17132
+ }
17133
+
17134
+ declare global {
17135
+ interface HTMLElementTagNameMap {
17136
+ "rarui-progress": RaruiProgress;
17137
+ }
17138
+ }
17139
+ /**
17140
+ * ## Rarui Progress
17141
+ * ---
17142
+ * The Badge components are only used to transmit dynamic information, such as a connection or status.
17143
+ *
17144
+ * See [a complete document](https://rarui.rarolabs.com.br/docs/components/exhibition/badge) for more details.
17145
+ */
17146
+ type ProgressProperties = Partial<ProgressProps>;
17147
+
17148
+ declare class RaruiProgress extends LitElement {
17149
+ percentage?: ProgressProperties["percentage"];
17150
+ color?: ProgressProperties["color"];
17151
+ static styles: CSSResult;
17152
+ render(): TemplateResult<1>;
17153
+ }
17154
+
16935
17155
  declare global {
16936
17156
  interface HTMLElementTagNameMap {
16937
17157
  "rarui-button": RaruiButton;
@@ -16944,14 +17164,22 @@ declare global {
16944
17164
  *
16945
17165
  * See [a complete document](https://rarui.rarolabs.com.br/docs/components/input/button) for more details.
16946
17166
  */
16947
- type ButtonProperties = Partial<ButtonProps>;
17167
+ type ButtonProperties = Partial<ButtonProps> & {
17168
+ /**
17169
+ * Defines the native button type.
17170
+ * Can be 'button', 'submit', or 'reset'.
17171
+ * @default 'button'
17172
+ */
17173
+ type?: "button" | "submit" | "reset";
17174
+ };
16948
17175
 
16949
17176
  declare class RaruiButton extends LitElement {
16950
- appearance: ButtonProperties["appearance"];
17177
+ full: ButtonProperties["full"];
16951
17178
  size: ButtonProperties["size"];
17179
+ type: ButtonProperties["type"];
16952
17180
  variant: ButtonProperties["variant"];
16953
- full: ButtonProperties["full"];
16954
- disabled: boolean;
17181
+ disabled: ButtonProperties["disabled"];
17182
+ appearance: ButtonProperties["appearance"];
16955
17183
  static styles: CSSResult;
16956
17184
  render(): TemplateResult<1>;
16957
17185
  }