@clickhouse/click-ui 0.6.1-rc1 → 0.6.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/cjs/click-ui.css +623 -11
- package/dist/cjs/components/Accordion/Accordion.css +111 -0
- package/dist/cjs/components/Accordion/Accordion.module.css.cjs +33 -0
- package/dist/cjs/components/Accordion/Accordion.module.css.cjs.map +1 -0
- package/dist/cjs/components/Accordion/index.cjs +51 -54
- package/dist/cjs/components/Accordion/index.cjs.map +1 -1
- package/dist/cjs/components/Alert/Alert.css +169 -0
- package/dist/cjs/components/Alert/Alert.module.css.cjs +75 -0
- package/dist/cjs/components/Alert/Alert.module.css.cjs.map +1 -0
- package/dist/cjs/components/Alert/index.cjs +113 -69
- package/dist/cjs/components/Alert/index.cjs.map +1 -1
- package/dist/cjs/components/Assets/Icons/Dollar.cjs +10 -0
- package/dist/cjs/components/Assets/Icons/Dollar.cjs.map +1 -0
- package/dist/cjs/components/Assets/Icons/Pin.cjs +13 -0
- package/dist/cjs/components/Assets/Icons/Pin.cjs.map +1 -0
- package/dist/cjs/components/Assets/Icons/Unpin.cjs +17 -0
- package/dist/cjs/components/Assets/Icons/Unpin.cjs.map +1 -0
- package/dist/cjs/components/Assets/Icons/system/IconsLight.cjs +6 -0
- package/dist/cjs/components/Assets/Icons/system/IconsLight.cjs.map +1 -1
- package/dist/cjs/components/Button/index.cjs +2 -1
- package/dist/cjs/components/Button/index.cjs.map +1 -1
- package/dist/cjs/components/Collapsible/Collapsible.css +79 -0
- package/dist/cjs/components/Collapsible/Collapsible.module.css.cjs +31 -0
- package/dist/cjs/components/Collapsible/Collapsible.module.css.cjs.map +1 -0
- package/dist/cjs/components/Collapsible/IconWrapper.cjs +4 -11
- package/dist/cjs/components/Collapsible/IconWrapper.cjs.map +1 -1
- package/dist/cjs/components/Collapsible/index.cjs +36 -24
- package/dist/cjs/components/Collapsible/index.cjs.map +1 -1
- package/dist/cjs/components/Container/Container.css +3 -3
- package/dist/cjs/components/HoverCard/HoverCard.css +6 -0
- package/dist/cjs/components/HoverCard/HoverCard.module.css.cjs +10 -0
- package/dist/cjs/components/HoverCard/HoverCard.module.css.cjs.map +1 -0
- package/dist/cjs/components/HoverCard/index.cjs +5 -5
- package/dist/cjs/components/HoverCard/index.cjs.map +1 -1
- package/dist/cjs/components/Link/Link.css +12 -8
- package/dist/cjs/components/Link/Link.module.css.cjs +15 -4
- package/dist/cjs/components/Link/Link.module.css.cjs.map +1 -1
- package/dist/cjs/components/Link/index.cjs +6 -6
- package/dist/cjs/components/Link/index.cjs.map +1 -1
- package/dist/cjs/components/Select/common/InternalSelect.cjs +1 -1
- package/dist/cjs/components/Select/common/InternalSelect.cjs.map +1 -1
- package/dist/cjs/components/SidebarNavigationItem/SidebarNavigationItem.css +167 -0
- package/dist/cjs/components/SidebarNavigationItem/SidebarNavigationItem.module.css.cjs +23 -0
- package/dist/cjs/components/SidebarNavigationItem/SidebarNavigationItem.module.css.cjs.map +1 -0
- package/dist/cjs/components/SidebarNavigationItem/index.cjs +60 -69
- package/dist/cjs/components/SidebarNavigationItem/index.cjs.map +1 -1
- package/dist/cjs/components/SidebarNavigationTitle/SidebarNavigationTitle.css +76 -0
- package/dist/cjs/components/SidebarNavigationTitle/SidebarNavigationTitle.module.css.cjs +19 -0
- package/dist/cjs/components/SidebarNavigationTitle/SidebarNavigationTitle.module.css.cjs.map +1 -0
- package/dist/cjs/components/SidebarNavigationTitle/index.cjs +35 -23
- package/dist/cjs/components/SidebarNavigationTitle/index.cjs.map +1 -1
- package/dist/esm/click-ui.css +623 -11
- package/dist/esm/components/Accordion/Accordion.css +111 -0
- package/dist/esm/components/Accordion/Accordion.module.css.js +22 -0
- package/dist/esm/components/Accordion/Accordion.module.css.js.map +1 -0
- package/dist/esm/components/Accordion/index.js +51 -54
- package/dist/esm/components/Accordion/index.js.map +1 -1
- package/dist/esm/components/Alert/Alert.css +169 -0
- package/dist/esm/components/Alert/Alert.module.css.js +53 -0
- package/dist/esm/components/Alert/Alert.module.css.js.map +1 -0
- package/dist/esm/components/Alert/index.js +113 -69
- package/dist/esm/components/Alert/index.js.map +1 -1
- package/dist/esm/components/Assets/Icons/Dollar.js +6 -0
- package/dist/esm/components/Assets/Icons/Dollar.js.map +1 -0
- package/dist/esm/components/Assets/Icons/Pin.js +9 -0
- package/dist/esm/components/Assets/Icons/Pin.js.map +1 -0
- package/dist/esm/components/Assets/Icons/Unpin.js +13 -0
- package/dist/esm/components/Assets/Icons/Unpin.js.map +1 -0
- package/dist/esm/components/Assets/Icons/system/IconsLight.js +6 -0
- package/dist/esm/components/Assets/Icons/system/IconsLight.js.map +1 -1
- package/dist/esm/components/Button/index.js +2 -1
- package/dist/esm/components/Button/index.js.map +1 -1
- package/dist/esm/components/Collapsible/Collapsible.css +79 -0
- package/dist/esm/components/Collapsible/Collapsible.module.css.js +21 -0
- package/dist/esm/components/Collapsible/Collapsible.module.css.js.map +1 -0
- package/dist/esm/components/Collapsible/IconWrapper.js +4 -11
- package/dist/esm/components/Collapsible/IconWrapper.js.map +1 -1
- package/dist/esm/components/Collapsible/index.js +36 -24
- package/dist/esm/components/Collapsible/index.js.map +1 -1
- package/dist/esm/components/Container/Container.css +3 -3
- package/dist/esm/components/HoverCard/HoverCard.css +6 -0
- package/dist/esm/components/HoverCard/HoverCard.module.css.js +6 -0
- package/dist/esm/components/HoverCard/HoverCard.module.css.js.map +1 -0
- package/dist/esm/components/HoverCard/index.js +5 -5
- package/dist/esm/components/HoverCard/index.js.map +1 -1
- package/dist/esm/components/Link/Link.css +12 -8
- package/dist/esm/components/Link/Link.module.css.js +11 -5
- package/dist/esm/components/Link/Link.module.css.js.map +1 -1
- package/dist/esm/components/Link/index.js +6 -6
- package/dist/esm/components/Link/index.js.map +1 -1
- package/dist/esm/components/Select/common/InternalSelect.js +1 -1
- package/dist/esm/components/Select/common/InternalSelect.js.map +1 -1
- package/dist/esm/components/SidebarNavigationItem/SidebarNavigationItem.css +167 -0
- package/dist/esm/components/SidebarNavigationItem/SidebarNavigationItem.module.css.js +16 -0
- package/dist/esm/components/SidebarNavigationItem/SidebarNavigationItem.module.css.js.map +1 -0
- package/dist/esm/components/SidebarNavigationItem/index.js +60 -69
- package/dist/esm/components/SidebarNavigationItem/index.js.map +1 -1
- package/dist/esm/components/SidebarNavigationTitle/SidebarNavigationTitle.css +76 -0
- package/dist/esm/components/SidebarNavigationTitle/SidebarNavigationTitle.module.css.js +12 -0
- package/dist/esm/components/SidebarNavigationTitle/SidebarNavigationTitle.module.css.js.map +1 -0
- package/dist/esm/components/SidebarNavigationTitle/index.js +35 -23
- package/dist/esm/components/SidebarNavigationTitle/index.js.map +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +3 -3
- package/dist/types/components/Assets/Icons/Dollar.d.ts +3 -0
- package/dist/types/components/Assets/Icons/Pin.d.ts +3 -0
- package/dist/types/components/Assets/Icons/Unpin.d.ts +3 -0
- package/dist/types/components/Assets/Icons/system/types.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +1 -24
- package/dist/types/components/Button/Button.types.d.ts +3 -0
- package/dist/types/components/Collapsible/Collapsible.d.ts +3 -3
- package/dist/types/components/HoverCard/HoverCard.d.ts +1 -1
- package/dist/types/components/SidebarNavigationItem/SidebarNavigationItem.d.ts +9 -5
- package/dist/types/components/SidebarNavigationTitle/SidebarNavigationTitle.d.ts +9 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/SidebarNavigationItem/SidebarNavigationItem.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/SidebarNavigationItem/SidebarNavigationItem.tsx"],"sourcesContent":["import {\n ComponentProps,\n ComponentPropsWithRef,\n ElementType,\n ReactNode,\n forwardRef,\n} from 'react';\nimport { cn, cva } from '@/lib/cva';\nimport { IconWrapper } from '@/components/Collapsible/IconWrapper';\nimport { SidebarNavigationItemProps } from './SidebarNavigationItem.types';\nimport styles from './SidebarNavigationItem.module.css';\n\nconst wrapperVariants = cva(styles.wrapper, {\n variants: {\n itemType: {\n item: styles.wrapper_itemtype_item,\n subItem: styles['wrapper_itemtype_sub-item'],\n },\n // The colour set depends on BOTH the sidebar type and the item depth, so\n // it is applied through the compoundVariants below rather than here.\n type: { main: '', sqlSidebar: '' },\n collapsible: { true: styles.wrapper_collapsible_true, false: '' },\n },\n compoundVariants: [\n { type: 'main', itemType: 'item', class: styles['wrapper_color_main-item'] },\n { type: 'main', itemType: 'subItem', class: styles['wrapper_color_main-sub-item'] },\n {\n type: 'sqlSidebar',\n itemType: 'item',\n class: styles['wrapper_color_sql-sidebar-item'],\n },\n {\n type: 'sqlSidebar',\n itemType: 'subItem',\n class: styles['wrapper_color_sql-sidebar-sub-item'],\n },\n ],\n defaultVariants: { itemType: 'item', type: 'main', collapsible: false },\n});\n\n// Polymorphic wrapper: SidebarCollapsibleItem renders it `as={Collapsible.Header}`.\n// Same shape as the Container polymorphic component (src/components/Container).\nexport interface SidebarItemWrapperProps<T extends ElementType = 'div'> {\n as?: T;\n $collapsible?: boolean;\n $level?: number;\n $type?: 'main' | 'sqlSidebar';\n}\n\ntype SidebarItemWrapperComponent = <T extends ElementType = 'div'>(\n props: Omit<ComponentProps<T>, keyof SidebarItemWrapperProps<T>> &\n SidebarItemWrapperProps<T>\n) => ReactNode;\n\nconst _SidebarItemWrapper = <T extends ElementType = 'div'>(\n {\n as,\n $collapsible = false,\n $level = 0,\n $type = 'main',\n className,\n ...props\n }: Omit<ComponentProps<T>, keyof SidebarItemWrapperProps<T>> &\n SidebarItemWrapperProps<T>,\n ref: ComponentPropsWithRef<T>['ref']\n) => {\n const Component = as ?? 'div';\n return (\n <Component\n ref={ref}\n {...props}\n className={cn(\n wrapperVariants({\n itemType: $level === 0 ? 'item' : 'subItem',\n type: $type,\n collapsible: $collapsible,\n }),\n className\n )}\n />\n );\n};\n\nexport const SidebarItemWrapper: SidebarItemWrapperComponent =\n forwardRef(_SidebarItemWrapper);\n\nconst SidebarNavigationItem = forwardRef<HTMLDivElement, SidebarNavigationItemProps>(\n (\n { label, level = 0, icon, selected, iconDir, disabled, type = 'main', ...props },\n ref\n ) => {\n return (\n <SidebarItemWrapper\n $level={level}\n data-selected={selected}\n $type={type}\n ref={ref}\n aria-disabled={disabled}\n {...props}\n >\n <IconWrapper\n icon={icon}\n iconDir={iconDir}\n >\n {label}\n </IconWrapper>\n </SidebarItemWrapper>\n );\n }\n);\n\nexport { SidebarNavigationItem };\n"],"names":["wrapperVariants","cva","styles","wrapper","variants","itemType","item","wrapper_itemtype_item","subItem","type","main","sqlSidebar","collapsible","true","wrapper_collapsible_true","false","compoundVariants","class","defaultVariants","_SidebarItemWrapper","as","$collapsible","$level","$type","className","props","ref","Component","cn","SidebarItemWrapper","forwardRef","SidebarNavigationItem","label","level","icon","selected","iconDir","disabled","jsx","IconWrapper"],"mappings":";;;;;;;;;;;AAYA,MAAMA,eAAAA,GAAkBC,0BAAAA,CAAIC,oCAAAA,CAAOC,OAAAA,EAAS;AAAA,EAC1CC,QAAAA,EAAU;AAAA,IACRC,QAAAA,EAAU;AAAA,MACRC,MAAMJ,oCAAAA,CAAOK,qBAAAA;AAAAA,MACbC,OAAAA,EAASN,qCAAO,2BAA2B;AAAA,KAC7C;AAAA;AAAA;AAAA,IAGAO,IAAAA,EAAM;AAAA,MAAEC,IAAAA,EAAM,EAAA;AAAA,MAAIC,UAAAA,EAAY;AAAA,KAAG;AAAA,IACjCC,WAAAA,EAAa;AAAA,MAAEC,MAAMX,oCAAAA,CAAOY,wBAAAA;AAAAA,MAA0BC,KAAAA,EAAO;AAAA;AAAG,GAClE;AAAA,EACAC,kBAAkB,CAChB;AAAA,IAAEP,IAAAA,EAAM,MAAA;AAAA,IAAQJ,QAAAA,EAAU,MAAA;AAAA,IAAQY,KAAAA,EAAOf,qCAAO,yBAAyB;AAAA,GAAE,EAC3E;AAAA,IAAEO,IAAAA,EAAM,MAAA;AAAA,IAAQJ,QAAAA,EAAU,SAAA;AAAA,IAAWY,KAAAA,EAAOf,qCAAO,6BAA6B;AAAA,GAAE,EAClF;AAAA,IACEO,IAAAA,EAAM,YAAA;AAAA,IACNJ,QAAAA,EAAU,MAAA;AAAA,IACVY,KAAAA,EAAOf,qCAAO,gCAAgC;AAAA,GAChD,EACA;AAAA,IACEO,IAAAA,EAAM,YAAA;AAAA,IACNJ,QAAAA,EAAU,SAAA;AAAA,IACVY,KAAAA,EAAOf,qCAAO,oCAAoC;AAAA,GACnD,CAAA;AAAA,EAEHgB,eAAAA,EAAiB;AAAA,IAAEb,QAAAA,EAAU,MAAA;AAAA,IAAQI,IAAAA,EAAM,MAAA;AAAA,IAAQG,WAAAA,EAAa;AAAA;AAClE,CAAC,CAAA;AAgBD,MAAMO,sBAAsB,CAC1B;AAAA,EACEC,EAAAA;AAAAA,EACAC,YAAAA,GAAe,KAAA;AAAA,EACfC,MAAAA,GAAS,CAAA;AAAA,EACTC,KAAAA,GAAQ,MAAA;AAAA,EACRC,SAAAA;AAAAA,EACA,GAAGC;AAEsB,CAAA,EAC3BC,GAAAA,KACG;AACH,EAAA,MAAMC,YAAYP,EAAAA,IAAM,KAAA;AACxB,EAAA,sCACG,SAAA,EAAA,EACC,GAAA,KACIK,KAAAA,EACJ,SAAA,EAAWG,OACT5B,eAAAA,CAAgB;AAAA,IACdK,QAAAA,EAAUiB,MAAAA,KAAW,CAAA,GAAI,MAAA,GAAS,SAAA;AAAA,IAClCb,IAAAA,EAAMc,KAAAA;AAAAA,IACNX,WAAAA,EAAaS;AAAAA,GACd,CAAA,EACDG,SACF,CAAA,EAAE,CAAA;AAGR,CAAA;AAEO,MAAMK,kBAAAA,GACXC,iBAAWX,mBAAmB;AAEhC,MAAMY,qBAAAA,GAAwBD,iBAC5B,CACE;AAAA,EAAEE,KAAAA;AAAAA,EAAOC,KAAAA,GAAQ,CAAA;AAAA,EAAGC,IAAAA;AAAAA,EAAMC,QAAAA;AAAAA,EAAUC,OAAAA;AAAAA,EAASC,QAAAA;AAAAA,EAAU5B,IAAAA,GAAO,MAAA;AAAA,EAAQ,GAAGgB;AAAM,CAAA,EAC/EC,GAAAA,KACG;AACH,EAAA,sCACG,kBAAA,EAAA,EACC,MAAA,EAAQO,OACR,eAAA,EAAeE,QAAAA,EACf,OAAO1B,IAAAA,EACP,GAAA,EACA,eAAA,EAAe4B,QAAAA,EACf,GAAIZ,KAAAA,EAEJ,QAAA,kBAAAa,cAAA,CAACC,2BACC,IAAA,EACA,OAAA,EAECP,iBACH,CAAA,EACF,CAAA;AAEJ,CACF;;;;;"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* stylelint-disable custom-property-pattern -- design tokens use camelCase (e.g. sqlSidebar) */
|
|
2
|
+
.wrapper__ey0v7 {
|
|
3
|
+
/* stylelint-disable plugin/no-unsupported-browser-features, declaration-property-value-no-unknown -- the original styled rule used this
|
|
4
|
+
same width fallback chain (100% → -webkit-fill-available → fill-available →
|
|
5
|
+
stretch) so the title fills the available inline space. */
|
|
6
|
+
width: 100%;
|
|
7
|
+
width: -webkit-fill-available;
|
|
8
|
+
width: fill-available;
|
|
9
|
+
width: stretch;
|
|
10
|
+
/* stylelint-enable plugin/no-unsupported-browser-features, declaration-property-value-no-unknown */
|
|
11
|
+
padding: 0;
|
|
12
|
+
padding-left: var(--title-pad-left);
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
border: none;
|
|
15
|
+
background: transparent;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
|
|
18
|
+
/* Not collapsible by default: reserve the icon-column width on the left.
|
|
19
|
+
The single-class modifiers below override this; keep these defaults at
|
|
20
|
+
single-class specificity so they can. */
|
|
21
|
+
--title-pad-left: var(--click-image-sm-size-width);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Doubled class → specificity (0,2,0). SidebarCollapsibleTitle renders this
|
|
25
|
+
wrapper `as={Collapsible.Trigger}`, so the element also carries
|
|
26
|
+
`.collapsible__trigger`, whose `display/align-items/color/font/cursor`
|
|
27
|
+
resets would otherwise win on CSS-module bundle order and strip the title's
|
|
28
|
+
own typography. The original styled-components cascade resolved in the
|
|
29
|
+
title's favour; the doubled class makes that deterministic. Only the
|
|
30
|
+
properties that actually conflict with the trigger live here — box metrics
|
|
31
|
+
and the `--title-*` custom properties stay single-class above/below so the
|
|
32
|
+
`type`/`collapsible` modifiers still override them. */
|
|
33
|
+
.wrapper__ey0v7.wrapper__ey0v7 {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
color: var(--title-color-default);
|
|
37
|
+
font: var(--click-sidebar-navigation-title-typography-default);
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.wrapper__ey0v7.wrapper__ey0v7:hover {
|
|
42
|
+
color: var(--title-color-hover);
|
|
43
|
+
font: var(--click-sidebar-navigation-title-typography-hover);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.wrapper__ey0v7.wrapper__ey0v7:active,
|
|
47
|
+
.wrapper__ey0v7.wrapper__ey0v7[data-state='open'],
|
|
48
|
+
.wrapper__ey0v7.wrapper__ey0v7[data-selected='true'] {
|
|
49
|
+
color: var(--title-color-active);
|
|
50
|
+
font: var(--click-sidebar-navigation-title-typography-active);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.wrapper__ey0v7 a {
|
|
54
|
+
color: inherit;
|
|
55
|
+
text-decoration: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.wrapper__ey0v7 a:active {
|
|
59
|
+
color: inherit;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.wrapper_type_main__wvTIv {
|
|
63
|
+
--title-color-default: var(--click-sidebar-main-navigation-title-color-default);
|
|
64
|
+
--title-color-hover: var(--click-sidebar-main-navigation-title-color-hover);
|
|
65
|
+
--title-color-active: var(--click-sidebar-main-navigation-title-color-active);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.wrapper_type_sql-sidebar__J-qle {
|
|
69
|
+
--title-color-default: var(--click-sidebar-sqlSidebar-navigation-title-color-default);
|
|
70
|
+
--title-color-hover: var(--click-sidebar-sqlSidebar-navigation-title-color-hover);
|
|
71
|
+
--title-color-active: var(--click-sidebar-sqlSidebar-navigation-title-color-active);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.wrapper_collapsible_true__8ANnP {
|
|
75
|
+
--title-pad-left: 0;
|
|
76
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const wrapper = "wrapper__ey0v7";
|
|
6
|
+
const wrapper_type_main = "wrapper_type_main__wvTIv";
|
|
7
|
+
const wrapper_collapsible_true = "wrapper_collapsible_true__8ANnP";
|
|
8
|
+
const styles = {
|
|
9
|
+
wrapper: wrapper,
|
|
10
|
+
wrapper_type_main: wrapper_type_main,
|
|
11
|
+
"wrapper_type_sql-sidebar": "wrapper_type_sql-sidebar__J-qle",
|
|
12
|
+
wrapper_collapsible_true: wrapper_collapsible_true
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.default = styles;
|
|
16
|
+
exports.wrapper = wrapper;
|
|
17
|
+
exports.wrapper_collapsible_true = wrapper_collapsible_true;
|
|
18
|
+
exports.wrapper_type_main = wrapper_type_main;
|
|
19
|
+
//# sourceMappingURL=SidebarNavigationTitle.module.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarNavigationTitle.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,45 @@
|
|
|
1
|
+
require("./SidebarNavigationTitle.css");
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
5
|
|
|
5
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
const
|
|
7
|
+
const react = require('react');
|
|
8
|
+
const cva = require('../../lib/cva.cjs');
|
|
7
9
|
const IconWrapper = require('../Collapsible/IconWrapper.cjs');
|
|
10
|
+
const SidebarNavigationTitle_module = require('./SidebarNavigationTitle.module.css.cjs');
|
|
11
|
+
const classVarianceAuthority = require('class-variance-authority');
|
|
8
12
|
|
|
13
|
+
const wrapperVariants = classVarianceAuthority.cva(SidebarNavigationTitle_module.default.wrapper, {
|
|
14
|
+
variants: {
|
|
15
|
+
type: {
|
|
16
|
+
main: SidebarNavigationTitle_module.default.wrapper_type_main,
|
|
17
|
+
sqlSidebar: SidebarNavigationTitle_module.default["wrapper_type_sql-sidebar"]
|
|
18
|
+
},
|
|
19
|
+
collapsible: {
|
|
20
|
+
true: SidebarNavigationTitle_module.default.wrapper_collapsible_true,
|
|
21
|
+
false: ""
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
type: "main",
|
|
26
|
+
collapsible: false
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const _SidebarTitleWrapper = ({
|
|
30
|
+
as,
|
|
31
|
+
$collapsible = false,
|
|
32
|
+
$type = "main",
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}, ref) => {
|
|
36
|
+
const Component = as ?? "button";
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, ...props, className: cva.cn(wrapperVariants({
|
|
38
|
+
type: $type,
|
|
39
|
+
collapsible: $collapsible
|
|
40
|
+
}), className) });
|
|
41
|
+
};
|
|
42
|
+
const SidebarTitleWrapper = react.forwardRef(_SidebarTitleWrapper);
|
|
9
43
|
const SidebarNavigationTitle = ({
|
|
10
44
|
label,
|
|
11
45
|
icon,
|
|
@@ -16,28 +50,6 @@ const SidebarNavigationTitle = ({
|
|
|
16
50
|
}) => {
|
|
17
51
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarTitleWrapper, { "data-selected": selected, $type: type, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(IconWrapper.IconWrapper, { icon, iconDir, children: label }) });
|
|
18
52
|
};
|
|
19
|
-
const SidebarTitleWrapper = styledComponents.styled.button.withConfig({
|
|
20
|
-
componentId: "sc-1rg1a4o-0"
|
|
21
|
-
})(["display:inline-flex;align-items:center;background:transparent;border:none;width:100%;width:-webkit-fill-available;width:fill-available;width:stretch;white-space:nowrap;overflow:hidden;cursor:pointer;", " a{color:inherit;text-decoration:none;&:active{color:inherit;}}"], ({
|
|
22
|
-
theme,
|
|
23
|
-
$collapsible = false,
|
|
24
|
-
$type
|
|
25
|
-
}) => `
|
|
26
|
-
padding: 0;
|
|
27
|
-
padding-left: ${$collapsible ? 0 : theme.click.image.sm.size.width};
|
|
28
|
-
font: ${theme.click.sidebar.navigation.title.typography.default};
|
|
29
|
-
color: ${theme.click.sidebar[$type].navigation.title.color.default};
|
|
30
|
-
|
|
31
|
-
&:hover {
|
|
32
|
-
font: ${theme.click.sidebar.navigation.title.typography.hover};
|
|
33
|
-
color: ${theme.click.sidebar[$type].navigation.title.color.hover};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:active, &[data-state="open"], &[data-selected="true"] {
|
|
37
|
-
font: ${theme.click.sidebar.navigation.title.typography.active};
|
|
38
|
-
color: ${theme.click.sidebar[$type].navigation.title.color.active};
|
|
39
|
-
}
|
|
40
|
-
`);
|
|
41
53
|
|
|
42
54
|
exports.SidebarNavigationTitle = SidebarNavigationTitle;
|
|
43
55
|
exports.SidebarTitleWrapper = SidebarTitleWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/SidebarNavigationTitle/SidebarNavigationTitle.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/SidebarNavigationTitle/SidebarNavigationTitle.tsx"],"sourcesContent":["import {\n ComponentProps,\n ComponentPropsWithRef,\n ElementType,\n ReactNode,\n forwardRef,\n} from 'react';\nimport { cn, cva } from '@/lib/cva';\nimport { IconWrapper } from '@/components/Collapsible/IconWrapper';\nimport { SidebarNavigationTitleProps } from './SidebarNavigationTitle.types';\nimport styles from './SidebarNavigationTitle.module.css';\n\nconst wrapperVariants = cva(styles.wrapper, {\n variants: {\n type: {\n main: styles.wrapper_type_main,\n sqlSidebar: styles['wrapper_type_sql-sidebar'],\n },\n collapsible: { true: styles.wrapper_collapsible_true, false: '' },\n },\n defaultVariants: { type: 'main', collapsible: false },\n});\n\n// Polymorphic wrapper: SidebarCollapsibleTitle renders it `as={Collapsible.Trigger}`.\n// Same shape as the Container polymorphic component (src/components/Container).\nexport interface SidebarTitleWrapperProps<T extends ElementType = 'button'> {\n as?: T;\n $collapsible?: boolean;\n $type?: 'main' | 'sqlSidebar';\n}\n\ntype SidebarTitleWrapperComponent = <T extends ElementType = 'button'>(\n props: Omit<ComponentProps<T>, keyof SidebarTitleWrapperProps<T>> &\n SidebarTitleWrapperProps<T>\n) => ReactNode;\n\nconst _SidebarTitleWrapper = <T extends ElementType = 'button'>(\n {\n as,\n $collapsible = false,\n $type = 'main',\n className,\n ...props\n }: Omit<ComponentProps<T>, keyof SidebarTitleWrapperProps<T>> &\n SidebarTitleWrapperProps<T>,\n ref: ComponentPropsWithRef<T>['ref']\n) => {\n const Component = as ?? 'button';\n return (\n <Component\n ref={ref}\n {...props}\n className={cn(\n wrapperVariants({ type: $type, collapsible: $collapsible }),\n className\n )}\n />\n );\n};\n\nexport const SidebarTitleWrapper: SidebarTitleWrapperComponent =\n forwardRef(_SidebarTitleWrapper);\n\nexport const SidebarNavigationTitle = ({\n label,\n icon,\n iconDir,\n selected,\n type = 'main',\n ...props\n}: SidebarNavigationTitleProps) => {\n return (\n <SidebarTitleWrapper\n data-selected={selected}\n $type={type}\n {...props}\n >\n <IconWrapper\n icon={icon}\n iconDir={iconDir}\n >\n {label}\n </IconWrapper>\n </SidebarTitleWrapper>\n );\n};\n"],"names":["wrapperVariants","cva","styles","wrapper","variants","type","main","wrapper_type_main","sqlSidebar","collapsible","true","wrapper_collapsible_true","false","defaultVariants","_SidebarTitleWrapper","as","$collapsible","$type","className","props","ref","Component","cn","SidebarTitleWrapper","forwardRef","SidebarNavigationTitle","label","icon","iconDir","selected","jsx","IconWrapper"],"mappings":";;;;;;;;;;;AAYA,MAAMA,eAAAA,GAAkBC,0BAAAA,CAAIC,qCAAAA,CAAOC,OAAAA,EAAS;AAAA,EAC1CC,QAAAA,EAAU;AAAA,IACRC,IAAAA,EAAM;AAAA,MACJC,MAAMJ,qCAAAA,CAAOK,iBAAAA;AAAAA,MACbC,UAAAA,EAAYN,sCAAO,0BAA0B;AAAA,KAC/C;AAAA,IACAO,WAAAA,EAAa;AAAA,MAAEC,MAAMR,qCAAAA,CAAOS,wBAAAA;AAAAA,MAA0BC,KAAAA,EAAO;AAAA;AAAG,GAClE;AAAA,EACAC,eAAAA,EAAiB;AAAA,IAAER,IAAAA,EAAM,MAAA;AAAA,IAAQI,WAAAA,EAAa;AAAA;AAChD,CAAC,CAAA;AAeD,MAAMK,uBAAuB,CAC3B;AAAA,EACEC,EAAAA;AAAAA,EACAC,YAAAA,GAAe,KAAA;AAAA,EACfC,KAAAA,GAAQ,MAAA;AAAA,EACRC,SAAAA;AAAAA,EACA,GAAGC;AAEuB,CAAA,EAC5BC,GAAAA,KACG;AACH,EAAA,MAAMC,YAAYN,EAAAA,IAAM,QAAA;AACxB,EAAA,sCACG,SAAA,EAAA,EACC,GAAA,KACII,KAAAA,EACJ,SAAA,EAAWG,OACTtB,eAAAA,CAAgB;AAAA,IAAEK,IAAAA,EAAMY,KAAAA;AAAAA,IAAOR,WAAAA,EAAaO;AAAAA,GAAc,CAAA,EAC1DE,SACF,CAAA,EAAE,CAAA;AAGR,CAAA;AAEO,MAAMK,mBAAAA,GACXC,iBAAWV,oBAAoB;AAE1B,MAAMW,yBAAyBA,CAAC;AAAA,EACrCC,KAAAA;AAAAA,EACAC,IAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAxB,IAAAA,GAAO,MAAA;AAAA,EACP,GAAGc;AACwB,CAAA,KAAM;AACjC,EAAA,uBACEW,cAAA,CAAC,mBAAA,EAAA,EACC,eAAA,EAAeD,QAAAA,EACf,KAAA,EAAOxB,IAAAA,EACP,GAAIc,KAAAA,EAEJ,QAAA,kBAAAW,cAAA,CAACC,uBAAA,EAAA,EACC,IAAA,EACA,OAAA,EAECL,iBACH,CAAA,EACF,CAAA;AAEJ;;;;;"}
|