@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.
@@ -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,CA2B1D,CAAC"}
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,EA+BnC,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.12",
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.12",
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": "3d1d61402edfb5b7fe5281f95791d31a4fb34174"
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
- <Field
376
- name="shortDescription"
377
- label="Short Description"
378
- placeholder="Enter a short description..."
379
- as={SingleLineTextField}
380
- />
381
- <Field
382
- name="longDescription"
383
- label="Long Description"
384
- placeholder="Enter a description..."
385
- as={SingleLineTextField}
386
- />
387
- <Field name="cast" label="Cast" as={CustomTagsField} />
388
- <Field name="released" label="Released" as={DateTimeTextField} />
389
- <Field
390
- name="password"
391
- label="Password"
392
- as={SingleLineTextField}
393
- type="password"
394
- />
395
-
396
- <Field
397
- name="licenses"
398
- label="License Countries"
399
- tagsOptions={[
400
- { value: 'DE', key: 'Germany' },
401
- { value: 'EE', key: 'Estonia' },
402
- { value: 'LK', key: 'Sri Lanka' },
403
- ]}
404
- as={TagsField}
405
- displayKey="key"
406
- valueKey="value"
407
- />
408
- <Field
409
- name="list"
410
- label="Subtitles"
411
- columns={[
412
- {
413
- propertyName: 'id',
414
- label: 'Id',
415
- size: '50px',
416
- },
417
- {
418
- propertyName: 'locale',
419
- label: 'Locale',
420
- dataEntryRender: createInputRenderer({
421
- placeholder: 'Enter Locale',
422
- }),
423
- },
424
- {
425
- propertyName: 'country',
426
- label: 'Country',
427
- dataEntryRender: createSelectRenderer({
428
- options: [
429
- { value: 'Country 10', label: 'Country 10' },
430
- { value: 'Country 11', label: 'Country 11' },
431
- { value: 'Country 12', label: 'Country 12' },
432
- ],
433
- placeholder: 'Enter Country',
434
- }),
435
- },
436
- ]}
437
- data={listData}
438
- positionPropertyName={'position'}
439
- allowReordering={true}
440
- allowRowDragging={true}
441
- allowNewData={true}
442
- as={DynamicDataListField}
443
- />
444
- <Field name="archived" label="Set Archived" as={CheckboxField} />
445
- <Field
446
- name="timestamp"
447
- label="Timestamp"
448
- mask="00:00:00.000"
449
- as={MaskedSingleLineTextField}
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: 49px;
8
- min-width: 180px;
9
- background-color: $blue;
10
- color: white;
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 15px;
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-gray;
22
- border: 1px solid $light-gray;
23
- border-bottom: none;
20
+ color: $dark-blue;
24
21
  }
25
22
 
26
- &.disabled {
27
- background-color: $dark-gray;
28
- cursor: default;
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
- &:focus {
32
- outline: none;
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}>
@@ -4,4 +4,6 @@
4
4
  border: none;
5
5
  margin: 0;
6
6
  padding: 0;
7
+ background-color: $light-gray-2;
8
+ border-top: 1px solid $light-gray-2;
7
9
  }
@@ -7,8 +7,7 @@
7
7
  width: 100%;
8
8
  white-space: nowrap;
9
9
  grid-auto-flow: column;
10
- grid-auto-columns: minmax(max-content, auto);
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 })}
@@ -1,7 +1,6 @@
1
1
  @import '../../../styles/common.scss';
2
2
 
3
3
  .tabpanel {
4
- border-bottom: 1px solid $light-gray;
5
4
  display: none;
6
5
 
7
6
  &.selected {
@@ -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 = (count: number): [JSX.Element[], JSX.Element[]] => {
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(<Tab key={i}>{title}</Tab>);
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>