@rarui/components 1.15.0 → 1.17.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
@@ -16141,6 +16141,17 @@ declare const fontWeightProperties: {
16141
16141
  semiBold: `var(--${string})` | `var(--${string}, ${string})`;
16142
16142
  bold: `var(--${string})` | `var(--${string}, ${string})`;
16143
16143
  };
16144
+ declare const zIndexProperties: {
16145
+ "100": `var(--${string})` | `var(--${string}, ${string})`;
16146
+ "200": `var(--${string})` | `var(--${string}, ${string})`;
16147
+ "300": `var(--${string})` | `var(--${string}, ${string})`;
16148
+ "400": `var(--${string})` | `var(--${string}, ${string})`;
16149
+ "500": `var(--${string})` | `var(--${string}, ${string})`;
16150
+ "600": `var(--${string})` | `var(--${string}, ${string})`;
16151
+ "700": `var(--${string})` | `var(--${string}, ${string})`;
16152
+ "800": `var(--${string})` | `var(--${string}, ${string})`;
16153
+ "900": `var(--${string})` | `var(--${string}, ${string})`;
16154
+ };
16144
16155
  declare const colorProperties: {
16145
16156
  currentColor: string;
16146
16157
  brand: `var(--${string})` | `var(--${string}, ${string})`;
@@ -16967,6 +16978,48 @@ declare const styles$3: {
16967
16978
 
16968
16979
  type RadioButtonVariants = NonNullable<RecipeVariants<typeof styles$3.radioButton>>;
16969
16980
 
16981
+ declare const dropdownStyles: {
16982
+ dropdown: RuntimeFn<{
16983
+ /**
16984
+ * Specifies the padding inside the dropdown menu. This prop accepts one of the following values: "base" or "none".
16985
+ * @default base
16986
+ */
16987
+ padding: {
16988
+ base: {
16989
+ padding: `var(--${string})` | `var(--${string}, ${string})`;
16990
+ };
16991
+ none: {
16992
+ padding: number;
16993
+ };
16994
+ };
16995
+ }>;
16996
+ item: RuntimeFn<{
16997
+ /**
16998
+ * Indicates if the item is selected.
16999
+ * This affects the visual style, such as highlight or marking.
17000
+ *
17001
+ * @default false
17002
+ */
17003
+ selected: {
17004
+ true: {
17005
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17006
+ ":hover": {
17007
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17008
+ };
17009
+ };
17010
+ };
17011
+ }>;
17012
+ };
17013
+
17014
+ type DropdownVariants = NonNullable<RecipeVariants<typeof dropdownStyles.dropdown> & RecipeVariants<typeof dropdownStyles.item>>;
17015
+ type DropdownDynamicProperties = Pick<StandardLonghandProperties, "width" | "maxWidth">;
17016
+ interface DropdownSprinkle extends DropdownDynamicProperties {
17017
+ /**
17018
+ * The zIndex property specifies the stack order of the box.
17019
+ */
17020
+ zIndex?: AddDollar<keyof typeof zIndexProperties> | Conditions<AddDollar<keyof typeof zIndexProperties>>;
17021
+ }
17022
+
16970
17023
  declare const statusStyles: {
16971
17024
  status: RuntimeFn<{
16972
17025
  /**
@@ -17324,6 +17377,33 @@ interface CardSprinkle {
17324
17377
  backgroundColor?: AddDollar<keyof typeof cardBackgroundColorProperties> | Conditions<AddDollar<keyof typeof cardBackgroundColorProperties>>;
17325
17378
  }
17326
17379
 
17380
+ declare const modalStyles: {
17381
+ modal: RuntimeFn<{
17382
+ /**
17383
+ * Padding properties are used to generate space around the content area of an Accordion.Body..
17384
+ * @default base
17385
+ */
17386
+ padding: {
17387
+ base: {
17388
+ padding: `var(--${string}) var(--${string})` | `var(--${string}) var(--${string}, ${string})` | `var(--${string}, ${string}) var(--${string})` | `var(--${string}, ${string}) var(--${string}, ${string})`;
17389
+ };
17390
+ none: {
17391
+ padding: number;
17392
+ };
17393
+ };
17394
+ }>;
17395
+ overlay: string;
17396
+ };
17397
+
17398
+ type ModalVariants = Omit<NonNullable<RecipeVariants<typeof modalStyles.modal>>, "selected">;
17399
+ type ModalDynamicProperties = Pick<StandardLonghandProperties, "maxWidth">;
17400
+ interface ModalSprinkle extends ModalDynamicProperties {
17401
+ /**
17402
+ * The zIndex property specifies the stack order of the box.
17403
+ */
17404
+ zIndex?: AddDollar<keyof typeof zIndexProperties> | Conditions<AddDollar<keyof typeof zIndexProperties>>;
17405
+ }
17406
+
17327
17407
  declare const paginationStyles: {
17328
17408
  container: RuntimeFn<{
17329
17409
  size: {
@@ -17621,6 +17701,58 @@ interface ChipTyping extends ChipSprinkle {
17621
17701
  }
17622
17702
  type ChipProps = ChipTyping & ChipVariants;
17623
17703
 
17704
+ interface DropdownTyping {
17705
+ /**
17706
+ * A common feature of select dropdowns is that the dropdown matches the width of the reference regardless of its contents.
17707
+ * @default false
17708
+ */
17709
+ matchReferenceWidth?: boolean;
17710
+ /**
17711
+ * Adds listeners that dismiss (close) the floating element.
17712
+ * @default true
17713
+ */
17714
+ enabledDismiss?: boolean;
17715
+ /**
17716
+ * Adds click event listeners that change the open state.
17717
+ * @default true
17718
+ */
17719
+ enabledClick?: boolean;
17720
+ /**
17721
+ * Determines whether the dropdown should enable flipping the options' dropdown when there is not enough space to display it in its default direction.
17722
+ * This can help ensure the dropdown is always visible on the screen.
17723
+ * @default true
17724
+ */
17725
+ enabledFlip?: boolean;
17726
+ /**
17727
+ * Offest displaces the floating element from its core placement along the specified axes.
17728
+ * @default 10
17729
+ */
17730
+ offset?: number;
17731
+ /**
17732
+ * Specifies the ID of the portal element where the dropdown should be rendered.
17733
+ * This can be useful for rendering the dropdown in a different part of the DOM, such as a modal or overlay.
17734
+ */
17735
+ portalId?: string;
17736
+ /**
17737
+ * If true, the component is shown.
17738
+ */
17739
+ visible?: boolean;
17740
+ /**
17741
+ * Function to control dropdown opening and closing.
17742
+ * @TJS-type (visible: boolean) => void;
17743
+ */
17744
+ onVisibility?: (visible: boolean) => void;
17745
+ }
17746
+ type DropdownProps = DropdownTyping & DropdownSprinkle & Pick<DropdownVariants, "padding">;
17747
+
17748
+ interface DropdownItemTyping {
17749
+ /**
17750
+ * The name of the dropdown item. This is typically the text that is displayed for the item.
17751
+ */
17752
+ name?: string;
17753
+ }
17754
+ type DropdownItemProps = DropdownItemTyping & Pick<DropdownVariants, "selected">;
17755
+
17624
17756
  interface IconButtonTyping {
17625
17757
  /**
17626
17758
  * Disables the button, disallowing user interaction.
@@ -17696,6 +17828,36 @@ interface CardHeaderProps {
17696
17828
  description?: string;
17697
17829
  }
17698
17830
 
17831
+ interface ModalTyping {
17832
+ /**
17833
+ * Whether the modal is open or not.
17834
+ */
17835
+ open: boolean;
17836
+ /**
17837
+ * Specifies the ID of the portal element where the modal should be rendered.
17838
+ * This can be useful for rendering the modal in a different part of the DOM, such as a modal or overlay.
17839
+ */
17840
+ portalId?: string;
17841
+ /**
17842
+ * Callback fired when the component requests to be closed.
17843
+ * @TJS-type (open: boolean) => void;
17844
+ */
17845
+ onDismiss: (open: boolean) => void;
17846
+ }
17847
+ type ModalProps = ModalTyping & ModalSprinkle & ModalVariants;
17848
+
17849
+ interface ModalHeaderTypings {
17850
+ /**
17851
+ * The title to display in the Modal header.
17852
+ */
17853
+ title?: string;
17854
+ /**
17855
+ * The subtitle to display in the Modal header.
17856
+ */
17857
+ subtitle?: string;
17858
+ }
17859
+ type ModalHeaderProps = ModalHeaderTypings;
17860
+
17699
17861
  type LinkProps = LinkVariants;
17700
17862
 
17701
17863
  interface PaginationTyping {
@@ -17969,7 +18131,7 @@ declare global {
17969
18131
  */
17970
18132
  type TooltipProperties = Partial<Omit<TooltipProps, "visible" | "onVisibility" | "portalId">> & {
17971
18133
  /**
17972
- * Position of the popover.
18134
+ * Position of the tooltip.
17973
18135
  * @default bottom
17974
18136
  */
17975
18137
  position?: Placement;
@@ -18181,6 +18343,91 @@ declare class RaruiChip extends LitElement {
18181
18343
  render(): TemplateResult<1>;
18182
18344
  }
18183
18345
 
18346
+ declare global {
18347
+ interface HTMLElementTagNameMap {
18348
+ "rarui-dropdown": RaruiDropdown;
18349
+ }
18350
+ }
18351
+ /**
18352
+ * ## Rarui Dropdown
18353
+ * ---
18354
+ * An suspended menu displays a list of options on a temporary surface.
18355
+ *
18356
+ See [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/input/dropdown) for more details.
18357
+ */
18358
+ type DropdownProperties = Omit<Partial<DropdownProps>, "onVisibility" | "portalId"> & {
18359
+ /**
18360
+ * Position of the dropdown.
18361
+ * @default bottom-start
18362
+ */
18363
+ position?: Placement;
18364
+ /**
18365
+ * CSS positioning strategy used for the tooltip.
18366
+ *
18367
+ * - `"fixed"` (default) positions the tooltip relative to the viewport,
18368
+ * so it stays in the same place even when the page is scrolled.
18369
+ * - `"absolute"` positions the tooltip relative to the nearest positioned ancestor,
18370
+ * which can be useful when you want the tooltip to move with page content.
18371
+ *
18372
+ * Use `"fixed"` for tooltips that should remain visible on scroll,
18373
+ * and `"absolute"` when tooltips need to be positioned within scrollable containers.
18374
+ * @default fixed
18375
+ */
18376
+ strategy?: "fixed" | "absolute";
18377
+ };
18378
+
18379
+ declare class RaruiDropdown extends LitElement {
18380
+ sprinkleAttrs: Record<string, string>;
18381
+ offset: DropdownProperties["offset"];
18382
+ padding: DropdownProperties["padding"];
18383
+ position: DropdownProperties["position"];
18384
+ strategy: DropdownProperties["strategy"];
18385
+ matchReferenceWidth?: DropdownProperties["matchReferenceWidth"];
18386
+ enabledFlip?: DropdownProperties["enabledFlip"];
18387
+ enabledClick: DropdownProperties["enabledClick"];
18388
+ enabledDismiss: DropdownProperties["enabledDismiss"];
18389
+ open: boolean;
18390
+ set visible(value: boolean | undefined);
18391
+ get visible(): boolean | undefined;
18392
+ private _visible?;
18393
+ reference: HTMLElement;
18394
+ floating: HTMLElement;
18395
+ static styles: CSSResult;
18396
+ cleanupAutoUpdate?: () => void;
18397
+ private updatePositionDebounceId;
18398
+ connectedCallback(): void;
18399
+ disconnectedCallback(): void;
18400
+ updated(changed: Map<string, any>): void;
18401
+ private scheduleUpdatePosition;
18402
+ private handleClickOutside;
18403
+ private handleClick;
18404
+ updatePosition(): Promise<void>;
18405
+ private getMiddleware;
18406
+ computePosition(): Promise<void>;
18407
+ render(): TemplateResult<1>;
18408
+ }
18409
+
18410
+ declare global {
18411
+ interface HTMLElementTagNameMap {
18412
+ "rarui-dropdown-item": RaruiDropdownItem;
18413
+ }
18414
+ }
18415
+ /**
18416
+ * ## Rarui Dropdown Item
18417
+ * ---
18418
+ * An suspended menu displays a list of options on a temporary surface.
18419
+ *
18420
+ See [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/surface/dropdown) for more details.
18421
+ */
18422
+ type DropdownItemProperties = Omit<DropdownItemProps, "icon">;
18423
+
18424
+ declare class RaruiDropdownItem extends LitElement {
18425
+ name: DropdownItemProperties["name"];
18426
+ selected: DropdownItemProperties["selected"];
18427
+ static styles: CSSResult;
18428
+ render(): TemplateResult<1>;
18429
+ }
18430
+
18184
18431
  declare global {
18185
18432
  interface HTMLElementTagNameMap {
18186
18433
  "rarui-icon-button": RaruiIconButton;
@@ -18461,3 +18708,57 @@ declare class RaruiCard extends LitElement {
18461
18708
  static styles: CSSResult;
18462
18709
  render(): TemplateResult<1>;
18463
18710
  }
18711
+
18712
+ declare global {
18713
+ interface HTMLElementTagNameMap {
18714
+ "rarui-modal": RaruiModal;
18715
+ }
18716
+ }
18717
+ /**
18718
+ * ## Rarui Modal
18719
+ * ---
18720
+ * The modal component provides a base for popovers, suspended forms, tutorials, or any other content above the UI main surface.
18721
+ *
18722
+ See [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/surface/modal) for more details.
18723
+ */
18724
+ type ModalProperties = Omit<Partial<ModalProps>, "onDismiss">;
18725
+
18726
+ declare class RaruiModal extends LitElement {
18727
+ sprinkleAttrs: Record<string, string>;
18728
+ padding: ModalProperties["padding"];
18729
+ portalId: ModalProperties["portalId"];
18730
+ open: ModalProperties["open"];
18731
+ maxWidth: ModalProperties["maxWidth"];
18732
+ dialog: HTMLElement;
18733
+ static styles: CSSResult;
18734
+ cleanupAutoUpdate?: () => void;
18735
+ connectedCallback(): void;
18736
+ disconnectedCallback(): void;
18737
+ firstUpdated(): void;
18738
+ updated(changed: Map<string, any>): void;
18739
+ private getPortalRoot;
18740
+ private handleKeyDown;
18741
+ private dismiss;
18742
+ render(): TemplateResult<1>;
18743
+ }
18744
+
18745
+ declare global {
18746
+ interface HTMLElementTagNameMap {
18747
+ "rarui-modal-header": RaruiModalHeader;
18748
+ }
18749
+ }
18750
+ /**
18751
+ * ## Rarui Modal Header
18752
+ * ---
18753
+ * The modal component provides a base for popovers, suspended forms, tutorials, or any other content above the UI main surface.
18754
+ *
18755
+ See [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/surface/modal) for more details.
18756
+ */
18757
+ type ModalHeaderProperties = ModalHeaderProps;
18758
+
18759
+ declare class RaruiModalHeader extends LitElement {
18760
+ title: string;
18761
+ subtitle: ModalHeaderProperties["subtitle"];
18762
+ private handleClose;
18763
+ render(): TemplateResult<1>;
18764
+ }