@thecb/components 9.3.1-beta.7 → 9.3.1-beta.8

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": "@thecb/components",
3
- "version": "9.3.1-beta.7",
3
+ "version": "9.3.1-beta.8",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -8,6 +8,7 @@ import { Box, Cluster, Stack, Motion } from "../../atoms/layouts";
8
8
  import { createIdFromString, noop } from "../../../util/general";
9
9
  import Text from "../../atoms/text";
10
10
  import { CHARADE_GREY } from "../../../constants/colors";
11
+ import SolidDivider from "../../atoms/solid-divider/SolidDivider";
11
12
  /*
12
13
  Takes an array of section objects, each object should look like:
13
14
  {
@@ -50,9 +51,7 @@ const RadioSection = ({
50
51
  ariaDescribedBy,
51
52
  isSectionRequired = false
52
53
  }) => {
53
- console.log("sections", sections);
54
54
  const areSectionsGrouped = typeof sections?.[0]?.[0] !== "undefined";
55
- console.log("areSectionsGrouped", areSectionsGrouped);
56
55
  const handleKeyDown = (id, e) => {
57
56
  if (e?.keyCode === 13 || e?.keyCode === 32) {
58
57
  toggleOpenSection(id);
@@ -383,6 +382,13 @@ const RadioSection = ({
383
382
  )}
384
383
  </AnimatePresence>
385
384
  </Stack>
385
+ {sectionGroup.indexOf(section) ===
386
+ sectionGroup.length - 1 && (
387
+ <SolidDivider
388
+ borderSize="2px"
389
+ borderColor={themeValues.borderColor}
390
+ />
391
+ )}
386
392
  </Motion>
387
393
  ))
388
394
  )}
@@ -2,6 +2,7 @@ import React, { Fragment, useState } from "react";
2
2
  import { text, boolean } from "@storybook/addon-knobs";
3
3
  import SolidDivider from "../../atoms/solid-divider/SolidDivider";
4
4
  import RadioSection from "./RadioSection";
5
+ import { Box } from "../../atoms/layouts";
5
6
  import page from "../../../../.storybook/page";
6
7
 
7
8
  const story = page({
@@ -75,6 +76,7 @@ const groupedSections = [
75
76
 
76
77
  export const radioSection = () => {
77
78
  const [openSection, setOpenSection] = useState("");
79
+ const [openSectionGrouped, setOpenSectionGrouped] = useState(null);
78
80
  return (
79
81
  <Fragment>
80
82
  <RadioSection
@@ -86,12 +88,12 @@ export const radioSection = () => {
86
88
  sections={sections}
87
89
  isSectionRequired={true}
88
90
  />
89
- <SolidDivider />
91
+ <Box />
90
92
  <RadioSection
91
93
  isMobile={boolean("isMobile", false, "props")}
92
94
  supportsTouch={boolean("isMobile", false, "props")}
93
- toggleOpenSection={setOpenSection}
94
- openSection={openSection}
95
+ toggleOpenSection={setOpenSectionGrouped}
96
+ openSection={openSectionGrouped}
95
97
  staggeredAnimation={boolean("staggeredAnimation", false, "props")}
96
98
  sections={groupedSections}
97
99
  isSectionRequired={true}