@axinom/mosaic-ui 0.45.0-rc.12 → 0.45.0-rc.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/components/Tabs/Tab/CustomTab.d.ts.map +1 -1
- package/dist/components/Tabs/TabList/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/FormStation/FormStation.stories.tsx +98 -77
- package/src/components/Tabs/Tab/CustomTab.scss +14 -15
- package/src/components/Tabs/Tab/CustomTab.tsx +1 -0
- package/src/components/Tabs/TabList/CustomTabList.scss +2 -0
- package/src/components/Tabs/TabList/ScrollContainer/ScrollContainer.scss +1 -4
- package/src/components/Tabs/TabList/ScrollContainer/ScrollContainer.tsx +3 -1
- package/src/components/Tabs/TabPanel/CustomTabPanel.scss +0 -1
- package/src/components/Tabs/Tabs.stories.tsx +17 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomTab.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Tab/CustomTab.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAO,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGvE,eAAO,MAAM,SAAS,EAAE,0BAA0B,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"CustomTab.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/Tab/CustomTab.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAO,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGvE,eAAO,MAAM,SAAS,EAAE,0BAA0B,CAAC,QAAQ,CA4B1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tabs/TabList/ScrollContainer/ScrollContainer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"ScrollContainer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tabs/TabList/ScrollContainer/ScrollContainer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAiCnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.45.0-rc.
|
|
3
|
+
"version": "0.45.0-rc.14",
|
|
4
4
|
"description": "UI components for building Axinom Mosaic applications",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"build-storybook": "storybook build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@axinom/mosaic-core": "^0.4.18-rc.
|
|
35
|
+
"@axinom/mosaic-core": "^0.4.18-rc.14",
|
|
36
36
|
"@faker-js/faker": "^7.4.0",
|
|
37
37
|
"@popperjs/core": "^2.11.8",
|
|
38
38
|
"clsx": "^1.1.0",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "e1e4397be63c7f2dd8b33831ab8938554a5c59e8"
|
|
109
109
|
}
|
|
@@ -318,6 +318,7 @@ export const TabbedContent: StoryObj<typeof Details> = (() => {
|
|
|
318
318
|
shortDescription: Yup.string().required().label('Short Description'),
|
|
319
319
|
cast: Yup.array<DetailsValues>().of(Yup.string()).min(1).label('Cast'),
|
|
320
320
|
}),
|
|
321
|
+
edgeToEdgeContent: true,
|
|
321
322
|
initialData: {
|
|
322
323
|
loading: false,
|
|
323
324
|
data: {
|
|
@@ -371,83 +372,103 @@ export const TabbedContent: StoryObj<typeof Details> = (() => {
|
|
|
371
372
|
]}
|
|
372
373
|
as={SelectField}
|
|
373
374
|
/>
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
{
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
375
|
+
<Tabs>
|
|
376
|
+
<TabList>
|
|
377
|
+
<Tab>Nested Tab 1</Tab>
|
|
378
|
+
<Tab>Nested Tab 2</Tab>
|
|
379
|
+
</TabList>
|
|
380
|
+
<TabPanel>
|
|
381
|
+
<FormGrid>
|
|
382
|
+
<Field
|
|
383
|
+
name="shortDescription"
|
|
384
|
+
label="Short Description"
|
|
385
|
+
placeholder="Enter a short description..."
|
|
386
|
+
as={SingleLineTextField}
|
|
387
|
+
/>
|
|
388
|
+
<Field
|
|
389
|
+
name="longDescription"
|
|
390
|
+
label="Long Description"
|
|
391
|
+
placeholder="Enter a description..."
|
|
392
|
+
as={SingleLineTextField}
|
|
393
|
+
/>
|
|
394
|
+
<Field name="cast" label="Cast" as={CustomTagsField} />
|
|
395
|
+
<Field
|
|
396
|
+
name="released"
|
|
397
|
+
label="Released"
|
|
398
|
+
as={DateTimeTextField}
|
|
399
|
+
/>
|
|
400
|
+
<Field
|
|
401
|
+
name="password"
|
|
402
|
+
label="Password"
|
|
403
|
+
as={SingleLineTextField}
|
|
404
|
+
type="password"
|
|
405
|
+
/>
|
|
406
|
+
</FormGrid>
|
|
407
|
+
</TabPanel>
|
|
408
|
+
<TabPanel>
|
|
409
|
+
<FormGrid>
|
|
410
|
+
<Field
|
|
411
|
+
name="licenses"
|
|
412
|
+
label="License Countries"
|
|
413
|
+
tagsOptions={[
|
|
414
|
+
{ value: 'DE', key: 'Germany' },
|
|
415
|
+
{ value: 'EE', key: 'Estonia' },
|
|
416
|
+
{ value: 'LK', key: 'Sri Lanka' },
|
|
417
|
+
]}
|
|
418
|
+
as={TagsField}
|
|
419
|
+
displayKey="key"
|
|
420
|
+
valueKey="value"
|
|
421
|
+
/>
|
|
422
|
+
<Field
|
|
423
|
+
name="list"
|
|
424
|
+
label="Subtitles"
|
|
425
|
+
columns={[
|
|
426
|
+
{
|
|
427
|
+
propertyName: 'id',
|
|
428
|
+
label: 'Id',
|
|
429
|
+
size: '50px',
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
propertyName: 'locale',
|
|
433
|
+
label: 'Locale',
|
|
434
|
+
dataEntryRender: createInputRenderer({
|
|
435
|
+
placeholder: 'Enter Locale',
|
|
436
|
+
}),
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
propertyName: 'country',
|
|
440
|
+
label: 'Country',
|
|
441
|
+
dataEntryRender: createSelectRenderer({
|
|
442
|
+
options: [
|
|
443
|
+
{ value: 'Country 10', label: 'Country 10' },
|
|
444
|
+
{ value: 'Country 11', label: 'Country 11' },
|
|
445
|
+
{ value: 'Country 12', label: 'Country 12' },
|
|
446
|
+
],
|
|
447
|
+
placeholder: 'Enter Country',
|
|
448
|
+
}),
|
|
449
|
+
},
|
|
450
|
+
]}
|
|
451
|
+
data={listData}
|
|
452
|
+
positionPropertyName={'position'}
|
|
453
|
+
allowReordering={true}
|
|
454
|
+
allowRowDragging={true}
|
|
455
|
+
allowNewData={true}
|
|
456
|
+
as={DynamicDataListField}
|
|
457
|
+
/>
|
|
458
|
+
<Field
|
|
459
|
+
name="archived"
|
|
460
|
+
label="Set Archived"
|
|
461
|
+
as={CheckboxField}
|
|
462
|
+
/>
|
|
463
|
+
<Field
|
|
464
|
+
name="timestamp"
|
|
465
|
+
label="Timestamp"
|
|
466
|
+
mask="00:00:00.000"
|
|
467
|
+
as={MaskedSingleLineTextField}
|
|
468
|
+
/>
|
|
469
|
+
</FormGrid>
|
|
470
|
+
</TabPanel>
|
|
471
|
+
</Tabs>
|
|
451
472
|
</FormGrid>
|
|
452
473
|
</TabPanel>
|
|
453
474
|
<TabPanel>
|
|
@@ -4,32 +4,31 @@
|
|
|
4
4
|
@include boxSizing;
|
|
5
5
|
|
|
6
6
|
display: grid;
|
|
7
|
-
height:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
font-size: 16px;
|
|
12
|
-
border: 1px solid $blue;
|
|
7
|
+
height: 50px;
|
|
8
|
+
color: $blue;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
font-weight: bold;
|
|
13
11
|
border-bottom: none;
|
|
14
12
|
|
|
15
|
-
padding: 0
|
|
13
|
+
padding: 0 20px;
|
|
16
14
|
|
|
17
15
|
cursor: pointer;
|
|
16
|
+
outline: none;
|
|
18
17
|
|
|
19
18
|
&.selected {
|
|
20
19
|
background: white;
|
|
21
|
-
color: $dark-
|
|
22
|
-
border: 1px solid $light-gray;
|
|
23
|
-
border-bottom: none;
|
|
20
|
+
color: $dark-blue;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
background-color: $
|
|
28
|
-
|
|
23
|
+
&:hover:not(.selected):not(.disabled) {
|
|
24
|
+
background-color: $blue;
|
|
25
|
+
transition: background-color $confirmation-transition linear;
|
|
26
|
+
color: white;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
&.disabled {
|
|
30
|
+
color: $gray;
|
|
31
|
+
cursor: default;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
|
|
@@ -22,6 +22,7 @@ export const CustomTab: ReactTabsFunctionComponent<TabProps> = ({
|
|
|
22
22
|
{...otherProps}
|
|
23
23
|
className={classes.tab}
|
|
24
24
|
selectedClassName={classes.selected}
|
|
25
|
+
disabledClassName={classes.disabled}
|
|
25
26
|
data-test-id="tab"
|
|
26
27
|
>
|
|
27
28
|
<div className={classes.content} ref={ref}>
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
width: 100%;
|
|
8
8
|
white-space: nowrap;
|
|
9
9
|
grid-auto-flow: column;
|
|
10
|
-
grid-auto-columns:
|
|
11
|
-
gap: 2px;
|
|
10
|
+
grid-auto-columns: min-content;
|
|
12
11
|
|
|
13
12
|
-ms-overflow-style: none; /* IE and Edge */
|
|
14
13
|
scrollbar-width: none; /* Firefox */
|
|
@@ -21,11 +20,9 @@
|
|
|
21
20
|
|
|
22
21
|
.container {
|
|
23
22
|
display: grid;
|
|
24
|
-
// grid-template-columns: 50px auto 50px;
|
|
25
23
|
|
|
26
24
|
&.scroll {
|
|
27
25
|
grid-template-columns: 50px auto 50px;
|
|
28
|
-
gap: 2px;
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Button } from '../../../Buttons';
|
|
3
|
+
import { Button, ButtonContext } from '../../../Buttons';
|
|
4
4
|
import { IconName } from '../../../Icons';
|
|
5
5
|
import classes from './ScrollContainer.scss';
|
|
6
6
|
import { useScroll } from './useScroll';
|
|
@@ -18,6 +18,7 @@ export const ScrollContainer: React.FC = ({ children }) => {
|
|
|
18
18
|
return (
|
|
19
19
|
<div className={clsx(classes.container, { [classes.scroll]: showScroll })}>
|
|
20
20
|
<Button
|
|
21
|
+
buttonContext={ButtonContext.Icon}
|
|
21
22
|
icon={IconName.ChevronLeft}
|
|
22
23
|
onButtonClicked={scrollLeft}
|
|
23
24
|
className={clsx({ [classes.hide]: !showScroll })}
|
|
@@ -29,6 +30,7 @@ export const ScrollContainer: React.FC = ({ children }) => {
|
|
|
29
30
|
</div>
|
|
30
31
|
|
|
31
32
|
<Button
|
|
33
|
+
buttonContext={ButtonContext.Icon}
|
|
32
34
|
icon={IconName.ChevronRight}
|
|
33
35
|
onButtonClicked={scrollRight}
|
|
34
36
|
className={clsx({ [classes.hide]: !showScroll })}
|
|
@@ -8,13 +8,14 @@ import { Tab, TabList, TabPanel, Tabs } from '.';
|
|
|
8
8
|
import { createGroups } from '../../helpers/storybook';
|
|
9
9
|
|
|
10
10
|
const groups = createGroups({
|
|
11
|
-
Storybook: ['amount'],
|
|
11
|
+
Storybook: ['amount', 'disabled'],
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
type TabsStoryComponentProps = React.FC<
|
|
15
15
|
typeof Tabs & {
|
|
16
16
|
amount: number;
|
|
17
17
|
selectedIndex?: number;
|
|
18
|
+
disabled?: boolean;
|
|
18
19
|
}
|
|
19
20
|
>;
|
|
20
21
|
|
|
@@ -29,6 +30,11 @@ const meta: Meta<TabsStoryComponentProps> = {
|
|
|
29
30
|
type: 'number',
|
|
30
31
|
control: { type: 'number', min: 0, max: 30 },
|
|
31
32
|
},
|
|
33
|
+
disabled: {
|
|
34
|
+
...groups.disabled,
|
|
35
|
+
description: '<b>[Storybook only]</b> Disable the tabs.',
|
|
36
|
+
type: 'boolean',
|
|
37
|
+
},
|
|
32
38
|
children: {
|
|
33
39
|
table: {
|
|
34
40
|
disable: true,
|
|
@@ -40,13 +46,20 @@ const meta: Meta<TabsStoryComponentProps> = {
|
|
|
40
46
|
},
|
|
41
47
|
};
|
|
42
48
|
|
|
43
|
-
const generateItems = (
|
|
49
|
+
const generateItems = (
|
|
50
|
+
count: number,
|
|
51
|
+
disabled?: boolean,
|
|
52
|
+
): [JSX.Element[], JSX.Element[]] => {
|
|
44
53
|
const tabs = [];
|
|
45
54
|
const panels = [];
|
|
46
55
|
|
|
47
56
|
for (let i = 0; i < count; i++) {
|
|
48
57
|
const title = faker.random.words(faker.datatype.number({ min: 1, max: 3 }));
|
|
49
|
-
tabs.push(
|
|
58
|
+
tabs.push(
|
|
59
|
+
<Tab key={i} disabled={disabled}>
|
|
60
|
+
{title}
|
|
61
|
+
</Tab>,
|
|
62
|
+
);
|
|
50
63
|
panels.push(
|
|
51
64
|
<TabPanel key={i}>
|
|
52
65
|
<h2>{title}</h2>
|
|
@@ -62,7 +75,7 @@ export default meta;
|
|
|
62
75
|
|
|
63
76
|
export const Default: StoryObj<TabsStoryComponentProps> = {
|
|
64
77
|
render: (props) => {
|
|
65
|
-
const [tabs, panels] = generateItems(props.amount);
|
|
78
|
+
const [tabs, panels] = generateItems(props.amount, props.disabled);
|
|
66
79
|
|
|
67
80
|
return (
|
|
68
81
|
<Tabs>
|