@box/blueprint-web 12.27.0 → 12.28.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.
|
@@ -7,6 +7,7 @@ import { IconButton } from '../primitives/icon-button/icon-button.js';
|
|
|
7
7
|
import { Slot } from '../primitives/slot.js';
|
|
8
8
|
import { useNamedSlots } from '../utils/useNamedSlots.hook.js';
|
|
9
9
|
import styles from './collapsible-section.module.js';
|
|
10
|
+
import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
|
|
10
11
|
|
|
11
12
|
const CollapsibleSectionImpl = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
12
13
|
const {
|
|
@@ -18,6 +19,9 @@ const CollapsibleSectionImpl = /*#__PURE__*/forwardRef((props, forwardedRef) =>
|
|
|
18
19
|
children,
|
|
19
20
|
...rest
|
|
20
21
|
} = props;
|
|
22
|
+
const {
|
|
23
|
+
enableModernizedComponents
|
|
24
|
+
} = useBlueprintModernization();
|
|
21
25
|
const [collapsibleSectionOpen, setCollapsibleSectionOpen] = useState(open);
|
|
22
26
|
const [headerSlot, contentSlot] = useNamedSlots(children, ['header', 'content']);
|
|
23
27
|
useEffect(() => {
|
|
@@ -31,6 +35,7 @@ const CollapsibleSectionImpl = /*#__PURE__*/forwardRef((props, forwardedRef) =>
|
|
|
31
35
|
...rest,
|
|
32
36
|
ref: forwardedRef,
|
|
33
37
|
className: clsx(styles.collapsibleSection, className),
|
|
38
|
+
"data-modern": enableModernizedComponents,
|
|
34
39
|
onOpenChange: onCollapsibleOpenChanged,
|
|
35
40
|
open: collapsibleSectionOpen,
|
|
36
41
|
children: [jsx(Collapsible.Trigger, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"collapsibleSection":"bp_collapsible_section_module_collapsibleSection--
|
|
2
|
+
var styles = {"collapsibleSection":"bp_collapsible_section_module_collapsibleSection--e6aba","collapsibleSectionHeader":"bp_collapsible_section_module_collapsibleSectionHeader--e6aba","collapsibleSectionHeaderArrow":"bp_collapsible_section_module_collapsibleSectionHeaderArrow--e6aba","collapsibleSectionContent":"bp_collapsible_section_module_collapsibleSectionContent--e6aba","slideDown":"bp_collapsible_section_module_slideDown--e6aba","slideUp":"bp_collapsible_section_module_slideUp--e6aba","collapsibleSectionBody":"bp_collapsible_section_module_collapsibleSectionBody--e6aba"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
package/dist/lib-esm/index.css
CHANGED
|
@@ -1723,70 +1723,96 @@
|
|
|
1723
1723
|
height:var(--icon-button-size-x-small);
|
|
1724
1724
|
width:var(--icon-button-size-x-small);
|
|
1725
1725
|
}
|
|
1726
|
-
.bp_collapsible_section_module_collapsibleSection--
|
|
1726
|
+
.bp_collapsible_section_module_collapsibleSection--e6aba[data-modern=false]{
|
|
1727
|
+
--collapsible-section-padding:var(--space-5);
|
|
1728
|
+
--collapsible-section-border-radius:var(--radius-3);
|
|
1729
|
+
--collapsible-section-outline-border-radius:var(--radius-2);
|
|
1730
|
+
--collapsible-section-background-color:var(--surface-surface);
|
|
1731
|
+
--collapsible-section-border:var(--border-1) solid var(--border-collapsible-border);
|
|
1732
|
+
--collapsible-section-outline-width:var(--border-2);
|
|
1733
|
+
--collapsible-section-outline-offset:var(--space-05);
|
|
1734
|
+
--collapsible-section-header-focus-color:var(--outline-focus-on-light);
|
|
1735
|
+
--collapsible-section-header-background-color:var(--surface-surface);
|
|
1736
|
+
--collapsible-section-content-background-color:var(--surface-surface);
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
.bp_collapsible_section_module_collapsibleSection--e6aba[data-modern=true]{
|
|
1740
|
+
--collapsible-section-padding:var(--bp-space-050);
|
|
1741
|
+
--collapsible-section-border-radius:var(--bp-radius-10);
|
|
1742
|
+
--collapsible-section-outline-border-radius:var(--bp-radius-03);
|
|
1743
|
+
--collapsible-section-background-color:var(--bp-surface-surface);
|
|
1744
|
+
--collapsible-section-border:var(--bp-border-01) solid var(--bp-border-collapsible-border);
|
|
1745
|
+
--collapsible-section-outline-width:var(--bp-border-02);
|
|
1746
|
+
--collapsible-section-outline-offset:var(--bp-space-005);
|
|
1747
|
+
--collapsible-section-header-focus-color:var(--bp-outline-focus-on-light);
|
|
1748
|
+
--collapsible-section-header-background-color:var(--bp-surface-surface);
|
|
1749
|
+
--collapsible-section-content-background-color:var(--bp-surface-surface);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
.bp_collapsible_section_module_collapsibleSection--e6aba{
|
|
1727
1753
|
width:100%;
|
|
1728
1754
|
}
|
|
1729
|
-
.bp_collapsible_section_module_collapsibleSectionHeader--
|
|
1755
|
+
.bp_collapsible_section_module_collapsibleSectionHeader--e6aba{
|
|
1730
1756
|
align-items:center;
|
|
1731
|
-
background:var(--
|
|
1732
|
-
border:var(--
|
|
1733
|
-
border-radius:var(--radius
|
|
1757
|
+
background:var(--collapsible-section-header-background-color);
|
|
1758
|
+
border:var(--collapsible-section-border);
|
|
1759
|
+
border-radius:var(--collapsible-section-border-radius);
|
|
1734
1760
|
box-sizing:border-box;
|
|
1735
1761
|
cursor:pointer;
|
|
1736
1762
|
display:flex;
|
|
1737
1763
|
justify-content:space-between;
|
|
1738
1764
|
outline:0;
|
|
1739
|
-
padding-block:var(--
|
|
1740
|
-
padding-inline:var(--
|
|
1765
|
+
padding-block:var(--collapsible-section-padding);
|
|
1766
|
+
padding-inline:var(--collapsible-section-padding);
|
|
1741
1767
|
position:relative;
|
|
1742
1768
|
-webkit-user-select:none;
|
|
1743
1769
|
user-select:none;
|
|
1744
1770
|
width:100%;
|
|
1745
1771
|
}
|
|
1746
|
-
.bp_collapsible_section_module_collapsibleSectionHeader--
|
|
1747
|
-
border:var(--
|
|
1748
|
-
border-radius:var(--radius
|
|
1749
|
-
bottom:var(--
|
|
1772
|
+
.bp_collapsible_section_module_collapsibleSectionHeader--e6aba:focus::before{
|
|
1773
|
+
border:var(--collapsible-section-outline-width) solid var(--collapsible-section-header-focus-color);
|
|
1774
|
+
border-radius:var(--collapsible-section-outline-border-radius);
|
|
1775
|
+
bottom:var(--collapsible-section-outline-offset);
|
|
1750
1776
|
content:"";
|
|
1751
|
-
left:var(--
|
|
1777
|
+
left:var(--collapsible-section-outline-offset);
|
|
1752
1778
|
position:absolute;
|
|
1753
|
-
right:var(--
|
|
1754
|
-
top:var(--
|
|
1779
|
+
right:var(--collapsible-section-outline-offset);
|
|
1780
|
+
top:var(--collapsible-section-outline-offset);
|
|
1755
1781
|
}
|
|
1756
|
-
.bp_collapsible_section_module_collapsibleSectionHeader--
|
|
1782
|
+
.bp_collapsible_section_module_collapsibleSectionHeader--e6aba[aria-expanded=true],.bp_collapsible_section_module_collapsibleSectionHeader--e6aba[aria-expanded=true]::before{
|
|
1757
1783
|
border-end-end-radius:0;
|
|
1758
1784
|
border-end-start-radius:0;
|
|
1759
1785
|
}
|
|
1760
|
-
.bp_collapsible_section_module_collapsibleSectionHeaderArrow--
|
|
1786
|
+
.bp_collapsible_section_module_collapsibleSectionHeaderArrow--e6aba{
|
|
1761
1787
|
display:block;
|
|
1762
|
-
margin-inline-start:var(--
|
|
1788
|
+
margin-inline-start:var(--collapsible-section-padding);
|
|
1763
1789
|
}
|
|
1764
|
-
.bp_collapsible_section_module_collapsibleSectionHeaderArrow--
|
|
1790
|
+
.bp_collapsible_section_module_collapsibleSectionHeaderArrow--e6aba > svg{
|
|
1765
1791
|
vertical-align:middle;
|
|
1766
1792
|
}
|
|
1767
|
-
.bp_collapsible_section_module_collapsibleSectionContent--
|
|
1793
|
+
.bp_collapsible_section_module_collapsibleSectionContent--e6aba{
|
|
1768
1794
|
overflow:hidden;
|
|
1769
1795
|
}
|
|
1770
|
-
.bp_collapsible_section_module_collapsibleSectionContent--
|
|
1771
|
-
animation:bp_collapsible_section_module_slideDown--
|
|
1796
|
+
.bp_collapsible_section_module_collapsibleSectionContent--e6aba[data-state=open]{
|
|
1797
|
+
animation:bp_collapsible_section_module_slideDown--e6aba .25s ease-out;
|
|
1772
1798
|
}
|
|
1773
|
-
.bp_collapsible_section_module_collapsibleSectionContent--
|
|
1774
|
-
animation:bp_collapsible_section_module_slideUp--
|
|
1799
|
+
.bp_collapsible_section_module_collapsibleSectionContent--e6aba[data-state=closed]{
|
|
1800
|
+
animation:bp_collapsible_section_module_slideUp--e6aba .25s ease-out;
|
|
1775
1801
|
}
|
|
1776
|
-
.bp_collapsible_section_module_collapsibleSectionBody--
|
|
1802
|
+
.bp_collapsible_section_module_collapsibleSectionBody--e6aba{
|
|
1777
1803
|
align-items:center;
|
|
1778
|
-
background:var(--
|
|
1779
|
-
border:var(--
|
|
1780
|
-
border-end-end-radius:var(--radius
|
|
1781
|
-
border-end-start-radius:var(--radius
|
|
1804
|
+
background:var(--collapsible-section-content-background-color);
|
|
1805
|
+
border:var(--collapsible-section-border);
|
|
1806
|
+
border-end-end-radius:var(--collapsible-section-border-radius);
|
|
1807
|
+
border-end-start-radius:var(--collapsible-section-border-radius);
|
|
1782
1808
|
border-top:none;
|
|
1783
1809
|
display:flex;
|
|
1784
1810
|
justify-content:space-between;
|
|
1785
|
-
padding-block:var(--
|
|
1786
|
-
padding-inline:var(--
|
|
1811
|
+
padding-block:var(--collapsible-section-padding);
|
|
1812
|
+
padding-inline:var(--collapsible-section-padding);
|
|
1787
1813
|
}
|
|
1788
1814
|
|
|
1789
|
-
@keyframes bp_collapsible_section_module_slideDown--
|
|
1815
|
+
@keyframes bp_collapsible_section_module_slideDown--e6aba{
|
|
1790
1816
|
from{
|
|
1791
1817
|
height:0;
|
|
1792
1818
|
}
|
|
@@ -1794,7 +1820,7 @@
|
|
|
1794
1820
|
height:var(--radix-collapsible-content-height);
|
|
1795
1821
|
}
|
|
1796
1822
|
}
|
|
1797
|
-
@keyframes bp_collapsible_section_module_slideUp--
|
|
1823
|
+
@keyframes bp_collapsible_section_module_slideUp--e6aba{
|
|
1798
1824
|
from{
|
|
1799
1825
|
height:var(--radix-collapsible-content-height);
|
|
1800
1826
|
}
|