superdesk-ui-framework 3.1.9 → 3.1.13
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/app/styles/_helpers.scss +926 -776
- package/app/styles/_master-desk.scss +2 -2
- package/app/styles/_toggle-box.scss +45 -28
- package/app/styles/components/_sd-collapse-box.scss +113 -0
- package/app/styles/components/_subnav.scss +0 -1
- package/app/styles/design-tokens/_design-tokens-general.scss +19 -5
- package/app/styles/design-tokens/_new-colors.scss +11 -1
- package/app/styles/form-elements/_inputs.scss +14 -0
- package/app/styles/grids/_grid-layout.scss +3 -0
- package/app-typescript/components/DatePicker.tsx +6 -0
- package/app-typescript/components/Layouts/LayoutContainer.tsx +7 -1
- package/app-typescript/components/Layouts/PageLayout.tsx +2 -1
- package/app-typescript/components/TimePickerV2.tsx +222 -0
- package/app-typescript/components/ToggleBox/CustomHeaderToggleBox.tsx +61 -0
- package/app-typescript/components/{Togglebox.tsx → ToggleBox/SimpleToggleBox.tsx} +13 -34
- package/app-typescript/components/ToggleBox/index.tsx +43 -0
- package/app-typescript/components/TreeMenu.tsx +12 -7
- package/app-typescript/components/TreeSelect/TreeSelect.tsx +13 -12
- package/app-typescript/components/TreeSelect/TreeSelectItem.tsx +11 -1
- package/app-typescript/index.ts +2 -1
- package/dist/components/Alerts.tsx +1 -1
- package/dist/components/ContentDivider.tsx +1 -1
- package/dist/components/DragHandleDocs.tsx +2 -2
- package/dist/components/Index.tsx +105 -50
- package/dist/components/Panel.tsx +13 -13
- package/dist/components/Tags.tsx +2 -2
- package/dist/components/TimePicker.tsx +43 -1
- package/dist/components/Togglebox.tsx +171 -17
- package/dist/components/TreeMenu.tsx +2 -0
- package/dist/components/utilities/BorderRadiusUtilities.tsx +56 -0
- package/dist/components/utilities/BorderUtilities.tsx +170 -0
- package/dist/components/utilities/DisplayUtilities.tsx +116 -0
- package/dist/components/utilities/FlexAndGridUtilities.tsx +551 -0
- package/dist/components/utilities/ObjectFitUtilities.tsx +53 -0
- package/dist/components/utilities/ObjectPositionUtilities.tsx +68 -0
- package/dist/components/utilities/OpacityUtilities.tsx +64 -0
- package/dist/components/utilities/OverflowUtilities.tsx +93 -0
- package/dist/components/utilities/PositionUtilities.tsx +52 -0
- package/dist/components/utilities/ShadowUtilities.tsx +123 -0
- package/dist/components/utilities/SpacingUtilities.tsx +2 -2
- package/dist/components/utilities/TextUtilities.tsx +83 -4
- package/dist/components.html +2 -4
- package/dist/components_deprecated/modals.html +2 -2
- package/dist/components_deprecated.html +1 -0
- package/dist/design-patterns/Index.tsx +1 -42
- package/dist/design-patterns/ThreePaneLayoutPattern.tsx +1 -1
- package/dist/design-patterns.html +2 -4
- package/dist/design.html +1 -0
- package/dist/examples.bundle.css +15 -7
- package/dist/examples.bundle.js +4283 -2189
- package/dist/main.html +1 -0
- package/dist/playgrounds/react-playgrounds/Rundowns.tsx +1 -1
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +214 -2
- package/dist/playgrounds.html +1 -0
- package/dist/superdesk-ui.bundle.css +1397 -1019
- package/dist/superdesk-ui.bundle.js +2039 -1653
- package/dist/vendor.bundle.js +16 -16
- package/examples/css/docs-page.css +15 -7
- package/examples/js/doc.js +13 -1
- package/examples/pages/components/Alerts.tsx +1 -1
- package/examples/pages/components/ContentDivider.tsx +1 -1
- package/examples/pages/components/DragHandleDocs.tsx +2 -2
- package/examples/pages/components/Index.tsx +105 -50
- package/examples/pages/components/Panel.tsx +13 -13
- package/examples/pages/components/Tags.tsx +2 -2
- package/examples/pages/components/TimePicker.tsx +43 -1
- package/examples/pages/components/Togglebox.tsx +171 -17
- package/examples/pages/components/TreeMenu.tsx +2 -0
- package/examples/pages/components/utilities/BorderRadiusUtilities.tsx +56 -0
- package/examples/pages/components/utilities/BorderUtilities.tsx +170 -0
- package/examples/pages/components/utilities/DisplayUtilities.tsx +116 -0
- package/examples/pages/components/utilities/FlexAndGridUtilities.tsx +551 -0
- package/examples/pages/components/utilities/ObjectFitUtilities.tsx +53 -0
- package/examples/pages/components/utilities/ObjectPositionUtilities.tsx +68 -0
- package/examples/pages/components/utilities/OpacityUtilities.tsx +64 -0
- package/examples/pages/components/utilities/OverflowUtilities.tsx +93 -0
- package/examples/pages/components/utilities/PositionUtilities.tsx +52 -0
- package/examples/pages/components/utilities/ShadowUtilities.tsx +123 -0
- package/examples/pages/components/utilities/SpacingUtilities.tsx +2 -2
- package/examples/pages/components/utilities/TextUtilities.tsx +83 -4
- package/examples/pages/components.html +2 -4
- package/examples/pages/components_deprecated/modals.html +2 -2
- package/examples/pages/components_deprecated.html +1 -0
- package/examples/pages/design-patterns/Index.tsx +1 -42
- package/examples/pages/design-patterns/ThreePaneLayoutPattern.tsx +1 -1
- package/examples/pages/design-patterns.html +2 -4
- package/examples/pages/design.html +1 -0
- package/examples/pages/main.html +1 -0
- package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +1 -1
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +214 -2
- package/examples/pages/playgrounds.html +1 -0
- package/package.json +1 -1
- package/react/components/DatePicker.d.ts +3 -0
- package/react/components/DatePicker.js +2 -2
- package/react/components/Layouts/LayoutContainer.d.ts +1 -0
- package/react/components/Layouts/LayoutContainer.js +8 -1
- package/react/components/Layouts/PageLayout.d.ts +1 -0
- package/react/components/Layouts/PageLayout.js +1 -1
- package/react/components/TimePickerV2.d.ts +28 -0
- package/react/components/TimePickerV2.js +189 -0
- package/react/components/ToggleBox/CustomHeaderToggleBox.d.ts +12 -0
- package/react/components/ToggleBox/CustomHeaderToggleBox.js +81 -0
- package/react/components/ToggleBox/SimpleToggleBox.d.ts +18 -0
- package/react/components/{Togglebox.js → ToggleBox/SimpleToggleBox.js} +15 -13
- package/react/components/ToggleBox/index.d.ts +27 -0
- package/react/components/ToggleBox/index.js +71 -0
- package/react/components/TreeMenu.js +9 -7
- package/react/components/TreeSelect/TreeSelect.js +9 -11
- package/react/components/TreeSelect/TreeSelectItem.d.ts +1 -0
- package/react/components/TreeSelect/TreeSelectItem.js +7 -4
- package/react/index.d.ts +2 -1
- package/react/index.js +7 -5
- package/react/components/Togglebox.d.ts +0 -28
@@ -72,8 +72,18 @@ import { ResizablePanelsDoc } from './ResizablePanels';
|
|
72
72
|
import { IllustrationButtonDoc } from './IllustrationButton';
|
73
73
|
|
74
74
|
// Utilities
|
75
|
-
import {SpacingUtilitiesDoc} from './utilities/SpacingUtilities';
|
76
|
-
import {TextUtilitiesDoc} from './utilities/TextUtilities';
|
75
|
+
import { SpacingUtilitiesDoc } from './utilities/SpacingUtilities';
|
76
|
+
import { TextUtilitiesDoc } from './utilities/TextUtilities';
|
77
|
+
import { ShadowUtilitiesDoc } from './utilities/ShadowUtilities';
|
78
|
+
import { PositionUtilitiesDoc } from './utilities/PositionUtilities';
|
79
|
+
import { OverflowUtilitiesDoc } from './utilities/OverflowUtilities';
|
80
|
+
import { DisplayUtilitiesDoc } from './utilities/DisplayUtilities';
|
81
|
+
import { FlexAndGridUtilitiesDoc } from './utilities/FlexAndGridUtilities';
|
82
|
+
import { BorderRadiusUtilitiesDoc } from './utilities/BorderRadiusUtilities';
|
83
|
+
import { BorderUtilitiesDoc } from './utilities/BorderUtilities';
|
84
|
+
import { OpacityUtilitiesDoc } from './utilities/OpacityUtilities';
|
85
|
+
import { ObjectFitUtilitiesDoc } from './utilities/ObjectFitUtilities';
|
86
|
+
import { ObjectPositionUtilitiesDoc } from './utilities/ObjectPositionUtilities';
|
77
87
|
|
78
88
|
const pages = {
|
79
89
|
basicComponents: {
|
@@ -136,7 +146,7 @@ const pages = {
|
|
136
146
|
"drag-handle": {
|
137
147
|
name: 'Drag handle'
|
138
148
|
},
|
139
|
-
"illustration-button"
|
149
|
+
"illustration-button": {
|
140
150
|
name: 'Illustration Button'
|
141
151
|
}
|
142
152
|
}
|
@@ -299,65 +309,52 @@ const pages = {
|
|
299
309
|
utilityClasses: {
|
300
310
|
name: "Utility classes",
|
301
311
|
items: {
|
312
|
+
'border-utilities': {
|
313
|
+
name: 'Border'
|
314
|
+
},
|
315
|
+
'border-radius-utilities': {
|
316
|
+
name: 'Border Radius'
|
317
|
+
},
|
318
|
+
'display-utilities': {
|
319
|
+
name: 'Display'
|
320
|
+
},
|
321
|
+
'flex-and-grid-utilities': {
|
322
|
+
name: 'Flex & Grid'
|
323
|
+
},
|
324
|
+
'object-fit-utilities': {
|
325
|
+
name: 'Object Fit'
|
326
|
+
},
|
327
|
+
'object-position-utilities': {
|
328
|
+
name: 'Object Position'
|
329
|
+
},
|
330
|
+
'opacity-utilities': {
|
331
|
+
name: 'Opacity'
|
332
|
+
},
|
333
|
+
'overflow-utilities': {
|
334
|
+
name: 'Overflow'
|
335
|
+
},
|
336
|
+
'position-utilities': {
|
337
|
+
name: 'Position'
|
338
|
+
},
|
339
|
+
'shadow-utilities': {
|
340
|
+
name: 'Shadow'
|
341
|
+
},
|
302
342
|
'spacing-utilities': {
|
303
|
-
name: 'Spacing
|
343
|
+
name: 'Spacing',
|
304
344
|
},
|
305
345
|
'text-utilities': {
|
306
|
-
name: 'Text
|
346
|
+
name: 'Text'
|
307
347
|
}
|
308
348
|
}
|
309
349
|
}
|
310
350
|
}
|
311
|
-
interface IProps {
|
312
|
-
theme?: string;
|
313
|
-
}
|
314
|
-
interface IState {
|
315
|
-
theme: 'dark-ui' | 'light-ui' | string;
|
316
|
-
}
|
317
|
-
|
318
|
-
class ReactDoc extends React.Component<IProps, IState> {
|
319
|
-
constructor(props: IProps) {
|
320
|
-
super(props);
|
321
|
-
this.state = {
|
322
|
-
theme: 'light-ui',
|
323
|
-
}
|
324
|
-
this.handleTheme = this.handleTheme.bind(this);
|
325
|
-
}
|
326
|
-
|
327
|
-
handleTheme(newTheme: string) {
|
328
|
-
document.body.setAttribute('data-theme', newTheme);
|
329
|
-
|
330
|
-
this.setState({
|
331
|
-
theme: newTheme
|
332
|
-
})
|
333
|
-
}
|
334
|
-
|
335
|
-
checkTheme(theme: string) {
|
336
|
-
return this.state.theme === theme;
|
337
|
-
}
|
338
351
|
|
352
|
+
class ReactDoc extends React.Component {
|
339
353
|
render() {
|
340
354
|
return (
|
341
355
|
<React.Fragment>
|
342
356
|
<ReactNav pages={pages} />
|
343
357
|
<main className="docs-page__content docs-page__container-fluid">
|
344
|
-
<div className="docs-page__fla-button-container">
|
345
|
-
<Dropdown
|
346
|
-
items={[
|
347
|
-
{
|
348
|
-
type: 'group', label: 'Chose a theme', items: [
|
349
|
-
'divider',
|
350
|
-
{ label: 'Light', icon: 'adjust', active: this.checkTheme('light-ui'), onSelect: () => this.handleTheme('light-ui') },
|
351
|
-
{ label: 'Dark', icon: 'adjust', active: this.checkTheme('dark-ui'), onSelect: () => this.handleTheme('dark-ui') },
|
352
|
-
{ label: 'Accessible Light', active: this.checkTheme('accessible-light-ui'), icon: 'adjust', onSelect: () => this.handleTheme('accessible-light-ui') },
|
353
|
-
]
|
354
|
-
},
|
355
|
-
]}>
|
356
|
-
<button className="docs-page__fla-button" aria-label="Change theme" onClick={() => false}>
|
357
|
-
<i className="icon-adjust"></i>
|
358
|
-
</button>
|
359
|
-
</Dropdown>
|
360
|
-
</div>
|
361
358
|
<Switch>
|
362
359
|
<Route path="/components/buttons" component={ButtonsDoc} />
|
363
360
|
<Route path="/components/icon-buttons" component={IconButtonDoc} />
|
@@ -422,6 +419,16 @@ class ReactDoc extends React.Component<IProps, IState> {
|
|
422
419
|
{/* Utilities */}
|
423
420
|
<Route path="/components/spacing-utilities" component={SpacingUtilitiesDoc} />
|
424
421
|
<Route path="/components/text-utilities" component={TextUtilitiesDoc} />
|
422
|
+
<Route path="/components/shadow-utilities" component={ShadowUtilitiesDoc} />
|
423
|
+
<Route path="/components/position-utilities" component={PositionUtilitiesDoc} />
|
424
|
+
<Route path="/components/overflow-utilities" component={OverflowUtilitiesDoc} />
|
425
|
+
<Route path="/components/display-utilities" component={DisplayUtilitiesDoc} />
|
426
|
+
<Route path="/components/flex-and-grid-utilities" component={FlexAndGridUtilitiesDoc} />
|
427
|
+
<Route path="/components/border-radius-utilities" component={BorderRadiusUtilitiesDoc} />
|
428
|
+
<Route path="/components/border-utilities" component={BorderUtilitiesDoc} />
|
429
|
+
<Route path="/components/opacity-utilities" component={OpacityUtilitiesDoc} />
|
430
|
+
<Route path="/components/object-fit-utilities" component={ObjectFitUtilitiesDoc} />
|
431
|
+
<Route path="/components/object-position-utilities" component={ObjectPositionUtilitiesDoc} />
|
425
432
|
<Route path="/" component={ReactDefault} />
|
426
433
|
</Switch>
|
427
434
|
</main>
|
@@ -444,6 +451,54 @@ class ReactPlayground extends React.Component<IProps> {
|
|
444
451
|
}
|
445
452
|
}
|
446
453
|
|
454
|
+
interface IProps {
|
455
|
+
theme?: string;
|
456
|
+
}
|
457
|
+
interface IState {
|
458
|
+
theme: 'dark-ui' | 'light-ui' | string;
|
459
|
+
}
|
460
|
+
class ReactThemePicker extends React.Component<IProps, IState> {
|
461
|
+
constructor(props: IProps) {
|
462
|
+
super(props);
|
463
|
+
this.state = {
|
464
|
+
theme: 'light-ui',
|
465
|
+
}
|
466
|
+
this.handleTheme = this.handleTheme.bind(this);
|
467
|
+
}
|
468
|
+
|
469
|
+
handleTheme(newTheme: string) {
|
470
|
+
document.body.setAttribute('data-theme', newTheme);
|
471
|
+
|
472
|
+
this.setState({
|
473
|
+
theme: newTheme
|
474
|
+
})
|
475
|
+
}
|
476
|
+
|
477
|
+
checkTheme(theme: string) {
|
478
|
+
return this.state.theme === theme;
|
479
|
+
}
|
480
|
+
|
481
|
+
render() {
|
482
|
+
return (
|
483
|
+
<Dropdown
|
484
|
+
items={[
|
485
|
+
{
|
486
|
+
type: 'group', label: 'Chose a theme', items: [
|
487
|
+
'divider',
|
488
|
+
{ label: 'Light', icon: 'adjust', active: this.checkTheme('light-ui'), onSelect: () => this.handleTheme('light-ui') },
|
489
|
+
{ label: 'Dark', icon: 'adjust', active: this.checkTheme('dark-ui'), onSelect: () => this.handleTheme('dark-ui') },
|
490
|
+
{ label: 'Accessible Light', active: this.checkTheme('accessible-light-ui'), icon: 'adjust', onSelect: () => this.handleTheme('accessible-light-ui') },
|
491
|
+
]
|
492
|
+
},
|
493
|
+
]}>
|
494
|
+
<button className="docs-page__header-button" aria-label="Change theme" onClick={() => false}>
|
495
|
+
<i className="icon-adjust"></i>
|
496
|
+
</button>
|
497
|
+
</Dropdown>
|
498
|
+
);
|
499
|
+
}
|
500
|
+
}
|
501
|
+
|
447
502
|
const parsePlayground = ({ match }, playgrounds) => {
|
448
503
|
const Component = Playgrounds[playgrounds[match.params.id].component];
|
449
504
|
return (
|
@@ -451,5 +506,5 @@ const parsePlayground = ({ match }, playgrounds) => {
|
|
451
506
|
);
|
452
507
|
};
|
453
508
|
|
454
|
-
export { ReactDoc, ReactPlayground };
|
509
|
+
export { ReactDoc, ReactPlayground, ReactThemePicker };
|
455
510
|
|
@@ -57,15 +57,15 @@ export default class PanelDoc extends React.Component<IProps, IState> {
|
|
57
57
|
<Markup.ReactMarkup>
|
58
58
|
<Markup.ReactMarkupPreview>
|
59
59
|
<p className="docs-page__paragraph">// Left</p>
|
60
|
-
<div className='
|
60
|
+
<div className='d-flex' style={{border: '1px solid var(--sd-colour-line--medium)', backgroundColor: 'var(--sd-colour-panel-bg--100)', maxHeight: '400px'}}>
|
61
61
|
{this.state.openPanel1 ? null :
|
62
|
-
<div className='
|
62
|
+
<div className='d-flex items-center justify-center sd-flex--grow'>
|
63
63
|
<Button text="Open Panel" style="filled" onClick={() => this.setState({'openPanel1': true})} />
|
64
64
|
</div>
|
65
65
|
}
|
66
66
|
<PanelElements.Panel side='left' background='light' open={this.state.openPanel1} size='x-small'>
|
67
67
|
<PanelElements.PanelHeader
|
68
|
-
title='This is the title
|
68
|
+
title='This is the Panel title'
|
69
69
|
onClose={() => this.setState({'openPanel1': false})}
|
70
70
|
iconButtons={[
|
71
71
|
<Rotate degrees={this.state.rotate ? 90 : 0}>
|
@@ -92,7 +92,7 @@ export default class PanelDoc extends React.Component<IProps, IState> {
|
|
92
92
|
<Markup.ReactMarkupCode>{`
|
93
93
|
// Left
|
94
94
|
{this.state.openPanel1 ? null :
|
95
|
-
<div className='
|
95
|
+
<div className='d-flex items-center justify-center sd-flex--grow'>
|
96
96
|
<Button text="Open Panel" style="filled" onClick={() => this.setState({'openPanel1': true})} />
|
97
97
|
</div>
|
98
98
|
}
|
@@ -130,9 +130,9 @@ export default class PanelDoc extends React.Component<IProps, IState> {
|
|
130
130
|
<Markup.ReactMarkup>
|
131
131
|
<Markup.ReactMarkupPreview>
|
132
132
|
<p className="docs-page__paragraph">// Right, custom elements inside the footer + dark theme.</p>
|
133
|
-
<div className='
|
133
|
+
<div className='d-flex' style={{border: '1px solid var(--sd-colour-line--medium)', backgroundColor: 'var(--sd-colour-panel-bg--100)', maxHeight: '400px'}}>
|
134
134
|
{this.state.openPanel2 ? null :
|
135
|
-
<div className='
|
135
|
+
<div className='d-flex items-center justify-center sd-flex--grow'>
|
136
136
|
<Button text="Open Panel" style="filled" onClick={() => this.setState({'openPanel2': true})} />
|
137
137
|
</div>
|
138
138
|
}
|
@@ -168,7 +168,7 @@ export default class PanelDoc extends React.Component<IProps, IState> {
|
|
168
168
|
// Right, custom elements inside the footer + dark theme.
|
169
169
|
|
170
170
|
{this.state.openPanel2 ? null :
|
171
|
-
<div className='
|
171
|
+
<div className='d-flex items-center justify-center sd-flex--grow'>
|
172
172
|
<Button text="Open Panel" style="filled" onClick={() => this.setState({'openPanel2': true})} />
|
173
173
|
</div>
|
174
174
|
}
|
@@ -201,9 +201,9 @@ export default class PanelDoc extends React.Component<IProps, IState> {
|
|
201
201
|
<Markup.ReactMarkup>
|
202
202
|
<Markup.ReactMarkupPreview>
|
203
203
|
<p className="docs-page__paragraph">// With PanelHeaderSlidingToolbar element inside the PanelHeader</p>
|
204
|
-
<div className='
|
204
|
+
<div className='d-flex' style={{border: '1px solid var(--sd-colour-line--medium)', backgroundColor: 'var(--sd-colour-panel-bg--100)', maxHeight: '400px'}}>
|
205
205
|
{this.state.openPanel3 ? null :
|
206
|
-
<div className='
|
206
|
+
<div className='d-flex items-center justify-center sd-flex--grow'>
|
207
207
|
<Button text="Open Panel" style="filled" onClick={() => this.setState({'openPanel3': true})} />
|
208
208
|
</div>
|
209
209
|
}
|
@@ -245,7 +245,7 @@ export default class PanelDoc extends React.Component<IProps, IState> {
|
|
245
245
|
// With PanelHeaderSlidingToolbar element inside the PanelHeader
|
246
246
|
|
247
247
|
{this.state.openPanel3 ? null :
|
248
|
-
<div className='
|
248
|
+
<div className='d-flex items-center justify-center sd-flex--grow'>
|
249
249
|
<Button text="Open Panel" style="filled" onClick={() => this.setState({'openPanel3': true})} />
|
250
250
|
</div>
|
251
251
|
}
|
@@ -284,9 +284,9 @@ export default class PanelDoc extends React.Component<IProps, IState> {
|
|
284
284
|
<Markup.ReactMarkup>
|
285
285
|
<Markup.ReactMarkupPreview>
|
286
286
|
<p className="docs-page__paragraph">// With PanelTools (allowing custom actions) + dark theme</p>
|
287
|
-
<div className='
|
287
|
+
<div className='d-flex' style={{border: '1px solid var(--sd-colour-line--medium)', backgroundColor: 'var(--sd-colour-panel-bg--100)', maxHeight: '400px'}}>
|
288
288
|
{this.state.openPanel4 ? null :
|
289
|
-
<div className='
|
289
|
+
<div className='d-flex items-center justify-center sd-flex--grow'>
|
290
290
|
<Button text="Open Panel" style="filled" onClick={() => this.setState({'openPanel4': true})} />
|
291
291
|
</div>
|
292
292
|
}
|
@@ -317,7 +317,7 @@ export default class PanelDoc extends React.Component<IProps, IState> {
|
|
317
317
|
// With PanelTools (allowing custom actions) + dark theme
|
318
318
|
|
319
319
|
{this.state.openPanel4 ? null :
|
320
|
-
<div className='
|
320
|
+
<div className='d-flex items-center justify-center sd-flex--grow'>
|
321
321
|
<Button text="Open Panel" style="filled" onClick={() => this.setState({'openPanel4': true})} />
|
322
322
|
</div>
|
323
323
|
}
|
package/dist/components/Tags.tsx
CHANGED
@@ -55,7 +55,7 @@ export default class TagDoc extends React.Component<{}, ITag> {
|
|
55
55
|
|
56
56
|
<Markup.ReactMarkup>
|
57
57
|
<Markup.ReactMarkupPreview>
|
58
|
-
<div className='docs-page__content-row
|
58
|
+
<div className='docs-page__content-row d-flex gap-1'>
|
59
59
|
{this.state.tags.map((tag,index)=>{
|
60
60
|
return (
|
61
61
|
<React.Fragment key={index}>
|
@@ -86,7 +86,7 @@ export default class TagDoc extends React.Component<{}, ITag> {
|
|
86
86
|
|
87
87
|
<Markup.ReactMarkup>
|
88
88
|
<Markup.ReactMarkupPreview>
|
89
|
-
<div className='docs-page__content-row
|
89
|
+
<div className='docs-page__content-row d-flex gap-1'>
|
90
90
|
{this.state.tags2.map((tag,index)=>{
|
91
91
|
return (
|
92
92
|
<React.Fragment key={index}>
|
@@ -2,6 +2,10 @@ import * as React from 'react';
|
|
2
2
|
import * as Markup from '../../js/react';
|
3
3
|
import {PropsList, Prop} from '../../../app-typescript';
|
4
4
|
import {TimePicker} from '../../../app-typescript/components/TimePicker';
|
5
|
+
import {TimePickerV2} from '../../../app-typescript/components/TimePickerV2';
|
6
|
+
|
7
|
+
let minutes = Array.from(Array(60).keys());
|
8
|
+
let changedMinutes = minutes.filter((num) => num % 15 !== 0)
|
5
9
|
|
6
10
|
class TimePickerExample extends React.PureComponent<{}, {time: string}> {
|
7
11
|
constructor(props) {
|
@@ -27,7 +31,15 @@ class TimePickerExample extends React.PureComponent<{}, {time: string}> {
|
|
27
31
|
}
|
28
32
|
}
|
29
33
|
|
30
|
-
export default class TimePickerDoc extends React.Component {
|
34
|
+
export default class TimePickerDoc extends React.Component<{}, {time: string}> {
|
35
|
+
constructor(props) {
|
36
|
+
super(props);
|
37
|
+
|
38
|
+
this.state = {
|
39
|
+
time: '14:00',
|
40
|
+
};
|
41
|
+
}
|
42
|
+
|
31
43
|
render() {
|
32
44
|
return (
|
33
45
|
<section className="docs-page__container">
|
@@ -59,6 +71,36 @@ export default class TimePickerDoc extends React.Component {
|
|
59
71
|
`}</Markup.ReactMarkupCode>
|
60
72
|
</Markup.ReactMarkup>
|
61
73
|
|
74
|
+
<p className='docs-page__paragraph'>TimePickerV2:</p>
|
75
|
+
<Markup.ReactMarkup>
|
76
|
+
<Markup.ReactMarkupPreview>
|
77
|
+
<div className='docs-page__content-row'>
|
78
|
+
<TimePickerV2
|
79
|
+
value={this.state.time}
|
80
|
+
label='This is Label'
|
81
|
+
disabledOptions={{
|
82
|
+
minutes: changedMinutes,
|
83
|
+
}}
|
84
|
+
onChange={(time) => {
|
85
|
+
this.setState({time});
|
86
|
+
}}
|
87
|
+
/>
|
88
|
+
</div>
|
89
|
+
</Markup.ReactMarkupPreview>
|
90
|
+
<Markup.ReactMarkupCode>{`
|
91
|
+
<TimePickerV2
|
92
|
+
value={this.state.time}
|
93
|
+
label='This is Label'
|
94
|
+
disableOptions={{
|
95
|
+
minutes: changedMinutes,
|
96
|
+
}}
|
97
|
+
onChange={(time) => {
|
98
|
+
this.setState({time})
|
99
|
+
}}
|
100
|
+
/>
|
101
|
+
`}</Markup.ReactMarkupCode>
|
102
|
+
</Markup.ReactMarkup>
|
103
|
+
|
62
104
|
<h3 className='docs-page__h3'>Props</h3>
|
63
105
|
<PropsList>
|
64
106
|
<Prop name='value' isRequired={true} type='string' default='/' description='Item value.' />
|
@@ -1,48 +1,202 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as Markup from "../../js/react";
|
3
|
-
import {
|
3
|
+
import { PropsList, Prop, Badge, Icon, Label, AvatarGroup, ContentDivider, FormLabel, Text } from "../../../app-typescript";
|
4
|
+
import {ToggleBox} from './../../../app-typescript/components/ToggleBox/index';
|
5
|
+
import {IAvatarInGroup} from '../../../app-typescript/components/avatar/avatar-group';
|
6
|
+
|
7
|
+
const avatars: Array<IAvatarInGroup> = [
|
8
|
+
{
|
9
|
+
imageUrl: null,
|
10
|
+
initials: "VS",
|
11
|
+
displayName: 'Vladimir Stefanovic',
|
12
|
+
icon:{name: 'text', color: 'var(--sd-colour-highlight)'},
|
13
|
+
},
|
14
|
+
{
|
15
|
+
imageUrl: null,
|
16
|
+
initials: "JL",
|
17
|
+
displayName: 'Jeffrey Lebowski',
|
18
|
+
icon:{name: 'photo', color: 'var(--sd-colour-highlight)'}
|
19
|
+
},
|
20
|
+
{
|
21
|
+
imageUrl: null,
|
22
|
+
initials: "WS",
|
23
|
+
displayName: 'Walter Sobchak',
|
24
|
+
icon:{name: 'video', color: 'var(--sd-colour-highlight)'}
|
25
|
+
},
|
26
|
+
{
|
27
|
+
imageUrl: null,
|
28
|
+
initials: "ML",
|
29
|
+
displayName: 'Maude Lebowski',
|
30
|
+
icon:{name: 'file', color: 'var(--sd-colour-highlight)'}
|
31
|
+
},
|
32
|
+
];
|
4
33
|
|
5
|
-
const ToggleboxDocs = () => {
|
6
|
-
const toggleRef = React.useRef();
|
7
34
|
|
35
|
+
const ToggleboxDocs = () => {
|
8
36
|
return (
|
9
37
|
<section className="docs-page__container">
|
10
38
|
<h2 className="docs-page__h2">Togglebox</h2>
|
11
|
-
<p className="docs-page__paragraph">Simple toggle box element. It provides toggle() function that can be used with React's ref functionality and control close/open state from outside. Arrow left, Arrow right and Enter are supported keyboard events.</p>
|
12
39
|
<Markup.ReactMarkupCodePreview>{`
|
13
|
-
<ToggleBox title="togglebox title">togglebox content</ToggleBox>
|
40
|
+
<ToggleBox variant="simple" title="togglebox title">togglebox content</ToggleBox>
|
14
41
|
`}
|
15
42
|
</Markup.ReactMarkupCodePreview>
|
43
|
+
<p className="docs-page__paragraph">Simple ToggleBox:</p>
|
44
|
+
<Markup.ReactMarkup>
|
45
|
+
<Markup.ReactMarkupPreview>
|
46
|
+
<div style={{ marginTop: "2em" }}>
|
47
|
+
<ToggleBox variant="simple" title="Simple togglebox">Togglebox content</ToggleBox>
|
48
|
+
<ToggleBox variant='simple' title="With badge" badge={<Badge text='2' type='primary' />}>Togglebox content</ToggleBox>
|
49
|
+
<ToggleBox variant='simple' title="Togglebox - circled chevron" circledChevron={true}>Togglebox content</ToggleBox>
|
50
|
+
<ToggleBox variant='simple' title="Large title" largeTitle={true} circledChevron={true}>
|
51
|
+
<div className="px-4 text-sm line-height-lg">
|
52
|
+
<p className="mb-2">Maecenas sed diam eget risus varius blandit sit amet non magna. Nulla vitae elit libero, a pharetra augue.
|
53
|
+
Donec id elit non mi porta gravida at eget metus. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.
|
54
|
+
Curabitur blandit tempus porttitor.</p>
|
55
|
+
|
56
|
+
<p className="mb-2">Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nullam quis risus eget urna mollis ornare vel eu leo.
|
57
|
+
Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit. Integer posuere
|
58
|
+
erat a ante venenatis dapibus posuere velit aliquet.</p>
|
59
|
+
|
60
|
+
<p className="">Aenean lacinia bibendum nulla sed consectetur. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Vestibulum id
|
61
|
+
ligula porta felis euismod semper. Cras justo odio, dapibus ac facilisis in, egestas eget quam.</p>
|
62
|
+
</div>
|
63
|
+
</ToggleBox>
|
64
|
+
</div>
|
65
|
+
</Markup.ReactMarkupPreview>
|
66
|
+
<Markup.ReactMarkupCode>{`
|
67
|
+
<ToggleBox variant='simple' title="Simple togglebox">Togglebox content</ToggleBox>
|
68
|
+
<ToggleBox variant='simple' title="With badge" badge={<Badge text='2' type='primary' />}>Togglebox content</ToggleBox>
|
69
|
+
<ToggleBox variant='simple' title="Togglebox - circled chevron" className="toggle-box--circle">Togglebox content</ToggleBox>
|
70
|
+
`}</Markup.ReactMarkupCode>
|
71
|
+
</Markup.ReactMarkup>
|
72
|
+
|
73
|
+
<p className="docs-page__paragraph">Custom header ToggleBox:</p>
|
16
74
|
<Markup.ReactMarkup>
|
17
75
|
<Markup.ReactMarkupPreview>
|
18
|
-
<Button text="Toggle programatically" onClick={() => { toggleRef.current.toggle() }} />
|
19
76
|
<div style={{ marginTop: "2em" }}>
|
20
|
-
<ToggleBox
|
21
|
-
|
22
|
-
|
23
|
-
|
77
|
+
<ToggleBox
|
78
|
+
variant='custom-header'
|
79
|
+
header={
|
80
|
+
<div role="listitem" className="sd-list-item sd-list-item--no-hover">
|
81
|
+
<div className="sd-list-item__border sd-list-item__border--locked"></div>
|
82
|
+
<div className="sd-list-item__column sd-list-item__column--no-border pe-0-5">
|
83
|
+
<Icon type='primary' name='calendar' scale='1.5x' ariaHidden={true} />
|
84
|
+
</div>
|
85
|
+
<div className="sd-list-item__column sd-list-item__column--grow sd-list-item__column--no-border">
|
86
|
+
<div className="sd-list-item__row">
|
87
|
+
<span className="sd-list-item__slugline">Planning Slugline</span>
|
88
|
+
</div>
|
89
|
+
<div className="sd-list-item__row sd-list-item__row--overflow-visible me-1 mb-1-5">
|
90
|
+
<Label text='draft' style='translucent'/>
|
91
|
+
<span className="sd-margin-s--auto">
|
92
|
+
<AvatarGroup
|
93
|
+
size="x-small"
|
94
|
+
items={avatars}
|
95
|
+
/>
|
96
|
+
</span>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
}
|
101
|
+
toggleButtonLabel={'show more'}
|
102
|
+
onToggle={(isOpen) => false}
|
103
|
+
>
|
104
|
+
<div>
|
105
|
+
<FormLabel text='Name'/>
|
106
|
+
<Text size='small' weight='medium'>Australian Open 2024</Text>
|
107
|
+
</div>
|
108
|
+
<ContentDivider type="dashed" margin='x-small' />
|
109
|
+
<div>
|
110
|
+
<FormLabel text='Current Date'/>
|
111
|
+
<Text size='small' weight='medium'>05.02.2024 @ 10:00</Text>
|
112
|
+
</div>
|
113
|
+
<ContentDivider type="dashed" margin='x-small' />
|
114
|
+
<div>
|
115
|
+
<FormLabel text='Current Repeat Summary'/>
|
116
|
+
<Text size='small' weight='medium'>Every 1 day(s) until CET 28 Feb 2024</Text>
|
117
|
+
</div>
|
118
|
+
<ContentDivider type="dashed" margin='x-small' />
|
119
|
+
<div>
|
120
|
+
<FormLabel text='No. of events'/>
|
121
|
+
<Text size='small' weight='medium'>1</Text>
|
122
|
+
</div>
|
123
|
+
</ToggleBox>
|
24
124
|
</div>
|
25
125
|
</Markup.ReactMarkupPreview>
|
26
126
|
<Markup.ReactMarkupCode>{`
|
27
|
-
<
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
127
|
+
<ToggleBox
|
128
|
+
variant='custom-header'
|
129
|
+
header={
|
130
|
+
<div role="listitem" className="sd-list-item sd-list-item--no-hover">
|
131
|
+
<div className="sd-list-item__border sd-list-item__border--locked"></div>
|
132
|
+
<div className="sd-list-item__column sd-list-item__column--no-border pe-0-5">
|
133
|
+
<Icon type='primary' name='calendar' scale='1.5x' ariaHidden={true} />
|
134
|
+
</div>
|
135
|
+
<div className="sd-list-item__column sd-list-item__column--grow sd-list-item__column--no-border">
|
136
|
+
<div className="sd-list-item__row">
|
137
|
+
<span className="sd-list-item__slugline">Planning Slugline</span>
|
138
|
+
</div>
|
139
|
+
<div className="sd-list-item__row sd-list-item__row--overflow-visible me-1 mb-1-5">
|
140
|
+
<Label text='draft' style='translucent'/>
|
141
|
+
<span className="sd-margin-s--auto">
|
142
|
+
<AvatarGroup
|
143
|
+
size="x-small"
|
144
|
+
items={avatars}
|
145
|
+
/>
|
146
|
+
</span>
|
147
|
+
</div>
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
}
|
151
|
+
onToggle={() => false}
|
152
|
+
>
|
153
|
+
<div>
|
154
|
+
<FormLabel text='Name'/>
|
155
|
+
<Text size='small' weight='medium'>Australian Open 2024</Text>
|
156
|
+
</div>
|
157
|
+
<ContentDivider type="dashed" margin='x-small' />
|
158
|
+
<div>
|
159
|
+
<FormLabel text='Current Date'/>
|
160
|
+
<Text size='small' weight='medium'>05.02.2024 @ 10:00</Text>
|
161
|
+
</div>
|
162
|
+
<ContentDivider type="dashed" margin='x-small' />
|
163
|
+
<div>
|
164
|
+
<FormLabel text='Current Repeat Summary'/>
|
165
|
+
<Text size='small' weight='medium'>Every 1 day(s) until CET 28 Feb 2024</Text>
|
166
|
+
</div>
|
167
|
+
<ContentDivider type="dashed" margin='x-small' />
|
168
|
+
<div>
|
169
|
+
<FormLabel text='No. of events'/>
|
170
|
+
<Text size='small' weight='medium'>1</Text>
|
171
|
+
</div>
|
172
|
+
</ToggleBox>
|
33
173
|
`}</Markup.ReactMarkupCode>
|
34
174
|
</Markup.ReactMarkup>
|
35
175
|
|
36
176
|
<h3 className="docs-page__h3">Props</h3>
|
177
|
+
<PropsList>
|
178
|
+
<Prop name='variant' isRequired={true} type='simple | custom header' default='null' description='Type of component.' />
|
179
|
+
</PropsList>
|
180
|
+
|
181
|
+
<h3 className="docs-page__h3">Props: variant: 'simple'</h3>
|
37
182
|
<PropsList>
|
38
183
|
<Prop name='title' isRequired={true} type='string' default='null' description='Togglebox title' />
|
39
184
|
<Prop name='badge' isRequired={false} type='JSX.Element' default='null' description='Badge' />
|
40
|
-
<Prop name='hideUsingCSS' isRequired={false} type='boolean' default='false' description='Usefull when working with forms. Content of togglebox will be hidden but remain rendered.' />
|
41
185
|
<Prop name='initiallyOpen' isRequired={false} type='boolean' default='false' description='Opens togglebox on initial render' />
|
42
186
|
<Prop name='className' isRequired={false} type='string' default='null' description='Style class of the component' />
|
43
187
|
<Prop name='margin' isRequired={false} type='none | small | normal | large' default='normal' description='Defines the bottom margin of the toggle box.' />
|
44
188
|
<Prop name='onOpen' isRequired={false} type='function' default='null' description='Callback on open event' />
|
45
189
|
<Prop name='onClose' isRequired={false} type='function' default='null' description='Callback on close event' />
|
190
|
+
<Prop name='circledChevron' isRequired={false} type='boolean' default='false' description='Adds a light, circle-shaped background around the chevron.' />
|
191
|
+
<Prop name='largeTitle' isRequired={false} type='boolean' default='false' description='This option will increase the size of the title. Always use a circled chevron (circledChevron) in combination with this option.' />
|
192
|
+
</PropsList>
|
193
|
+
|
194
|
+
<h3 className="docs-page__h3">Props: variant: 'custom-header'</h3>
|
195
|
+
<PropsList>
|
196
|
+
<Prop name='header' isRequired={true} type='JSX.Component' default='null' description='Always visible part of component.' />
|
197
|
+
<Prop name='children' isRequired={false} type='JSX.Component' default='null' description='Appear on clicking the button.' />
|
198
|
+
<Prop name='initiallyOpen' isRequired={false} type='boolean' default='false' description='Opens togglebox on initial render.' />
|
199
|
+
<Prop name='onClose' isRequired={false} type='function' default='null' description='Callback on toggle.' />
|
46
200
|
</PropsList>
|
47
201
|
</section>
|
48
202
|
)
|
@@ -176,6 +176,7 @@ export class TreeMenuDocs extends React.Component<{}, {}> {
|
|
176
176
|
<Markup.ReactMarkupPreview>
|
177
177
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
178
178
|
<TreeMenu
|
179
|
+
searchPlaceholder='Search...'
|
179
180
|
getOptions={() => options}
|
180
181
|
getId={(item) => item.name}
|
181
182
|
getLabel={(item) => item.name}
|
@@ -208,6 +209,7 @@ export class TreeMenuDocs extends React.Component<{}, {}> {
|
|
208
209
|
<Markup.ReactMarkupPreview>
|
209
210
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
210
211
|
<TreeMenu
|
212
|
+
searchPlaceholder='Search...'
|
211
213
|
getOptions={() => options2}
|
212
214
|
getId={(item) => item.name}
|
213
215
|
getLabel={(item) => item.name}
|