Skip to content

Commit 96fe79f

Browse files
authored
fix: accordion - captures the width of the contents to the width of the accordion (#9807)
2 parents 5d55266 + 32bacec commit 96fe79f

File tree

48 files changed

+152
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+152
-111
lines changed

.github/workflows/update-snapshots.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,21 @@ jobs:
8484
run: git status
8585

8686
- name: Stage snapshot changes
87-
run: find packages \( -path '*/node_modules' -prune \) -o \( -path '*/__snapshots__/*' -o -path '*/snapshots/*' \) -print | xargs --no-run-if-empty git add --
87+
run: |
88+
# find does not follow symlinks by default, avoiding "beyond a symbolic link" git errors.
89+
# test-tag-name-transformer is excluded because its snapshots/ folder is listed in its .gitignore.
90+
find packages \( -path '*/node_modules' -o -path '*/test-tag-name-transformer' \) -prune \
91+
-o \( -path '*/__snapshots__/*' -o -path '*/snapshots/*' \) -print \
92+
| xargs --no-run-if-empty git add --
93+
94+
- name: Display git status (after git add)
95+
run: git status
8896

8997
- name: Commit and push changes
9098
uses: stefanzweifel/git-auto-commit-action@v7
9199
with:
92100
commit_message: Update all snapshots
101+
# Disable internal git add so that only the files staged above are committed.
102+
file_pattern: ''
93103
commit_user_name: '${{ steps.app-token.outputs.app-slug }}[bot]'
94104
commit_user_email: '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'

packages/components/src/components/@shared/_collapsible.mixin.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/* Forces the element into its own GPU compositing layer (via 3D transform). Helps prevent rendering/layout bugs (e.g. #7511) and may improve animation performance. */
2222
transform: translateZ(0);
2323
display: grid;
24+
grid-template-columns: minmax(0, 1fr);
2425
grid-template-rows: 0fr;
2526
transition: grid-template-rows 0.3s;
2627
}

packages/components/src/components/@shared/_form-field.mixin.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
}
1313

1414
&-text {
15-
display: ruby;
15+
flex-flow: row;
16+
align-items: flex-start;
17+
justify-content: flex-start;
1618
}
1719

1820
#{$root}--disabled & {

packages/samples/react/src/components/accordion/basic.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { KolAccordion, KolCombobox } from '@public-ui/react-v19';
3+
import { KolAccordion } from '@public-ui/react-v19';
44
import { SampleDescription } from '../SampleDescription';
55

66
import type { FC } from 'react';
@@ -16,7 +16,7 @@ export const AccordionBasic: FC = () => (
1616

1717
<div className="grid gap-4">
1818
<KolAccordion _label="Heading Accordion Tab 1 (open)" _open>
19-
<KolCombobox _label="Combobox in Accordion" _suggestions="['Herr','Frau','Firma']" />
19+
Contents Accordion Tab 1
2020
</KolAccordion>
2121
<KolAccordion _label="Heading Accordion Tab 2">Contents Accordion Tab 2</KolAccordion>
2222
<KolAccordion _label="Heading Accordion Tab 3 (deactivated)" _disabled>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from 'react';
2+
3+
import { KolAccordion, KolCombobox, KolTableStateful } from '@public-ui/react-v19';
4+
import { SampleDescription } from '../components/SampleDescription';
5+
6+
import type { FC } from 'react';
7+
8+
const DATA = [{ left: 'Left Example', center: 'Center Example', right: 'Right Example' }];
9+
10+
export const AccordionComponentContent: FC = () => (
11+
<>
12+
<SampleDescription>
13+
<p>KolAccordion can have other KoliBri components as content. Some are shown here.</p>
14+
</SampleDescription>
15+
16+
<div className="grid gap-4">
17+
<KolAccordion _label="With Combobox" _open>
18+
<KolCombobox _label="Combobox in Accordion" _suggestions="['Herr','Frau','Firma']" />
19+
</KolAccordion>
20+
<KolAccordion _label="With Table" _open>
21+
<KolTableStateful
22+
_label="Table for demonstration purposes with different text align properties"
23+
_headers={{
24+
horizontal: [
25+
[
26+
{ label: 'left', key: 'left', textAlign: 'left', width: 300 },
27+
{
28+
label: 'center',
29+
key: 'center',
30+
textAlign: 'center',
31+
width: 300,
32+
},
33+
{ label: 'right', key: 'right', textAlign: 'right', width: 300 },
34+
],
35+
],
36+
}}
37+
_data={DATA}
38+
/>
39+
</KolAccordion>
40+
</div>
41+
</>
42+
);

packages/samples/react/src/scenarios/routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Routes } from '../shares/types';
2+
import { AccordionComponentContent } from './accordionComponentContent';
23
import { ButtonShortkeyTable } from './button-shortkey-table';
34
import { ChangeTabindex } from './change-tabindex';
45
import { CustomTooltipCssProperties } from './custom-tooltip-css-properties';
@@ -37,6 +38,7 @@ export const SCENARIO_ROUTES: Routes = {
3738
'table-horizontal-scrollbar-advanced': TableHorizontalScrollAdvanced,
3839
'toolbar-item-order': ToolbarItemOrder,
3940
'tooltip-positioning': TooltipPositioning,
41+
'accordion-components': AccordionComponentContent,
4042
'z-index': ZIndexScenario,
4143
'performance-test': PerformanceTest,
4244
skeleton: Skeleton,

packages/test-tag-name-transformer/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"private": true,
44
"scripts": {
55
"prepare": "cpy \"../themes/default/snapshots\" ./ --dot",
6-
"test": "cross-env THEME_MODULE=theme ENABLE_TAG_NAME_TRANSFORMER=true kolibri-visual-test",
7-
"test:update:e2e": "cross-env THEME_MODULE=theme ENABLE_TAG_NAME_TRANSFORMER=true kolibri-visual-test --update-snapshots=changed theme-snapshots.spec.js"
6+
"test": "cross-env THEME_MODULE=theme ENABLE_TAG_NAME_TRANSFORMER=true kolibri-visual-test"
87
},
98
"devDependencies": {
109
"@public-ui/themes": "workspace:*",
-1.51 KB
Loading
1.25 KB
Loading
11.6 KB
Loading

0 commit comments

Comments
 (0)