@sybilion/uilib 1.3.16 → 1.3.18

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.
@@ -1,10 +1,10 @@
1
- import { jsx, Fragment } from 'react/jsx-runtime';
1
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import cn from 'classnames';
3
3
  import { useState, useCallback, useEffect } from 'react';
4
4
  import { useIsTouchDevice } from '../../../hooks/useIsTouchDevice.js';
5
5
  import S from './InteractionOverlay.styl.js';
6
6
 
7
- function InteractionOverlay({ className, children, }) {
7
+ function InteractionOverlay({ className, children, message = 'Touch to interact', }) {
8
8
  const isTouchDevice = useIsTouchDevice();
9
9
  const [isVisible, setIsVisible] = useState(true);
10
10
  const handleClick = useCallback(() => {
@@ -29,7 +29,7 @@ function InteractionOverlay({ className, children, }) {
29
29
  if (!isTouchDevice) {
30
30
  return jsx(Fragment, { children: children });
31
31
  }
32
- return (jsx("div", { className: cn(S.root, !isVisible && S.hidden, className), onClick: handleClick, children: children }));
32
+ return (jsxs("div", { className: cn(S.root, !isVisible && S.hidden, className), children: [children, jsx("button", { type: "button", className: S.overlay, onClick: handleClick, "aria-label": message, children: jsx("span", { className: S.message, children: message }) })] }));
33
33
  }
34
34
 
35
35
  export { InteractionOverlay };
@@ -1,7 +1,7 @@
1
1
  import styleInject from 'style-inject';
2
2
 
3
- var css_248z = ".InteractionOverlay_root__9FV58{inset:0;opacity:.7;pointer-events:auto;position:relative;transition:opacity .2s ease-out}.InteractionOverlay_root__9FV58:after{content:\"\";height:100%;inset:0;position:absolute;touch-action:manipulation;width:100%;z-index:4}.InteractionOverlay_root__9FV58.InteractionOverlay_hidden__NRlgG{opacity:1;pointer-events:none}";
4
- var S = {"root":"InteractionOverlay_root__9FV58","hidden":"InteractionOverlay_hidden__NRlgG"};
3
+ var css_248z = ".InteractionOverlay_root__9FV58{position:relative}.InteractionOverlay_overlay__Nwawr{background:transparent;border:none;box-shadow:inset 0 0 80px 40px var(--overlay-background-color);cursor:pointer;inset:0;margin:0;padding:0;position:absolute;touch-action:manipulation;transition:box-shadow .2s ease-out;z-index:4}.InteractionOverlay_hidden__NRlgG .InteractionOverlay_overlay__Nwawr{box-shadow:inset 0 0 0 0 var(--overlay-background-color);pointer-events:none}.InteractionOverlay_message__oCuPR{backdrop-filter:blur(10px);background-color:color-mix(in srgb,var(--overlay-background-color) 80%,transparent);border:1px solid color-mix(in srgb,var(--foreground) 14%,transparent);border-radius:9999px;box-shadow:0 0 24px 10px var(--overlay-background-color),0 0 0 1px color-mix(in srgb,var(--overlay-background-color) 40%,transparent);color:var(--foreground);font-size:.875rem;font-weight:500;left:50%;line-height:1.25;padding:var(--p-3) var(--p-5);pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);transition:.2s ease-out;transition-property:transform,opacity;white-space:nowrap;z-index:1}.InteractionOverlay_hidden__NRlgG .InteractionOverlay_message__oCuPR{opacity:0;transform:translate(-50%,-50%) scale(.3)}:root{--overlay-background-color:var(--page-color)}";
4
+ var S = {"root":"InteractionOverlay_root__9FV58","overlay":"InteractionOverlay_overlay__Nwawr","hidden":"InteractionOverlay_hidden__NRlgG","message":"InteractionOverlay_message__oCuPR"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { S as default };
@@ -1,15 +1,12 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import cn from 'classnames';
3
3
  import S from './Logo.styl.js';
4
+ import LogoMarkSvg from './logo.svg.js';
4
5
 
5
- /**
6
- * Public URL for the Sybilion logo in standalone apps. Copy `@sybilion/uilib/logo.svg`
7
- * to `public/logo.svg` (Sybilion app template README documents postinstall copies).
8
- * Same path as the favicon `<link href>`.
9
- */
10
- const SYBILION_STANDALONE_LOGO_PUBLIC_URL = '/logo.svg';
11
6
  function Logo({ showText = true, size = 'md', className, ...props }) {
12
- return (jsxs("div", { className: cn(S.root, S[size], className), ...props, children: [jsx("img", { src: SYBILION_STANDALONE_LOGO_PUBLIC_URL, alt: showText ? '' : 'Sybilion', className: S.icon, ...(showText ? { 'aria-hidden': true } : {}) }), showText && jsx("span", { className: S.text, children: "Sybilion" })] }));
7
+ return (jsxs("div", { className: cn(S.root, S[size], className), ...props, children: [jsx(LogoMarkSvg, { className: S.icon, ...(showText
8
+ ? { 'aria-hidden': true }
9
+ : { 'aria-label': 'Sybilion', role: 'img' }) }), showText && jsx("span", { className: S.text, children: "Sybilion" })] }));
13
10
  }
14
11
 
15
- export { Logo, SYBILION_STANDALONE_LOGO_PUBLIC_URL };
12
+ export { Logo, LogoMarkSvg as LogoMark };
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+
3
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
+ var SvgLogo = function SvgLogo(props) {
5
+ return /*#__PURE__*/React.createElement("svg", _extends({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ viewBox: "0 0 24 24",
8
+ fill: "none"
9
+ }, props), /*#__PURE__*/React.createElement("path", {
10
+ fill: "#C259FF",
11
+ d: "M13.43 24.023h-2.836v-2.836h2.836zm-2.835-2.844H5.63v-2.74h4.965Zm10.527-2.74h-2.726v2.74h-4.965v-2.74h4.952v-4.965h2.74zm-15.5 0h-2.74v-4.965h2.74ZM2.87 13.462H.034v-2.836H2.87Zm21.096 0H21.13v-2.836h2.836zM5.617 10.635h-2.74V5.669h2.74zm15.505 0h-2.74V5.669h2.74zM10.588 2.927v2.74H5.623v-2.74Zm2.842 0h4.96v2.74h-4.966v-2.74h-2.83V.09h2.836z",
12
+ style: {
13
+ strokeWidth: 0.13252
14
+ }
15
+ }));
16
+ };
17
+ var LogoMarkSvg = SvgLogo;
18
+
19
+ export { LogoMarkSvg as default };
package/dist/esm/index.js CHANGED
@@ -119,3 +119,4 @@ export { ChartTooltipContent } from './components/ui/Chart/components/ChartToolt
119
119
  export { ChartLegendContent } from './components/ui/Chart/components/ChartLegendContent.js';
120
120
  export { BaseChartWrapper } from './components/ui/Chart/components/BaseChartWrapper.js';
121
121
  export { default as DialogStyles } from './components/ui/Dialog/Dialog.styl.js';
122
+ export { default as LogoMark } from './components/ui/Logo/logo.svg.js';
@@ -1,6 +1,7 @@
1
1
  interface InteractionOverlayProps {
2
2
  className?: string;
3
3
  children?: React.ReactNode;
4
+ message?: string;
4
5
  }
5
- export declare function InteractionOverlay({ className, children, }: InteractionOverlayProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function InteractionOverlay({ className, children, message, }: InteractionOverlayProps): import("react/jsx-runtime").JSX.Element;
6
7
  export {};
@@ -1,7 +1,9 @@
1
1
  import type { LogoProps } from './Logo.types';
2
+ import LogoMarkSvg from './logo.svg';
3
+ export { LogoMarkSvg as LogoMark };
2
4
  /**
3
- * Public URL for the Sybilion logo in standalone apps. Copy `@sybilion/uilib/logo.svg`
4
- * to `public/logo.svg` (Sybilion app template README documents postinstall copies).
5
+ * Public URL for standalone apps. Copy `@sybilion/uilib/logo.svg` (Logo component asset)
6
+ * to `public/logo.svg` (app template README documents postinstall copies).
5
7
  * Same path as the favicon `<link href>`.
6
8
  */
7
9
  export declare const SYBILION_STANDALONE_LOGO_PUBLIC_URL: "/logo.svg";
@@ -1,2 +1,2 @@
1
- export { Logo } from './Logo';
1
+ export { Logo, LogoMark } from './Logo';
2
2
  export type { LogoProps, LogoSize } from './Logo.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybilion/uilib",
3
- "version": "1.3.16",
3
+ "version": "1.3.18",
4
4
  "description": "Sybilion Design System — React UI components (Webpack + Stylus)",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -35,7 +35,7 @@
35
35
  "default": "./dist/esm/hooks/index.js"
36
36
  },
37
37
  "./src/*": "./src/*",
38
- "./logo.svg": "./src/assets/logo.svg"
38
+ "./logo.svg": "./src/components/ui/Logo/logo.svg"
39
39
  },
40
40
  "files": [
41
41
  "assets",
@@ -52,6 +52,7 @@
52
52
  "tests:watch": "jest --watch",
53
53
  "ts": "tsc --noEmit",
54
54
  "dev": "NODE_OPTIONS='--loader ts-node/esm' NODE_ENV=development webpack-dev-server --mode=development --config ./src/docs/config/webpack.config.js --progress",
55
+ "prebuild": "cp src/components/ui/Logo/logo.svg assets/logo.svg",
55
56
  "build": "rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript",
56
57
  "build:watch": "yarn build --watch",
57
58
  "build:compress": "COMPRESS=true yarn build",
@@ -1,19 +1,50 @@
1
1
  .root
2
2
  position relative
3
- inset 0
4
- opacity 0.7
5
- transition opacity 200ms ease-out
6
- pointer-events auto
7
3
 
8
- &::after
9
- content ''
10
- position absolute
11
- inset 0
12
- width 100%
13
- height 100%
14
- z-index 4
15
- touch-action manipulation
4
+ .overlay
5
+ position absolute
6
+ inset 0
7
+ z-index 4
8
+ border none
9
+ padding 0
10
+ margin 0
11
+ cursor pointer
12
+ touch-action manipulation
13
+ background transparent
14
+ box-shadow inset 0 0 80px 40px var(--overlay-background-color)
15
+ transition box-shadow 200ms ease-out
16
16
 
17
- &.hidden
18
- opacity 1
17
+ .hidden &
18
+ box-shadow inset 0 0 0 0 var(--overlay-background-color)
19
19
  pointer-events none
20
+
21
+ .message
22
+ position absolute
23
+ top 50%
24
+ left 50%
25
+ transform translate(-50%, -50%)
26
+ pointer-events none
27
+ z-index 1
28
+ font-size 0.875rem
29
+ font-weight 500
30
+ line-height 1.25
31
+ color var(--foreground)
32
+ white-space nowrap
33
+ padding var(--p-3) var(--p-5)
34
+ border-radius 9999px
35
+ border 1px solid unquote('color-mix(in srgb, var(--foreground) 14%, transparent)')
36
+ background-color unquote('color-mix(in srgb, var(--overlay-background-color) 80%, transparent)')
37
+ backdrop-filter blur(10px)
38
+ box-shadow \
39
+ 0 0 24px 10px var(--overlay-background-color), \
40
+ 0 0 0 1px unquote('color-mix(in srgb, var(--overlay-background-color) 40%, transparent)')
41
+ transition 200ms ease-out
42
+ transition-property transform, opacity
43
+
44
+ .hidden &
45
+ transform translate(-50%, -50%) scale(.3)
46
+ opacity 0
47
+
48
+
49
+ :global(:root)
50
+ --overlay-background-color var(--page-color)
@@ -2,6 +2,8 @@
2
2
  // Please do not change this file!
3
3
  interface CssExports {
4
4
  'hidden': string;
5
+ 'message': string;
6
+ 'overlay': string;
5
7
  'root': string;
6
8
  }
7
9
  export const cssExports: CssExports;
@@ -8,11 +8,13 @@ import S from './InteractionOverlay.styl';
8
8
  interface InteractionOverlayProps {
9
9
  className?: string;
10
10
  children?: React.ReactNode;
11
+ message?: string;
11
12
  }
12
13
 
13
14
  export function InteractionOverlay({
14
15
  className,
15
16
  children,
17
+ message = 'Touch to interact',
16
18
  }: InteractionOverlayProps) {
17
19
  const isTouchDevice = useIsTouchDevice();
18
20
  const [isVisible, setIsVisible] = useState(true);
@@ -45,11 +47,16 @@ export function InteractionOverlay({
45
47
  }
46
48
 
47
49
  return (
48
- <div
49
- className={cn(S.root, !isVisible && S.hidden, className)}
50
- onClick={handleClick}
51
- >
50
+ <div className={cn(S.root, !isVisible && S.hidden, className)}>
52
51
  {children}
52
+ <button
53
+ type="button"
54
+ className={S.overlay}
55
+ onClick={handleClick}
56
+ aria-label={message}
57
+ >
58
+ <span className={S.message}>{message}</span>
59
+ </button>
53
60
  </div>
54
61
  );
55
62
  }
@@ -2,10 +2,13 @@ import cn from 'classnames';
2
2
 
3
3
  import S from './Logo.styl';
4
4
  import type { LogoProps } from './Logo.types';
5
+ import LogoMarkSvg from './logo.svg';
6
+
7
+ export { LogoMarkSvg as LogoMark };
5
8
 
6
9
  /**
7
- * Public URL for the Sybilion logo in standalone apps. Copy `@sybilion/uilib/logo.svg`
8
- * to `public/logo.svg` (Sybilion app template README documents postinstall copies).
10
+ * Public URL for standalone apps. Copy `@sybilion/uilib/logo.svg` (Logo component asset)
11
+ * to `public/logo.svg` (app template README documents postinstall copies).
9
12
  * Same path as the favicon `<link href>`.
10
13
  */
11
14
  export const SYBILION_STANDALONE_LOGO_PUBLIC_URL = '/logo.svg' as const;
@@ -18,11 +21,11 @@ export function Logo({
18
21
  }: LogoProps) {
19
22
  return (
20
23
  <div className={cn(S.root, S[size], className)} {...props}>
21
- <img
22
- src={SYBILION_STANDALONE_LOGO_PUBLIC_URL}
23
- alt={showText ? '' : 'Sybilion'}
24
+ <LogoMarkSvg
24
25
  className={S.icon}
25
- {...(showText ? { 'aria-hidden': true } : {})}
26
+ {...(showText
27
+ ? { 'aria-hidden': true }
28
+ : { 'aria-label': 'Sybilion', role: 'img' })}
26
29
  />
27
30
  {showText && <span className={S.text}>Sybilion</span>}
28
31
  </div>
@@ -1,5 +1,5 @@
1
1
  // Export main component
2
- export { Logo } from './Logo';
2
+ export { Logo, LogoMark } from './Logo';
3
3
 
4
4
  // Export types that external components might need
5
5
  export type { LogoProps, LogoSize } from './Logo.types';
@@ -1,3 +1,3 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
2
- <path fill="#59f0ff" d="M13.43 24.023h-2.836v-2.836h2.836zm-2.835-2.844H5.63v-2.74h4.965Zm10.527-2.74h-2.726v2.74h-4.965v-2.74h4.952v-4.965h2.74zm-15.5 0h-2.74v-4.965h2.74ZM2.87 13.462H.034v-2.836H2.87Zm21.096 0H21.13v-2.836h2.836zM5.617 10.635h-2.74V5.669h2.74zm15.505 0h-2.74V5.669h2.74zM10.588 2.927v2.74H5.623v-2.74Zm2.842 0h4.96v2.74h-4.966v-2.74h-2.83V.09h2.836z" style="stroke-width:.13252" />
2
+ <path fill="#C259FF" d="M13.43 24.023h-2.836v-2.836h2.836zm-2.835-2.844H5.63v-2.74h4.965Zm10.527-2.74h-2.726v2.74h-4.965v-2.74h4.952v-4.965h2.74zm-15.5 0h-2.74v-4.965h2.74ZM2.87 13.462H.034v-2.836H2.87Zm21.096 0H21.13v-2.836h2.836zM5.617 10.635h-2.74V5.669h2.74zm15.505 0h-2.74V5.669h2.74zM10.588 2.927v2.74H5.623v-2.74Zm2.842 0h4.96v2.74h-4.966v-2.74h-2.83V.09h2.836z" style="stroke-width:.13252" />
3
3
  </svg>
@@ -1,6 +1,7 @@
1
1
  import { Outlet, useLocation, useNavigate } from 'react-router-dom';
2
2
 
3
3
  import { AppHeaderHost } from '#uilib/components/ui/AppHeader';
4
+ import { LogoMark } from '#uilib/components/ui/Logo';
4
5
  import { AppShell, AppShellMainContent } from '#uilib/components/ui/Page';
5
6
  import { PageFooter } from '#uilib/components/ui/Page/PageFooter/PageFooter';
6
7
  import { PageScroll } from '#uilib/components/ui/Page/PageScroll/PageScroll';
@@ -8,7 +9,6 @@ import { SybilionAppHeader } from '#uilib/components/widgets/SybilionAppHeader';
8
9
  import { ThemeToggle } from '#uilib/docs/App/ThemeToggle';
9
10
  import { DocsSidebar } from '#uilib/docs/components/DocsSidebar/DocsSidebar';
10
11
 
11
- import LogoSvg from '../../assets/logo.svg';
12
12
  import S from './DocsShell.styl';
13
13
 
14
14
  export function DocsShell() {
@@ -24,7 +24,7 @@ export function DocsShell() {
24
24
  header={<AppHeaderHost />}
25
25
  footer={
26
26
  <PageFooter
27
- logo={<LogoSvg />}
27
+ logo={<LogoMark />}
28
28
  versionLink="/releases"
29
29
  versionLabel="1.0.0-docs"
30
30
  />
@@ -20,7 +20,7 @@ const FaviconWebpackPlugin = require('favicons-webpack-plugin');
20
20
  const pkg = require('../../../package.json');
21
21
 
22
22
  const themeStyl = pathResolve(paths.src, 'theme.styl');
23
- const logoSvgPath = pathResolve(paths.assets, 'logo.svg');
23
+ const logoSvgPath = pathResolve(paths.src, 'components/ui/Logo/logo.svg');
24
24
 
25
25
  /** GitHub Pages project sites live at /<repo>/; set PUBLIC_PATH=/repo-name/ for production deploy. */
26
26
  function normalizePublicPath(raw) {
@@ -211,6 +211,11 @@ export default (env, argv) => {
211
211
  to: paths.build,
212
212
  noErrorOnMissing: true,
213
213
  },
214
+ {
215
+ from: logoSvgPath,
216
+ to: `${paths.assets}/logo.svg`,
217
+ noErrorOnMissing: true,
218
+ },
214
219
  ],
215
220
  }),
216
221