Skip to content

Commit

Permalink
remove 'Source Code' tab
Browse files Browse the repository at this point in the history
  • Loading branch information
gioboa committed Oct 18, 2023
1 parent 48a2dae commit 2e89a6c
Show file tree
Hide file tree
Showing 24 changed files with 129 additions and 265 deletions.
21 changes: 10 additions & 11 deletions apps/docs/content/_components/accordionitem.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# AccordionItem

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1
The `SfAccordionItem` component is a wrapper around the native `<details>` and `<summary>` HTML elements. It allows you to create an accordion component that expands and collapses content.

The root element of this component is `<details>`, and any attributes that you apply onto the `SfAccordionItem` component will be passed to the `<details>` element. The one exception is the `onToggle` attribute. The component prevents the native browser behavior and implements its own `onToggle` handler.
The root element of this component is `<details>`, and any attributes that you apply onto the `SfAccordionItem` component will be passed to the `<details>` element. The one exception is the `onToggle$` attribute. The component prevents the native browser behavior and implements its own `onToggle$` handler.

::info
See all of the attributes that you can pass to `<details>` in the [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details).
Expand Down Expand Up @@ -110,15 +110,6 @@ For example, `<summary>` elements are focusable and can be activated by pressing

:::vue-only

:::qwik-only
| Prop name | Type | Default value | Possible values |
| ----------------- | ------------------------- | ------------- | --------------- |
| `open` | `boolean` | false | |
| `summaryClassName` | `string` | | |
| `onToggle` | `(open: boolean) => void` | | |
| `children` | `ReactNode` | | |
:::

## Slots

| Slot name | Description |
Expand All @@ -134,6 +125,14 @@ For example, `<summary>` elements are focusable and can be activated by pressing

:::

:::qwik-only
| Prop name | Type | Default value | Possible values |
| ----------------- | ------------------------- | ------------- | --------------- |
| `ref?` | `Signal<Element>` | | |
| `summaryClass` | `string` | | |
| `onToggle$?` | `PropFunction<(open: boolean) => void>` | | |
:::

#tab-3

## Source code
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/badge.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Badge

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/button.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Button

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/checkbox.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Checkbox

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/counter.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Counter

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/drawer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Drawer

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/dropdown.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dropdown

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/iconbase.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Icons

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/input.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Input

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/link.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Link

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/listitem.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ListItem

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/loadercircular.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LoaderCircular

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/loaderlinear.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LoaderLinear

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/modal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Modal

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/progresscircular.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ProgressCircular

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/progresslinear.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ProgressLinear

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/radio.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Radio

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/rating.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rating

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/_components/ratingbutton.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The RatingButton component is an interactive input element specifically designed for evaluations on product pages. It provides users with the ability to select a rating by choosing an icon using either the cursor or keyboard input. The number of icons displayed and the actual icon used can be customized based on your specific requirements. The rating scale within the component operates from left to right.

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

Expand Down
27 changes: 12 additions & 15 deletions apps/docs/content/_hooks/useDisclosure.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# useDisclosure

::tabs{:titles='["Usage", "API", "Source Code"]'}
::tabs{:titles='["Usage", "API"]'}

#tab-1

The `useDisclosure` utility gives you controls for a Boolean `isOpen` value. This can be used to control the visibility of components.

## Usage



::react-only

```tsx
import { SfButton, useDisclosure } from '@storefront-ui/react';

Expand All @@ -27,9 +26,11 @@ function Basic() {
);
}
```

::

::vue-only

```vue
<script lang="ts" setup>
import { SfButton, useDisclosure } from '@storefront-ui/vue';
Expand All @@ -45,24 +46,20 @@ const { isOpen, toggle, open, close } = useDisclosure();
</template>
```


::



### With Initial Value

By default, the value of `isOpen` is false. But we can pass an initial value using an option object with an `initialValue`.



::react-only

```tsx
import { SfButton, useDisclosure } from '@storefront-ui/react';

function OpenByDefault() {
const { isOpen, toggle } = useDisclosure({
initialValue: true
const { isOpen, toggle } = useDisclosure({
initialValue: true,
});

return (
Expand All @@ -73,14 +70,16 @@ function OpenByDefault() {
);
}
```

::
::vue-only

```vue
<script lang="ts" setup>
import { SfButton, useDisclosure } from '@storefront-ui/vue';
const { isOpen, toggle } = useDisclosure({
initialValue: true
const { isOpen, toggle } = useDisclosure({
initialValue: true,
});
</script>
Expand All @@ -89,8 +88,8 @@ const { isOpen, toggle } = useDisclosure({
<p v-if="isOpen">This will be open by default!</p>
</template>
```
::

::

#tab-2

Expand All @@ -111,13 +110,11 @@ const { isOpen, toggle } = useDisclosure({

#tab-3


::react-only
<<<../../../../packages/sfui/frameworks/react/hooks/useDisclosure/useDisclosure.ts
::
::vue-only
<<<../../../../packages/sfui/frameworks/vue/composables/useDisclosure/useDisclosure.ts
::


::
Loading

0 comments on commit 2e89a6c

Please sign in to comment.