@rarui/components 1.18.0 → 1.19.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,15 @@
2
2
 
3
3
  `@rarui/components` components is a component library built with [Lit](https://lit.dev/).
4
4
 
5
+ ## 2025-01-28 `1.19.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - Added new navigation `SideNavigation` component with collapsible functionality. ([#129](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/129) by [@junior](https://git.rarolabs.com.br/junior))
10
+ - Added `SideNavigationItem` sub-component with level support for nested navigation. ([#129](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/129) by [@junior](https://git.rarolabs.com.br/junior))
11
+ - Implemented slot-based architecture for leading icons and custom content. ([#129](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/129) by [@junior](https://git.rarolabs.com.br/junior))
12
+ - Added toggle event for open/close state changes and improved boolean attribute handling. ([#129](https://git.rarolabs.com.br/frontend/rarui/-/merge_requests/129) by [@junior](https://git.rarolabs.com.br/junior))
13
+
5
14
  ## 2024-08-28 `1.18.0`
6
15
 
7
16
  #### 🎉 New features
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.17.0",
2
+ "version": "1.18.0",
3
3
  "tags": [
4
4
  {
5
5
  "name": "rarui-avatar",
@@ -7283,6 +7283,107 @@
7283
7283
  }
7284
7284
  ]
7285
7285
  },
7286
+ {
7287
+ "name": "rarui-side-navigation-item",
7288
+ "description": "## Rarui SideNavigationItem\n---\nA navigation item component for use within SideNavigation.\n\nSee [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/navigation/side-navigation) for more details.",
7289
+ "attributes": [
7290
+ {
7291
+ "name": "active",
7292
+ "description": "Determines if the item is active or not.",
7293
+ "type": "boolean"
7294
+ },
7295
+ {
7296
+ "name": "level",
7297
+ "description": "Determines the level of nesting for the item.\n\n- 0\n- 1\n- 2",
7298
+ "type": "number",
7299
+ "values": [
7300
+ {
7301
+ "name": 0
7302
+ },
7303
+ {
7304
+ "name": 1
7305
+ },
7306
+ {
7307
+ "name": 2
7308
+ }
7309
+ ]
7310
+ },
7311
+ {
7312
+ "name": "as",
7313
+ "default": "button",
7314
+ "description": "The HTML element type to render.\n\n- a\n- button",
7315
+ "type": "string",
7316
+ "values": [
7317
+ {
7318
+ "name": "a"
7319
+ },
7320
+ {
7321
+ "name": "button",
7322
+ "description": "(default)"
7323
+ }
7324
+ ]
7325
+ }
7326
+ ]
7327
+ },
7328
+ {
7329
+ "name": "rarui-side-navigation",
7330
+ "description": "## Rarui SideNavigation\n---\nA navigation component that supports collapsible content with nested items.\n\n### Slots\n- **Default slot**: Content for nested navigation items\n- **leading-start**: Content to display at the start (e.g., icons)\n- **leading-end**: Content to display at the end (e.g., custom icons)\n\nSee [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/navigation/side-navigation) for more details.",
7331
+ "attributes": [
7332
+ {
7333
+ "name": "name",
7334
+ "description": "Title of the sideNavigation",
7335
+ "type": "string"
7336
+ },
7337
+ {
7338
+ "name": "description",
7339
+ "description": "Description of the sideNavigation.",
7340
+ "type": "string"
7341
+ },
7342
+ {
7343
+ "name": "active",
7344
+ "default": false,
7345
+ "description": "Whether the navigation item is in active state.",
7346
+ "type": "boolean"
7347
+ },
7348
+ {
7349
+ "name": "level",
7350
+ "description": "Determines the level of nesting for the item.\n\n- 0\n- 1\n- 2",
7351
+ "type": "number",
7352
+ "values": [
7353
+ {
7354
+ "name": 0
7355
+ },
7356
+ {
7357
+ "name": 1
7358
+ },
7359
+ {
7360
+ "name": 2
7361
+ }
7362
+ ]
7363
+ },
7364
+ {
7365
+ "name": "disabled",
7366
+ "default": false,
7367
+ "description": "Whether the navigation item is disabled.",
7368
+ "type": "boolean"
7369
+ },
7370
+ {
7371
+ "name": "as",
7372
+ "default": "button",
7373
+ "description": "The HTML element type to render.\n\n- a\n- button",
7374
+ "type": "string",
7375
+ "values": [
7376
+ {
7377
+ "name": "a"
7378
+ },
7379
+ {
7380
+ "name": "button",
7381
+ "description": "(default)"
7382
+ }
7383
+ ]
7384
+ }
7385
+ ]
7386
+ },
7286
7387
  {
7287
7388
  "name": "rarui-tabs",
7288
7389
  "description": "## Rarui Tabs\n---\nThe Tabs are used to switch between different display modes or pages.\n\nSee [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/navigation/tabs) for more details.",
package/dist/index.d.ts CHANGED
@@ -17576,6 +17576,81 @@ declare const paginationStyles: {
17576
17576
 
17577
17577
  type PaginationVariants = Omit<NonNullable<RecipeVariants<typeof paginationStyles.item>>, "selected">;
17578
17578
 
17579
+ declare const sideNavigationStyles: {
17580
+ sideNavigation: RuntimeFn<{
17581
+ active: {
17582
+ true: {
17583
+ color: `var(--${string})` | `var(--${string}, ${string})`;
17584
+ ":after": {
17585
+ content: "";
17586
+ position: "absolute";
17587
+ left: number;
17588
+ right: number;
17589
+ top: number;
17590
+ bottom: number;
17591
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17592
+ };
17593
+ ":hover": {
17594
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17595
+ };
17596
+ ":active": {
17597
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17598
+ };
17599
+ ":disabled": {
17600
+ backgroundColor: `var(--${string})` | `var(--${string}, ${string})`;
17601
+ cursor: "not-allowed";
17602
+ };
17603
+ };
17604
+ };
17605
+ }>;
17606
+ item: RuntimeFn<{
17607
+ /**
17608
+ * Determines the level of nesting for the item.
17609
+ */
17610
+ level: {
17611
+ 0: {
17612
+ paddingLeft: `var(--${string})` | `var(--${string}, ${string})`;
17613
+ };
17614
+ 1: {
17615
+ paddingLeft: `var(--${string})` | `var(--${string}, ${string})`;
17616
+ };
17617
+ 2: {
17618
+ paddingLeft: `var(--${string})` | `var(--${string}, ${string})`;
17619
+ };
17620
+ };
17621
+ }>;
17622
+ name: RuntimeFn<{
17623
+ active: {
17624
+ true: {
17625
+ color: `var(--${string})` | `var(--${string}, ${string})`;
17626
+ };
17627
+ };
17628
+ disabled: {
17629
+ true: {
17630
+ color: `var(--${string})` | `var(--${string}, ${string})`;
17631
+ };
17632
+ };
17633
+ }>;
17634
+ description: RuntimeFn<{
17635
+ disabled: {
17636
+ true: {
17637
+ color: `var(--${string})` | `var(--${string}, ${string})`;
17638
+ };
17639
+ };
17640
+ }>;
17641
+ content: RuntimeFn<{
17642
+ open: {
17643
+ true: {
17644
+ overflow: "visible";
17645
+ maxHeight: "unset";
17646
+ marginTop: `var(--${string})` | `var(--${string}, ${string})`;
17647
+ };
17648
+ };
17649
+ }>;
17650
+ };
17651
+
17652
+ type SideNavigationVariants = NonNullable<RecipeVariants<typeof sideNavigationStyles.sideNavigation> & RecipeVariants<typeof sideNavigationStyles.item>>;
17653
+
17579
17654
  declare const stepperStyles: {
17580
17655
  stepper: RuntimeFn<{
17581
17656
  /**
@@ -18013,6 +18088,26 @@ interface PaginationTyping {
18013
18088
  }
18014
18089
  type PaginationProps = PaginationTyping & PaginationVariants;
18015
18090
 
18091
+ interface SideNavigationTyping {
18092
+ /**
18093
+ * Title of the sideNavigation
18094
+ */
18095
+ name: string;
18096
+ /**
18097
+ * Description of the sideNavigation.
18098
+ */
18099
+ description?: string;
18100
+ }
18101
+ type SideNavigationProps = SideNavigationTyping & SideNavigationVariants;
18102
+
18103
+ interface SideNavigationItemTypings {
18104
+ /**
18105
+ * Determines if the item is active or not.
18106
+ */
18107
+ active?: boolean;
18108
+ }
18109
+ type SideNavigationItemProps = SideNavigationItemTypings & Pick<SideNavigationVariants, "level">;
18110
+
18016
18111
  declare global {
18017
18112
  interface HTMLElementTagNameMap {
18018
18113
  "rarui-avatar": RaruiAvatar;
@@ -18806,6 +18901,88 @@ declare class RaruiPagination extends LitElement {
18806
18901
  render(): TemplateResult<1>;
18807
18902
  }
18808
18903
 
18904
+ declare global {
18905
+ interface HTMLElementTagNameMap {
18906
+ "rarui-side-navigation": RaruiSideNavigation;
18907
+ }
18908
+ }
18909
+ /**
18910
+ * ## Rarui SideNavigation
18911
+ * ---
18912
+ * A navigation component that supports collapsible content with nested items.
18913
+ *
18914
+ * ### Slots
18915
+ * - **Default slot**: Content for nested navigation items
18916
+ * - **leading-start**: Content to display at the start (e.g., icons)
18917
+ * - **leading-end**: Content to display at the end (e.g., custom icons)
18918
+ *
18919
+ * See [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/navigation/side-navigation) for more details.
18920
+ */
18921
+ type SideNavigationProperties = Partial<SideNavigationProps> & {
18922
+ /**
18923
+ * Whether the navigation item is disabled.
18924
+ * @default false
18925
+ */
18926
+ disabled?: boolean;
18927
+ /**
18928
+ * Whether the navigation item is in active state.
18929
+ * @default false
18930
+ */
18931
+ active?: boolean;
18932
+ /**
18933
+ * The HTML element type to render.
18934
+ * @default "button"
18935
+ */
18936
+ as?: "button" | "a";
18937
+ };
18938
+
18939
+ declare class RaruiSideNavigation extends LitElement {
18940
+ name: SideNavigationProperties["name"];
18941
+ description: SideNavigationProperties["description"];
18942
+ active: SideNavigationProperties["active"];
18943
+ disabled: SideNavigationProperties["disabled"];
18944
+ as: SideNavigationProperties["as"];
18945
+ private _open;
18946
+ private _buttonRef;
18947
+ static styles: CSSResult;
18948
+ connectedCallback(): void;
18949
+ private _handleToggle;
18950
+ private _hasChildItems;
18951
+ private _renderLeadingEnd;
18952
+ private _renderContent;
18953
+ render(): TemplateResult<1>;
18954
+ }
18955
+
18956
+ declare global {
18957
+ interface HTMLElementTagNameMap {
18958
+ "rarui-side-navigation-item": RaruiSideNavigationItem;
18959
+ }
18960
+ }
18961
+ /**
18962
+ * ## Rarui SideNavigationItem
18963
+ * ---
18964
+ * A navigation item component for use within SideNavigation.
18965
+ *
18966
+ * See [a complete document](https://rarui.rarolabs.com.br/docs/components-web-components/navigation/side-navigation) for more details.
18967
+ */
18968
+ type SideNavigationItemProperties = Partial<SideNavigationItemProps> & {
18969
+ /**
18970
+ * The HTML element type to render.
18971
+ * @default "button"
18972
+ */
18973
+ as?: "button" | "a";
18974
+ };
18975
+
18976
+ declare class RaruiSideNavigationItem extends LitElement {
18977
+ active: SideNavigationItemProperties["active"];
18978
+ level: SideNavigationItemProperties["level"];
18979
+ as: SideNavigationItemProperties["as"];
18980
+ private _itemRef;
18981
+ static styles: CSSResult;
18982
+ private _handleClick;
18983
+ render(): TemplateResult<1>;
18984
+ }
18985
+
18809
18986
  declare global {
18810
18987
  interface HTMLElementTagNameMap {
18811
18988
  "rarui-banner": RaruiBanner;