@scality/core-ui 0.126.0 → 0.128.0

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.
Files changed (27) hide show
  1. package/dist/components/inputv2/inputv2.d.ts.map +1 -1
  2. package/dist/components/inputv2/inputv2.js +8 -0
  3. package/dist/components/searchinput/SearchInput.component.d.ts +1 -0
  4. package/dist/components/searchinput/SearchInput.component.d.ts.map +1 -1
  5. package/dist/components/searchinput/SearchInput.component.js +2 -2
  6. package/dist/components/tabsv2/StyledTabs.d.ts +1 -0
  7. package/dist/components/tabsv2/StyledTabs.d.ts.map +1 -1
  8. package/dist/components/tabsv2/StyledTabs.js +8 -4
  9. package/dist/components/tabsv2/Tab.d.ts +1 -0
  10. package/dist/components/tabsv2/Tab.d.ts.map +1 -1
  11. package/dist/components/tabsv2/Tabsv2.component.d.ts +3 -3
  12. package/dist/components/tabsv2/Tabsv2.component.d.ts.map +1 -1
  13. package/dist/components/tabsv2/Tabsv2.component.js +6 -7
  14. package/dist/components/tabsv2/useScrollingTabs.d.ts +1 -1
  15. package/dist/components/tabsv2/useScrollingTabs.d.ts.map +1 -1
  16. package/dist/organisms/attachments/AttachmentTable.d.ts.map +1 -1
  17. package/dist/organisms/attachments/AttachmentTable.js +115 -121
  18. package/package.json +1 -1
  19. package/src/lib/components/inputv2/inputv2.tsx +8 -0
  20. package/src/lib/components/searchinput/SearchInput.component.tsx +3 -0
  21. package/src/lib/components/tabsv2/StyledTabs.ts +12 -6
  22. package/src/lib/components/tabsv2/Tab.ts +1 -0
  23. package/src/lib/components/tabsv2/Tabsv2.component.tsx +45 -36
  24. package/src/lib/components/tabsv2/useScrollingTabs.ts +1 -1
  25. package/src/lib/organisms/attachments/AttachmentTable.tsx +203 -211
  26. package/stories/attachment.stories.tsx +5 -1
  27. package/stories/tabsv2.stories.tsx +56 -40
@@ -5,15 +5,23 @@ import { Wrapper, Title } from './common';
5
5
  import { BrowserRouter } from 'react-router-dom';
6
6
  import { brand, spacing } from '../src/lib/style/theme';
7
7
  import styled from 'styled-components';
8
- import { useLocation } from 'react-router';
8
+ import { MemoryRouter, Route, useLocation } from 'react-router';
9
+
9
10
  const Content = styled.div`
10
11
  padding: ${spacing.sp24};
11
12
  color: ${(props) => props.theme.textPrimary};
13
+ height: 100%;
12
14
  `;
13
15
  export default {
14
16
  title: 'Components/Navigation/Tabs',
15
17
  component: Tabs,
16
- decorators: [(story) => <BrowserRouter>{story()}</BrowserRouter>],
18
+ decorators: [
19
+ (story) => (
20
+ <BrowserRouter>
21
+ <Wrapper style={{ minHeight: '30rem' }}>{story()}</Wrapper>
22
+ </BrowserRouter>
23
+ ),
24
+ ],
17
25
  argTypes: {
18
26
  activeTabSeparator: {
19
27
  control: {
@@ -79,44 +87,52 @@ const DefaultTabsDetails = (props) => {
79
87
  <Title>
80
88
  {location.pathname} / {location.search}
81
89
  </Title>
82
- <Tabs {...props}>
83
- <Tab path="/iframe.html" label="Users">
84
- <Content>Users Content</Content>
85
- </Tab>
86
- <Tab
87
- path="/path1"
88
- query={{
89
- tab: 'group',
90
- }}
91
- label="Groups"
92
- >
93
- {details()}
94
- </Tab>
95
- <Tab
96
- path="/path1"
97
- query={{
98
- tab: 'role @',
99
- }}
100
- label="Roles"
101
- >
102
- {details()}
103
- </Tab>
104
- <Tab
105
- path="/path1"
106
- query={{
107
- tab: 'policies',
108
- }}
109
- label="Policies"
110
- >
111
- {details()}
112
- </Tab>
113
- <Tab path="/path4" label="Storage Location">
114
- <Content>Storage Location Content</Content>
115
- </Tab>
116
- <Tab path="/path5" label="Properties">
117
- <Content>Properties Content</Content>
118
- </Tab>
119
- </Tabs>
90
+ <MemoryRouter initialEntries={['/path?tab=group']} initialIndex={0}>
91
+ <Route
92
+ path="/:path?"
93
+ render={() => (
94
+ <Tabs {...props}>
95
+ <Tab path="/path" label="Users" withoutPadding>
96
+ <Content>Users Content</Content>
97
+ </Tab>
98
+ <Tab
99
+ path="/path1"
100
+ query={{
101
+ tab: 'group',
102
+ }}
103
+ label="Groups"
104
+ >
105
+ {details()}
106
+ </Tab>
107
+ <Tab
108
+ path="/path1"
109
+ query={{
110
+ tab: 'role',
111
+ }}
112
+ label="Roles"
113
+ withoutPadding
114
+ >
115
+ <Content>Roles content</Content>
116
+ </Tab>
117
+ <Tab
118
+ path="/path1"
119
+ query={{
120
+ tab: 'policies',
121
+ }}
122
+ label="Policies"
123
+ >
124
+ <Content>Policies content</Content>
125
+ </Tab>
126
+ <Tab path="/path4" label="Storage Location">
127
+ <Content>Storage Location Content</Content>
128
+ </Tab>
129
+ <Tab path="/path5" label="Properties">
130
+ <Content>Properties Content</Content>
131
+ </Tab>
132
+ </Tabs>
133
+ )}
134
+ />
135
+ </MemoryRouter>
120
136
  </>
121
137
  );
122
138
  };