# @workwave-tidal/stories-helpers

## 1.0.1

### Patch Changes

- 6d6535b: Bump `vite` to `5.4.11`
- Updated dependencies [ddfb20b]
  - @workwave-tidal/license-utils@0.1.0

## 1.0.0

### Major Changes

- 1f55c39: Tidal@3 release. Bump all packages to the next version.

### Minor Changes

- 2d61f0b: [See CUI-505](https://workwave.atlassian.net/browse/CUI-505)

  # Dark theme

  Component stories has been updated to render as expected in dark mode.
  A new button has been added on the preview app sidebar to toggle the dark mode.

- 46056ce: ## Disable Stories Panels via URL

  See [CUI-554](https://workwave.atlassian.net/browse/CUI-554)

  Tidal stories now supports a new `nopanels` boolean URL parameter which hides the top, right, bottom, and left control panels.

- 56c1956: [See CUI-493](https://workwave.atlassian.net/browse/CUI-493)

  Add tidal watermark & validate license logic

## 1.0.0-next.2

### Major Changes

- 1f55c39: Tidal@3 release. Bump all packages to the next version.

## 0.5.0-next.1

### Minor Changes

- 46056ce: ## Disable Stories Panels via URL

  See [CUI-554](https://workwave.atlassian.net/browse/CUI-554)

  Tidal stories now supports a new `nopanels` boolean URL parameter which hides the top, right, bottom, and left control panels.

## 0.5.0-next.0

### Minor Changes

- 2d61f0b: [See CUI-505](https://workwave.atlassian.net/browse/CUI-505)

  # Dark theme

  Component stories has been updated to render as expected in dark mode.
  A new button has been added on the preview app sidebar to toggle the dark mode.

- 56c1956: [See CUI-493](https://workwave.atlassian.net/browse/CUI-493)

  Add tidal watermark & validate license logic

## 0.4.0

### Minor Changes

- 842bc976: [See CUI-506](https://workwave.atlassian.net/browse/CUI-506)

  Fix the preview app by removing the "Unknown" in the left panel.

## 0.3.1

### Patch Changes

- c2e2feb4: See [CUI-473](https://workwave.atlassian.net/browse/CUI-473).

  Re-export `@mui/base` core utils from `@workwave-tidal/base`.
  To simplify the maintenance of the mono-repo peer dependencies, we are making `@mui/base` a direct dependency of `@workwave-tidal/base`. Any interested package will access it from `@workwave-tidal/base`.

  > [!WARNING]
  > Please remember that `@workwave-tidal/base` is considered a private package and should not be installed by the end users.

- b3e33b22: See [CUI-472](https://workwave.atlassian.net/browse/CUI-472).

  Until `tidal@2.0.0`, we allowed `MUI` and `tidal` peer dependencies using a range of versions.
  Having a version of `MUI` different from the version expected by `tidal` can lead to performance issues with the `TypeScript` compiler.
  We are converting all those dependencies to an exact version. Consumers can still install a different version, but it is highly discouraged.

## 0.3.0

### Minor Changes

- 8ed1fbbb: See [CUI-423](https://workwave.atlassian.net/browse/CUI-423).
  We are expanding Tidal Stories' capabilities.

  New features:

  - All four side containers can be populated at runtime.
  - Every container has a configuration object: `{ hideTabs?: boolean; disableResize?: boolean; initialSize?: number; minSize?: number; }``. The configuration is accessible only at runtime.
  - New parameters added to Tidal Stories' public state:
    - `disableKeybindings`: turn off all Tidal Stories keyboard shortcuts.
    - `navigationDisabled`: prevent any navigation through the UI or the public API. The user can navigate only by changing the URL.
    - `globalControlsConfig`: the new configuration for the four side containers.
    - Tidal Stories' public state now has corresponding setter functions. Every aspect of the state can be dynamically changed, including the active story.
    - Tidal Stories' public state is still mirrored in the URL (with an improved algorithm) but is maintained in a tidal/store instance.

## 0.2.0

### Minor Changes

- bb868c44: See [CUI-393](https://workwave.atlassian.net/browse/CUI-393).
  The Global controls `react` `<Context Provider>` is creating an infinite rendering loop when there are controls in the page.

## 0.1.1

### Patch Changes

- 87311619: ## Toolbar

  See [CUI-356](https://workwave.atlassian.net/browse/CUI-356)

  The `Toolbar` component allows you to render a Story and other panels in a layout that mimics a development tool panel.
  The purpose of this component is to render the Story in the main section, while rendering the Tools related to the story itself in the bottom section.
  The Tools will be rendered in tabs, and only one tool can be active at a time.
  The Tools section can be dragged to resize it.

- 87311619: See [CUI-356](https://workwave.atlassian.net/browse/CUI-356)

  Allow the consumer of Tidal stories to provide four slots `top`, `bottom`, `left`, and `right`.
  Each slot can be configured to be an array of components that will be wrapped together.
  Finally every component will be placed in the preview app.

  The final composition will be something like this:

  | ----------------- top ----------------- |
  | left | ------- content -------- | right |
  | --------------- bottom ---------------- |

- 9bfce17a: Refactor leva deps in favor of the useControls of @workwave-tidal/controls

## 0.1.0

### Minor Changes

- e435fba1: Tidal stories enhancements:

  - read new meta data from CSF files (`.stories.*`)
    - `searchTags` `string[]` of tags to applied to all stories in the file
    - `componentName` `string` name of the component to associate with all stories in the file
  - we now include absolute file path when parsing stories for id generation (coming soon) and `@tidal-searchTag` tag mapping
  - above mentioned meta data is now included in the generated stories tree

  ### `searchTags`` Example

  The `useCopyToClipboard` hook requires additional browser permissions. We can tag all related stories with `permissions` to help users find it.

  ###### `hooks/useCopyToClipboard/useCopyToClipboard.stories.tsx`

  ```tsx
  export default {
    title: "useCopyToClipboard",
    searchTags: ["permission"],
  };

  export { default as README } from "./README.md";
  export { default as Simple } from "./stories/Simple.mdx";
  export { default as CopyStatus } from "./stories/CopyStatus.mdx";
  ```

  ### `@tidal-searchTags` Pragma Example

  The `Section` componenent has a story which was built as a POC for another application. We can tag this story with `poc` and `prototype` to make it easier to find.

  ###### `components/src/Section/stories/CIPDemo.tsx`

  ```tsx
  // @tidal-searchTags tag=poc tag=prototype
  import { ReactNode } from "react";
  import {
    Card,
    IconButton,
    Stack,
    Box,
    Typography,
    TypographyProps,
    colors,
  } from "@mui/material";
  import { AddCircle, OpenInNew, Warning } from "@mui/icons-material";
  import { Story, Container } from "@workwave-tidal/stories-helpers";

  import { Section } from "../Section.js";
  import { SectionItem } from "../SectionItem.js";
  import { ActionBarItem } from "../../ActionBar/index.js";

  // ...rest
  ```

  See [CUI-357](https://workwave.atlassian.net/browse/CUI-357)

## 0.0.18

### Patch Changes

- f397a218: Bumping all packages having `@workwave-tidal/base` as a peer-dependency,
  because otherwise consuming `@workwave-tidal/tidal` could lead to unexpected errors during compile-time.

## 0.0.17

### Patch Changes

- 8b5b268d: `chore` `DocsExample` content is now top aligned.

## 0.0.16

### Patch Changes

- 17add75d: CUI-330 fix incorrect react version syntax

## 0.0.15

### Patch Changes

- 5a1066a1: CUI-330 update repository peer dependencies to support react 17 or 18

## 0.0.14

### Patch Changes

- 85c20edd: Introduce `tidal version` management in the `window` object.
  Using `@workwave-tidal/base/registerTidalVersion` every package will register itself when loaded into the browser.
  The `build` process will read the package name and version from the project `package.json` file.
- 27f69e6c: See [CUI-312](https://workwave.atlassian.net/browse/CUI-312)
  `chore` Update dependencies.
  Change all `peerDependencies` to accept a `minor` version range instead of `>=`. See [here](https://docs.npmjs.com/about-semantic-versioning#using-semantic-versioning-to-specify-update-types-your-package-can-accept).
- ce560ea4: `frontend-ops` Update all project dependencies to the latest.

  We are not updating `vite` to the latest until `cypress` release a new version supporting the latest `vite`.
  Relevant [GitHub issue](https://github.com/cypress-io/cypress/issues/26138).

- e7c22b62: ** ATTENTION**

  All packages package.json `export` and `typesVersion` fields are dynamically generated through pragma expressions across the source code.
  To mark a module to be added to the exports map, put at the top a single-line comment using the pragma `// @tidal-export`. The full path from the root `src` folder will be used as the export path by default. Modules with an `index` file will use the parent folder name as the export path.
  For example, `src/components/Button.tsx` and `src/components/Button/index.tsx` will export as `./components/Button`. The export alias can be manually configured using the additional argument `alias`. For example, the file `src/components/Button.tsx` with the following pragma `// @tidal-export alias=./ToggleButton` will be exported as `./ToggleButton`.

## 0.0.13

### Patch Changes

- d25909b: Update dependencies to the latest versions.

## 0.0.12

### Patch Changes

- c6f356a: Add `width` and `height` props to `<Container />`.

## 0.0.11

### Patch Changes

- Upgraded 3rd party dependencies

## 0.0.10

### Patch Changes

- af99bc3: ### Refactor of all MUI related default imports

  All MUI default imports have been refactored from that form:

  ```tsx
  import Delete from "@mui/icons-material/Delete";
  import AddCircle from "@mui/icons-material/AddCircle";
  ```

  to that form:

  ```tsx
  import { AddCircle, Delete } from "@mui/icons-material";
  ```

  This has been done to prevent issues with Vite dev mode.

## 0.0.9

### Patch Changes

- bd9232c: Removed .npmignore in favor of explicit "files" field in the package.json. [CUI-196](https://workwave.atlassian.net/browse/CUI-196)

## 0.0.8

### Patch Changes

- 634024b: This release upgrades to `React 18+`. The upgrade doesn't affect any API. `React >= 17.0.2` is the required peer dependency range.

## 0.0.7

### Patch Changes

- 6a6705e: Set the `height` of the `KnobsContainer` root component to `0px`, to avoid masking other components interactions.
  Added a `data-testid` to the `KnobsContainer` root.

## 0.0.6

### Patch Changes

- 6007a63: - migrate common helpers to story-helpers package
  - move top level type exports to their respective nested exports

## 0.0.5

### Patch Changes

- 43b3b28: Add a new `TidalStories` React Context with a connected React hook: `useTidalStories`.
  The context allows a story to be aware of

  - the size of the navigation sidebar
  - the fullScreen status
  - the collapsed status
  - the position (left or right) of the navigation sidebar

## 0.0.4

### Patch Changes

- 7823546: Update all `import` and `export` statements to respect [`ESM` standards](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import).

## 0.0.3

### Patch Changes

- 8e6eb0d: - Minor improvement to the re-export of 3rd party dependencies
  - Enabled `declarationMap`

## 0.0.2

### Patch Changes

- Force a new release of all packages
