@sybilion/uilib 1.3.84 → 1.3.85

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,7 +1,7 @@
1
1
  import styleInject from 'style-inject';
2
2
 
3
- var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.ChatPrompt_root__5G5bq{align-items:stretch;display:flex;flex-direction:column;gap:var(--p-2);padding:var(--p-3);position:relative}.ChatPrompt_composer__H3c3N{align-items:flex-end;display:flex;flex-direction:row;gap:var(--p-3);position:relative;width:100%}.ChatPrompt_fileInput__xdgPn{display:none}.ChatPrompt_attachButton__gi-qF{align-self:flex-end;flex-shrink:0}.ChatPrompt_editorWrap__Q7gat{align-self:stretch;flex:1;min-width:0}.ChatPrompt_editorMount__Phh4D{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;display:flex;flex:1;flex-direction:column;max-height:200px;min-height:40px;min-width:0;padding:0!important}.ChatPrompt_editorMount__Phh4D:focus-within{box-shadow:none!important}.ChatPrompt_editorMount__Phh4D .ProseMirror{border:none!important;box-shadow:none!important;flex:1;margin:0;max-height:200px!important;min-height:40px!important;outline:none!important;overflow-x:hidden!important;overflow-y:auto!important;padding:var(--p-2) 0 0!important;resize:none!important;white-space:pre-wrap;word-break:break-word}.ChatPrompt_editorMount__Phh4D .ProseMirror p.is-empty.is-editor-empty:before{color:var(--muted-foreground);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ChatPrompt_editorMount__Phh4D .ProseMirror .chat-prompt-command-chip,.ChatPrompt_editorMount__Phh4D .ProseMirror .slash-mention{align-items:center;background:var(--muted);border-radius:var(--radius-sm);display:inline-flex;font-size:.875em;line-height:1.4;padding:0 var(--p-1);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:baseline;white-space:nowrap}.ChatPrompt_editorMount__Phh4D .ProseMirror .chat-prompt-command-chip{color:var(--foreground)}.ChatPrompt_submitColumn__0rY1R{align-items:center;display:flex;flex-direction:column;flex-shrink:0;justify-content:flex-end;margin-top:-4px}.ChatPrompt_submitColumn__0rY1R>button:focus{box-shadow:0 0 0 2px var(--brand-color-500)!important}.ChatPrompt_submitColumn__0rY1R>button:first-child{border:none;position:relative;transition:all .2s}.ChatPrompt_submitColumn__0rY1R>button:first-child:focus{transform:scale(1.2)}.ChatPrompt_submitColumn__0rY1R>button:first-child:before{bottom:-100%;content:\"\";left:-100%;position:absolute;right:-100%;top:-100%}.ChatPrompt_attachments__KG-fG{display:flex;flex-wrap:wrap;gap:var(--p-2);margin-bottom:var(--p-2)}.ChatPrompt_attachmentItem__QJk7J{flex:1 1 300px;max-width:300px;min-width:0}";
4
- var S = {"root":"ChatPrompt_root__5G5bq","composer":"ChatPrompt_composer__H3c3N","fileInput":"ChatPrompt_fileInput__xdgPn","attachButton":"ChatPrompt_attachButton__gi-qF","editorWrap":"ChatPrompt_editorWrap__Q7gat","editorMount":"ChatPrompt_editorMount__Phh4D","submitColumn":"ChatPrompt_submitColumn__0rY1R","attachments":"ChatPrompt_attachments__KG-fG","attachmentItem":"ChatPrompt_attachmentItem__QJk7J"};
3
+ var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.ChatPrompt_root__5G5bq{align-items:stretch;display:flex;flex-direction:column;gap:var(--p-2);padding:var(--p-3);position:relative}.ChatPrompt_composer__H3c3N{align-items:flex-end;display:flex;flex-direction:row;gap:var(--p-3);position:relative;width:100%}.ChatPrompt_fileInput__xdgPn{display:none}.ChatPrompt_attachButton__gi-qF,.ChatPrompt_submitButton__gvhDN{position:relative;top:-2px}.ChatPrompt_attachButton__gi-qF{align-self:flex-end;flex-shrink:0}.ChatPrompt_editorWrap__Q7gat{align-self:stretch;flex:1;min-width:0}.ChatPrompt_editorMount__Phh4D{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;display:flex;flex:1;flex-direction:column;max-height:200px;min-height:40px;min-width:0;padding:0!important}.ChatPrompt_editorMount__Phh4D:focus-within{box-shadow:none!important}.ChatPrompt_editorMount__Phh4D .ProseMirror{border:none!important;box-shadow:none!important;flex:1;margin:0;max-height:200px!important;min-height:40px!important;outline:none!important;overflow-x:hidden!important;overflow-y:auto!important;padding:var(--p-2) 0 0!important;resize:none!important;white-space:pre-wrap;word-break:break-word}.ChatPrompt_editorMount__Phh4D .ProseMirror p.is-empty.is-editor-empty:before{color:var(--muted-foreground);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ChatPrompt_editorMount__Phh4D .ProseMirror .chat-prompt-command-chip,.ChatPrompt_editorMount__Phh4D .ProseMirror .slash-mention{align-items:center;background:var(--muted);border-radius:var(--radius-sm);display:inline-flex;font-size:.875em;line-height:1.4;padding:0 var(--p-1);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:baseline;white-space:nowrap}.ChatPrompt_editorMount__Phh4D .ProseMirror .chat-prompt-command-chip{color:var(--foreground)}.ChatPrompt_submitColumn__0rY1R{align-items:center;display:flex;flex-direction:column;flex-shrink:0;justify-content:flex-end}.ChatPrompt_submitColumn__0rY1R>button:focus{box-shadow:0 0 0 2px var(--brand-color-500)!important}.ChatPrompt_submitColumn__0rY1R>button:first-child{border:none;position:relative;transition:all .2s}.ChatPrompt_submitColumn__0rY1R>button:first-child:focus{transform:scale(1.2)}.ChatPrompt_submitColumn__0rY1R>button:first-child:before{bottom:-100%;content:\"\";left:-100%;position:absolute;right:-100%;top:-100%}.ChatPrompt_attachments__KG-fG{display:flex;flex-wrap:wrap;gap:var(--p-2);margin-bottom:var(--p-2)}.ChatPrompt_attachmentItem__QJk7J{flex:1 1 300px;max-width:300px;min-width:0}";
4
+ var S = {"root":"ChatPrompt_root__5G5bq","composer":"ChatPrompt_composer__H3c3N","fileInput":"ChatPrompt_fileInput__xdgPn","attachButton":"ChatPrompt_attachButton__gi-qF","submitButton":"ChatPrompt_submitButton__gvhDN","editorWrap":"ChatPrompt_editorWrap__Q7gat","editorMount":"ChatPrompt_editorMount__Phh4D","submitColumn":"ChatPrompt_submitColumn__0rY1R","attachments":"ChatPrompt_attachments__KG-fG","attachmentItem":"ChatPrompt_attachmentItem__QJk7J"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { S as default };
@@ -3,7 +3,6 @@ import cn from 'classnames';
3
3
  import { CsvIcon } from '../../icons/CsvIcon/CsvIcon.js';
4
4
  import { CardHeader, CardAction } from '../Card/Card.js';
5
5
  import { XIcon, FileTextIcon } from '@phosphor-icons/react';
6
- import { LayoutDashboard } from 'lucide-react';
7
6
  import S from './FileChip.styl.js';
8
7
 
9
8
  const FORMAT_ICON_SIZE = 32;
@@ -11,16 +10,13 @@ function FormatIcon({ format }) {
11
10
  if (format === 'csv') {
12
11
  return jsx(CsvIcon, { size: FORMAT_ICON_SIZE });
13
12
  }
14
- if (format === 'dashboard') {
15
- return (jsx(LayoutDashboard, { size: FORMAT_ICON_SIZE, "aria-hidden": true, style: { color: 'var(--muted-foreground)' } }));
16
- }
17
13
  return (jsx(FileTextIcon, { size: FORMAT_ICON_SIZE, "aria-hidden": true, style: { color: 'var(--muted-foreground)' } }));
18
14
  }
19
- function FileChipHeader({ name, format, hint, onRemove, }) {
20
- return (jsx(CardHeader, { className: S.header, icon: jsx(FormatIcon, { format: format }), title: name, description: hint, titleClassName: S.title, descriptionClassName: S.hint, tooltipProps: { maxWidth: 400 }, children: onRemove ? (jsx(CardAction, { children: jsx("button", { type: "button", className: S.remove, "aria-label": `Remove ${name}`, onClick: onRemove, children: jsx(XIcon, { size: 14, "aria-hidden": true }) }) })) : null }));
15
+ function FileChipHeader({ name, format, hint, icon, onRemove, }) {
16
+ return (jsx(CardHeader, { className: S.header, icon: icon ?? jsx(FormatIcon, { format: format }), title: name, description: hint, titleClassName: S.title, descriptionClassName: S.hint, tooltipProps: { maxWidth: 400 }, children: onRemove ? (jsx(CardAction, { children: jsx("button", { type: "button", className: S.remove, "aria-label": `Remove ${name}`, onClick: onRemove, children: jsx(XIcon, { size: 14, "aria-hidden": true }) }) })) : null }));
21
17
  }
22
- function FileChip({ name, format, hint, onClick, onRemove, className, }) {
23
- const header = (jsx(FileChipHeader, { name: name, format: format, hint: hint, onRemove: onRemove }));
18
+ function FileChip({ name, format, hint, icon, onClick, onRemove, className, }) {
19
+ const header = (jsx(FileChipHeader, { name: name, format: format, hint: hint, icon: icon, onRemove: onRemove }));
24
20
  if (onClick) {
25
21
  return (jsx("button", { type: "button", className: cn(S.root, S.interactive, className), "aria-label": `${hint}: ${name}`, onClick: onClick, children: header }));
26
22
  }
@@ -1,2 +1,2 @@
1
1
  import type { FileChipProps } from './FileChip.types';
2
- export declare function FileChip({ name, format, hint, onClick, onRemove, className, }: FileChipProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function FileChip({ name, format, hint, icon, onClick, onRemove, className, }: FileChipProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
- export type FileChipFormat = 'csv' | 'pdf' | 'text' | 'dashboard';
1
+ export type FileChipFormat = 'csv' | 'pdf' | 'text';
2
2
  export type FileChipProps = {
3
3
  name: string;
4
4
  format: FileChipFormat;
5
5
  hint: string;
6
+ icon?: React.ReactNode;
6
7
  onClick?: () => void;
7
8
  onRemove?: () => void;
8
9
  disabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybilion/uilib",
3
- "version": "1.3.84",
3
+ "version": "1.3.85",
4
4
  "description": "Sybilion Design System — React UI components (Webpack + Stylus)",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -21,6 +21,11 @@ INPUT_MAX_HEIGHT = 200px
21
21
  .fileInput
22
22
  display none
23
23
 
24
+ .attachButton
25
+ .submitButton
26
+ position relative
27
+ top -2px
28
+
24
29
  .attachButton
25
30
  flex-shrink 0
26
31
  align-self flex-end
@@ -99,7 +104,6 @@ INPUT_MAX_HEIGHT = 200px
99
104
  flex-shrink 0
100
105
  align-items center
101
106
  justify-content flex-end
102
- margin-top -4px
103
107
 
104
108
  & > button:focus
105
109
  box-shadow 0 0 0 2px var(--brand-color-500) !important
@@ -9,6 +9,7 @@ interface CssExports {
9
9
  'editorWrap': string;
10
10
  'fileInput': string;
11
11
  'root': string;
12
+ 'submitButton': string;
12
13
  'submitColumn': string;
13
14
  }
14
15
  export const cssExports: CssExports;
@@ -3,7 +3,6 @@ import cn from 'classnames';
3
3
  import { CsvIcon } from '#uilib/components/icons/CsvIcon/CsvIcon';
4
4
  import { CardAction, CardHeader } from '#uilib/components/ui/Card';
5
5
  import { FileTextIcon, XIcon } from '@phosphor-icons/react';
6
- import { LayoutDashboard } from 'lucide-react';
7
6
 
8
7
  import S from './FileChip.styl';
9
8
  import type { FileChipFormat, FileChipProps } from './FileChip.types';
@@ -15,16 +14,6 @@ function FormatIcon({ format }: { format: FileChipFormat }) {
15
14
  return <CsvIcon size={FORMAT_ICON_SIZE} />;
16
15
  }
17
16
 
18
- if (format === 'dashboard') {
19
- return (
20
- <LayoutDashboard
21
- size={FORMAT_ICON_SIZE}
22
- aria-hidden
23
- style={{ color: 'var(--muted-foreground)' }}
24
- />
25
- );
26
- }
27
-
28
17
  return (
29
18
  <FileTextIcon
30
19
  size={FORMAT_ICON_SIZE}
@@ -38,12 +27,16 @@ function FileChipHeader({
38
27
  name,
39
28
  format,
40
29
  hint,
30
+ icon,
41
31
  onRemove,
42
- }: Pick<FileChipProps, 'name' | 'format' | 'hint' | 'onRemove' | 'disabled'>) {
32
+ }: Pick<
33
+ FileChipProps,
34
+ 'name' | 'format' | 'hint' | 'icon' | 'onRemove' | 'disabled'
35
+ >) {
43
36
  return (
44
37
  <CardHeader
45
38
  className={S.header}
46
- icon={<FormatIcon format={format} />}
39
+ icon={icon ?? <FormatIcon format={format} />}
47
40
  title={name}
48
41
  description={hint}
49
42
  titleClassName={S.title}
@@ -70,6 +63,7 @@ export function FileChip({
70
63
  name,
71
64
  format,
72
65
  hint,
66
+ icon,
73
67
  onClick,
74
68
  onRemove,
75
69
  className,
@@ -79,6 +73,7 @@ export function FileChip({
79
73
  name={name}
80
74
  format={format}
81
75
  hint={hint}
76
+ icon={icon}
82
77
  onRemove={onRemove}
83
78
  />
84
79
  );
@@ -1,9 +1,10 @@
1
- export type FileChipFormat = 'csv' | 'pdf' | 'text' | 'dashboard';
1
+ export type FileChipFormat = 'csv' | 'pdf' | 'text';
2
2
 
3
3
  export type FileChipProps = {
4
4
  name: string;
5
5
  format: FileChipFormat;
6
6
  hint: string;
7
+ icon?: React.ReactNode;
7
8
  onClick?: () => void;
8
9
  onRemove?: () => void;
9
10
  disabled?: boolean;