@attrus-ds/core 1.0.13 → 1.0.14
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/css/components/buttons.css +46 -15
- package/dist/css/components/callout.css +45 -8
- package/dist/css/components/combobox.css +36 -23
- package/dist/css/components/inputs.css +55 -22
- package/dist/css/components/overlays.css +1 -1
- package/dist/css/components/primitives.css +68 -0
- package/dist/css/components/sidebar.css +33 -0
- package/dist/css/components/smart-search.css +56 -23
- package/dist/css/components/status-pills.css +6 -6
- package/dist/css/components/table.css +602 -36
- package/dist/css/components/tabs.css +1 -0
- package/dist/css/components/toggle-chip.css +2 -2
- package/dist/css/components/topbar.css +180 -20
- package/dist/css/tokens.css +50 -10
- package/dist/react/Button/Button.d.ts +10 -2
- package/dist/react/Button/Button.tsx +12 -4
- package/dist/react/Combobox/Combobox.d.ts +5 -0
- package/dist/react/Combobox/Combobox.tsx +26 -4
- package/dist/react/DataTable/DataTable.d.ts +91 -0
- package/dist/react/DataTable/DataTable.tsx +413 -35
- package/dist/react/SearchPill/SearchPill.d.ts +3 -0
- package/dist/react/SearchPill/SearchPill.tsx +6 -1
- package/dist/react/SmartSearch/SmartSearch.d.ts +4 -0
- package/dist/react/SmartSearch/SmartSearch.tsx +14 -1
- package/package.json +1 -1
|
@@ -7,6 +7,10 @@ import * as React from 'react';
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
export interface SearchPillProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
10
|
+
/** Field height: 'md' (40px, default) or 'sm' (32px). Named fieldSize because
|
|
11
|
+
the native input `size` attribute means character count, not height. Use
|
|
12
|
+
'sm' inside a toolbar, where a 40px field towers over 32px buttons. */
|
|
13
|
+
fieldSize?: 'sm' | 'md';
|
|
10
14
|
/** Keyboard hint rendered as a .kbd chip (e.g. "⌘K"). */
|
|
11
15
|
shortcut?: string;
|
|
12
16
|
/** Leading icon — defaults to the canonical search glyph. */
|
|
@@ -26,11 +30,12 @@ const SearchGlyph: React.FC = () => (
|
|
|
26
30
|
export const SearchPill: React.FC<SearchPillProps> = ({
|
|
27
31
|
shortcut,
|
|
28
32
|
icon,
|
|
33
|
+
fieldSize = 'md',
|
|
29
34
|
wrapperClassName,
|
|
30
35
|
wrapperStyle,
|
|
31
36
|
...rest
|
|
32
37
|
}) => (
|
|
33
|
-
<div className={['pill-search', wrapperClassName || ''].filter(Boolean).join(' ')} style={wrapperStyle}>
|
|
38
|
+
<div className={['pill-search', fieldSize === 'sm' ? 'pill-search-sm' : '', wrapperClassName || ''].filter(Boolean).join(' ')} style={wrapperStyle}>
|
|
34
39
|
{icon != null ? icon : <SearchGlyph />}
|
|
35
40
|
<input type="search" {...rest} />
|
|
36
41
|
{shortcut ? <span className="kbd">{shortcut}</span> : null}
|
|
@@ -12,6 +12,8 @@ export interface SSItem {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export interface SSSection {
|
|
15
|
+
/** `recent` renders `.ss-recent` — history styling, quieter than results. */
|
|
16
|
+
variant?: 'default' | 'recent';
|
|
15
17
|
/** Uppercase section label (e.g. "Counterparties"). */
|
|
16
18
|
label?: React.ReactNode;
|
|
17
19
|
items: SSItem[];
|
|
@@ -26,6 +28,8 @@ export interface SSTypeButton {
|
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
export interface SmartSearchProps {
|
|
31
|
+
/** Empty-state line — renders `.ss-no-result` with the term emphasised. */
|
|
32
|
+
emptyQuery?: string;
|
|
29
33
|
value: string;
|
|
30
34
|
onChange?: (value: string) => void;
|
|
31
35
|
placeholder?: string;
|
|
@@ -34,6 +34,9 @@ export interface SSItem {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export interface SSSection {
|
|
37
|
+
/** `recent` renders `.ss-recent`: leading icons shrink to bare glyphs so
|
|
38
|
+
history reads below live results instead of competing with them. */
|
|
39
|
+
variant?: 'default' | 'recent';
|
|
37
40
|
/** Uppercase section label (e.g. "Counterparties"). */
|
|
38
41
|
label?: React.ReactNode;
|
|
39
42
|
items: SSItem[];
|
|
@@ -48,6 +51,9 @@ export interface SSTypeButton {
|
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
export interface SmartSearchProps {
|
|
54
|
+
/** Empty-state line, rendered as `.ss-no-result` with the term emphasised.
|
|
55
|
+
Pass the query so the message can name what failed. */
|
|
56
|
+
emptyQuery?: string;
|
|
51
57
|
value: string;
|
|
52
58
|
onChange?: (value: string) => void;
|
|
53
59
|
placeholder?: string;
|
|
@@ -101,6 +107,7 @@ export const SmartSearch: React.FC<SmartSearchProps> = ({
|
|
|
101
107
|
sections,
|
|
102
108
|
onSelect,
|
|
103
109
|
resultLabel,
|
|
110
|
+
emptyQuery,
|
|
104
111
|
hint,
|
|
105
112
|
typeButtons,
|
|
106
113
|
onTypeSelect,
|
|
@@ -192,12 +199,18 @@ export const SmartSearch: React.FC<SmartSearchProps> = ({
|
|
|
192
199
|
) : null}
|
|
193
200
|
|
|
194
201
|
{sections && sections.length ? sections.map((s, i) => (
|
|
195
|
-
<div key={i} className=
|
|
202
|
+
<div key={i} className={'ss-section' + (s.variant === 'recent' ? ' ss-recent' : '')}>
|
|
196
203
|
{s.label != null ? <div className="ss-section-label">{s.label}</div> : null}
|
|
197
204
|
<ul className="ss-list">{s.items.map(renderItem)}</ul>
|
|
198
205
|
</div>
|
|
199
206
|
)) : null}
|
|
200
207
|
|
|
208
|
+
{emptyQuery != null ? (
|
|
209
|
+
<div className="ss-section">
|
|
210
|
+
<div className="ss-no-result">No results for "<strong>{emptyQuery}</strong>".</div>
|
|
211
|
+
</div>
|
|
212
|
+
) : null}
|
|
213
|
+
|
|
201
214
|
{hint != null ? (
|
|
202
215
|
<div className="ss-section"><div className="ss-hint">{hint}</div></div>
|
|
203
216
|
) : null}
|
package/package.json
CHANGED