@axinom/mosaic-ui 0.63.0-rc.0 → 0.63.0-rc.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-ui",
3
- "version": "0.63.0-rc.0",
3
+ "version": "0.63.0-rc.1",
4
4
  "description": "UI components for building Axinom Mosaic applications",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -112,5 +112,5 @@
112
112
  "publishConfig": {
113
113
  "access": "public"
114
114
  },
115
- "gitHead": "c111f5f22c27fa1ceaff19826888a61590b80651"
115
+ "gitHead": "6425b41d87ac24779772f202eb544e2574d9f614"
116
116
  }
@@ -5,6 +5,7 @@ import { default as React, ReactNode, useEffect, useState } from 'react';
5
5
  import { createGroups, generateItemArray } from '../../helpers/storybook';
6
6
  import { TextButton } from '../Buttons/TextButton/TextButton';
7
7
  import { Divider } from '../FormElements';
8
+ import { List } from '../List';
8
9
  import { Accordion } from './Accordion';
9
10
  import { AccordionItem } from './AccordionItem/AccordionItem';
10
11
 
@@ -17,12 +18,13 @@ const groups = createGroups({
17
18
  const generateItems = (
18
19
  startIndex?: number,
19
20
  sticky?: boolean,
21
+ children?: JSX.Element,
20
22
  ): JSX.Element[] => {
21
23
  return generateItemArray(10, (index) => {
22
24
  const key = index + (startIndex ?? 1);
23
25
  return (
24
26
  <AccordionItem key={key} header={<b>Item {key}</b>} sticky={sticky}>
25
- <p>{faker.lorem.paragraph(20)}</p>
27
+ {children ?? <p>{faker.lorem.paragraph(20)}</p>}
26
28
  </AccordionItem>
27
29
  );
28
30
  });
@@ -56,7 +58,7 @@ export const Default: StoryObj<typeof Accordion> = {
56
58
  render: (args) => <Accordion {...args} header={<b>{args.header}</b>} />,
57
59
  args: {
58
60
  children: generateItems(),
59
- header: 'Header' as any,
61
+ header: 'Header' as unknown as JSX.Element,
60
62
  },
61
63
  name: 'Default',
62
64
  };
@@ -103,3 +105,43 @@ export const AddingAndShuffling: StoryObj<typeof Accordion> = {
103
105
  },
104
106
  name: 'Adding and shuffling',
105
107
  };
108
+
109
+ export const NestedSticky: StoryObj<typeof Accordion> = {
110
+ args: {
111
+ ...Default.args,
112
+ children: generateItems(
113
+ 1,
114
+ true,
115
+ <div style={{ height: '350px' }}>
116
+ <List
117
+ columns={[
118
+ {
119
+ propertyName: 'id',
120
+ label: 'Id',
121
+ size: '50px',
122
+ },
123
+ {
124
+ propertyName: 'title',
125
+ label: 'Title',
126
+ },
127
+ {
128
+ propertyName: 'desc',
129
+ label: 'Description',
130
+ },
131
+ ]}
132
+ data={generateItemArray(10, (index) => ({
133
+ id: index + 1,
134
+ desc: `Description ${index + 1}: ${faker.lorem.words(
135
+ faker.datatype.number({ min: 10, max: 50 }),
136
+ )}`,
137
+ title: `Item ${index + 1}: ${faker.random.words(
138
+ faker.datatype.number({ min: 1, max: 3 }),
139
+ )}`,
140
+ }))}
141
+ />
142
+ </div>,
143
+ ),
144
+ stickyRows: true,
145
+ },
146
+ name: 'Nested Sticky',
147
+ };
@@ -23,6 +23,7 @@
23
23
  }
24
24
 
25
25
  &.sticky {
26
+ z-index: 1;
26
27
  position: sticky;
27
28
  top: 50px;
28
29
  }