@plumile/ui 0.1.178 → 0.1.181
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/lib/esm/admin/organisms/admin_topbar/adminTopbar.css.js +2 -0
- package/lib/esm/atomic/atoms/button/button.css.js +0 -2
- package/lib/esm/atomic/molecules/markdown/components/MarkdownDelete.css.js +1 -0
- package/lib/esm/atomic/molecules/markdown/components/MarkdownSuperscript.css.js +0 -1
- package/lib/esm/atomic/molecules/tabs/Tabs.js +2 -2
- package/lib/esm/atomic/molecules/tabs/Tabs.js.map +1 -1
- package/lib/esm/node_modules/dompurify/dist/purify.es.js +300 -252
- package/lib/esm/node_modules/dompurify/dist/purify.es.js.map +1 -1
- package/lib/types/atomic/molecules/tabs/Tabs.d.ts +1 -1
- package/lib/types/atomic/molecules/tabs/Tabs.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
7
9
|
/* empty css */
|
|
8
10
|
//#region src/admin/organisms/admin_topbar/adminTopbar.css.ts
|
|
9
11
|
var e = "_1lo5q0p0 txvbqbfpn txvbqbh4x txvbqbhdy txvbqbv7x txvbqb19uf", t = "_1lo5q0p1 txvbqbfpn txvbqbey txvbqbheb txvbqbh7g txvbqbv7x", n = "_1lo5q0p2 txvbqbfpn txvbqbey txvbqbh7g txvbqbhdy txvbqbfvs txvbqbv7x txvbqb19uf", r = "_1lo5q0p3 txvbqbfqq txvbqbey txvbqbhdl txvbqblsh txvbqbh6d", i = "_1lo5q0p4 txvbqbfqq txvbqbey txvbqbjlr txvbqb1aao txvbqb1b9f";
|
|
@@ -10,7 +10,7 @@ var f = u, p = (e, t, n, r = !1) => t == null ? typeof e.isActive == "boolean" ?
|
|
|
10
10
|
let w = v.some((e) => e.to != null), T = b != null && !w, E = v.some((e) => typeof e.isActive == "boolean"), D = o({ variant: S });
|
|
11
11
|
y === "nav" && (D = e(D, _));
|
|
12
12
|
let O = v.map((e) => {
|
|
13
|
-
let { disabled: t, id: n, label: i,
|
|
13
|
+
let { disabled: t, id: n, label: i, preloadOnHover: a, to: o } = e, s = p(e, m, C, E), l = "default";
|
|
14
14
|
t ? l = "disabled" : s && (l = "active");
|
|
15
15
|
let u = r({
|
|
16
16
|
state: l,
|
|
@@ -26,7 +26,7 @@ var f = u, p = (e, t, n, r = !1) => t == null ? typeof e.isActive == "boolean" ?
|
|
|
26
26
|
"aria-disabled": d,
|
|
27
27
|
className: u,
|
|
28
28
|
to: o,
|
|
29
|
-
|
|
29
|
+
preloadOnHover: a,
|
|
30
30
|
tabIndex: e,
|
|
31
31
|
onClick: (e) => {
|
|
32
32
|
t && e.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","names":[],"sources":["../../../../../src/atomic/molecules/tabs/Tabs.tsx"],"sourcesContent":["import {\n type AnchorHTMLAttributes,\n type ComponentPropsWithoutRef,\n type HTMLAttributes,\n type JSX,\n type MouseEvent,\n type ReactNode,\n} from 'react';\nimport Link from '@plumile/router/routing/Link.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\n\nimport * as styles from './tabs.css.js';\nimport { cx } from '../../../theme/tools.js';\n\nexport type TabsSelectEvent = MouseEvent<HTMLButtonElement | HTMLAnchorElement>;\n\ntype LinkComponentProps = ComponentPropsWithoutRef<typeof Link>;\ntype RouterLinkProps = LinkComponentProps &\n AnchorHTMLAttributes<HTMLAnchorElement>;\nconst RouterLink = Link as unknown as (props: RouterLinkProps) => JSX.Element;\n\nexport type TabItem = {\n id: string;\n label: ReactNode;\n to?: LinkComponentProps['to'];\n
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":[],"sources":["../../../../../src/atomic/molecules/tabs/Tabs.tsx"],"sourcesContent":["import {\n type AnchorHTMLAttributes,\n type ComponentPropsWithoutRef,\n type HTMLAttributes,\n type JSX,\n type MouseEvent,\n type ReactNode,\n} from 'react';\nimport Link from '@plumile/router/routing/Link.js';\nimport useLocation from '@plumile/router/routing/useLocation.js';\n\nimport * as styles from './tabs.css.js';\nimport { cx } from '../../../theme/tools.js';\n\nexport type TabsSelectEvent = MouseEvent<HTMLButtonElement | HTMLAnchorElement>;\n\ntype LinkComponentProps = ComponentPropsWithoutRef<typeof Link>;\ntype RouterLinkProps = LinkComponentProps &\n AnchorHTMLAttributes<HTMLAnchorElement>;\nconst RouterLink = Link as unknown as (props: RouterLinkProps) => JSX.Element;\n\nexport type TabItem = {\n id: string;\n label: ReactNode;\n to?: LinkComponentProps['to'];\n preloadOnHover?: LinkComponentProps['preloadOnHover'];\n disabled?: boolean;\n isActive?: boolean;\n};\n\nexport type TabsVariant = 'line' | 'pill' | 'underline' | 'page';\n\nexport type TabsProps = {\n items: readonly TabItem[];\n activeId?: string;\n onChange?: (id: string) => void;\n ariaLabel?: string;\n children?: ReactNode;\n className?: string;\n layout?: 'nav' | 'content';\n panelClassName?: string;\n variant?: TabsVariant;\n};\n\nconst resolveItemIsActive = (\n item: TabItem,\n activeId: string | undefined,\n pathname: string | undefined,\n hasExplicitActiveItem = false,\n): boolean => {\n if (activeId != null) {\n return item.id === activeId;\n }\n\n if (typeof item.isActive === 'boolean') {\n return item.isActive;\n }\n\n if (hasExplicitActiveItem) {\n return false;\n }\n\n if (item.to != null && pathname != null) {\n return pathname === item.to;\n }\n\n return false;\n};\n\nexport const Tabs = (props: TabsProps): JSX.Element | null => {\n const {\n activeId,\n ariaLabel,\n children,\n className,\n items,\n layout = 'nav',\n onChange,\n panelClassName,\n variant = 'line',\n } = props;\n const { pathname } = useLocation();\n\n if (items.length === 0) {\n return null;\n }\n\n const hasNavigationItems = items.some((item) => {\n return item.to != null;\n });\n const isControlled = onChange != null && !hasNavigationItems;\n const hasExplicitActiveItem = items.some((item) => {\n return typeof item.isActive === 'boolean';\n });\n let rootClassName = styles.tabsRecipe({ variant });\n if (layout === 'nav') {\n rootClassName = cx(rootClassName, className);\n }\n\n const content = items.map((item) => {\n const { disabled, id, label, preloadOnHover, to } = item;\n const isActive = resolveItemIsActive(\n item,\n activeId,\n pathname,\n hasExplicitActiveItem,\n );\n\n type TabState = NonNullable<\n Parameters<typeof styles.tabRecipe>[0]\n >['state'];\n let tabState: TabState = 'default';\n if (disabled) {\n tabState = 'disabled';\n } else if (isActive) {\n tabState = 'active';\n }\n\n const tabClassName = styles.tabRecipe({ state: tabState, variant });\n let ariaDisabled: true | undefined;\n if (disabled) {\n ariaDisabled = true;\n }\n let ariaCurrent: 'page' | undefined;\n if (isActive && to != null) {\n ariaCurrent = 'page';\n }\n\n if (to != null) {\n let tabIndex: number | undefined;\n if (disabled) {\n tabIndex = -1;\n }\n\n const handleLinkClick = (event: MouseEvent<HTMLAnchorElement>) => {\n if (disabled) {\n event.preventDefault();\n }\n };\n\n return (\n <RouterLink\n key={id}\n exact\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n className={tabClassName}\n to={to}\n preloadOnHover={preloadOnHover}\n tabIndex={tabIndex}\n onClick={handleLinkClick}\n >\n {label}\n </RouterLink>\n );\n }\n\n if (onChange != null) {\n return (\n <button\n key={id}\n type=\"button\"\n role=\"tab\"\n aria-selected={isActive}\n aria-disabled={ariaDisabled}\n className={tabClassName}\n disabled={disabled}\n onClick={() => {\n if (!disabled) {\n onChange(id);\n }\n }}\n >\n {label}\n </button>\n );\n }\n\n let staticAriaCurrent: 'page' | undefined;\n if (isActive) {\n staticAriaCurrent = 'page';\n }\n\n return (\n <span\n key={id}\n aria-current={staticAriaCurrent}\n aria-disabled={ariaDisabled}\n className={tabClassName}\n >\n {label}\n </span>\n );\n });\n\n const renderRoot = (): JSX.Element => {\n if (isControlled) {\n return (\n <div className={rootClassName} role=\"tablist\" aria-label={ariaLabel}>\n {content}\n </div>\n );\n }\n\n if (hasNavigationItems) {\n return (\n <nav aria-label={ariaLabel} className={rootClassName}>\n {content}\n </nav>\n );\n }\n\n return <div className={rootClassName}>{content}</div>;\n };\n\n const nav = renderRoot();\n\n if (layout !== 'content') {\n return nav;\n }\n\n const wrapperProps: HTMLAttributes<HTMLDivElement> = {\n className: cx(styles.wrapper, className),\n };\n\n return (\n <div {...wrapperProps}>\n <div className={styles.tabsBar}>\n <div className={styles.tabsInner}>{nav}</div>\n </div>\n <div className={styles.panels}>\n <section role=\"tabpanel\" className={cx(styles.panel, panelClassName)}>\n {children}\n </section>\n </div>\n </div>\n );\n};\n\nexport const __test = {\n resolveItemIsActive,\n} as const;\n"],"mappings":";;;;;;AAmBA,IAAM,IAAa,GAyBb,KACJ,GACA,GACA,GACA,IAAwB,OAEpB,KAAY,OAIZ,OAAO,EAAK,YAAa,YACpB,EAAK,WAGV,IACK,KAGL,EAAK,MAAM,QAAQ,KAAY,OAC1B,MAAa,EAAK,KAGpB,KAfE,EAAK,OAAO,GAkBV,KAAQ,MAAyC;CAC5D,IAAM,EACJ,aACA,cACA,aACA,cACA,UACA,YAAS,OACT,aACA,mBACA,aAAU,WACR,GACE,EAAE,gBAAa,EAAY;CAEjC,IAAI,EAAM,WAAW,GACnB,OAAO;CAGT,IAAM,IAAqB,EAAM,MAAM,MAC9B,EAAK,MAAM,IACnB,GACK,IAAe,KAAY,QAAQ,CAAC,GACpC,IAAwB,EAAM,MAAM,MACjC,OAAO,EAAK,YAAa,SACjC,GACG,IAAgB,EAAkB,EAAE,WAAQ,CAAC;CACjD,AAAI,MAAW,UACb,IAAgB,EAAG,GAAe,CAAS;CAG7C,IAAM,IAAU,EAAM,KAAK,MAAS;EAClC,IAAM,EAAE,aAAU,OAAI,UAAO,mBAAgB,UAAO,GAC9C,IAAW,EACf,GACA,GACA,GACA,CACF,GAKI,IAAqB;EACzB,AAAI,IACF,IAAW,aACF,MACT,IAAW;EAGb,IAAM,IAAe,EAAiB;GAAE,OAAO;GAAU;EAAQ,CAAC,GAC9D;EACJ,AAAI,MACF,IAAe;EAEjB,IAAI;EAKJ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