Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/design-system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ With that out of the way, there are several parts of this design system that nee
- `config/docs.ts`: list of components in the sidebar
- `content/docs`: the actual component documentation
- `registry/examples.ts`: list of example components
- `registry/default/example`: the actual example components
- `registry/charts.ts`: chart components
- `registry/fragments.ts`: fragment components
- `registry/fragments.ts`: list of fragment components
- `registry/charts.ts`: list of chart components
- `registry/default/example/*`: the actual example components

You will probably need to rebuild the design system’s registry after making new additions. You can do that via:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,38 @@ export default function ComposedChartBasic() {
},
]

const data = Array.from({ length: 46 }, (_, i) => {
const data = Array.from({ length: 40 }, (_, i) => {
const date = new Date()
date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
date.setMinutes(date.getMinutes() - i * 3) // Each point 3 minutes apart

const progress = i / 40
const standard_score = Math.floor(55 + progress * 55 + (Math.random() - 0.5) * 12)
const performance = Math.floor(35 + progress * 35 + (Math.random() - 0.5) * 10)
const efficiency = Math.floor(25 + progress * 25 + (Math.random() - 0.5) * 12)

return {
timestamp: date.toISOString(),
standard_score: Math.floor(Math.random() * 100),
standard_score: Math.max(0, Math.min(100, standard_score)),
performance: Math.max(0, Math.min(100, performance)),
efficiency: Math.max(0, Math.min(100, efficiency)),
}
}).reverse()

const chartConfig = {
standard_score: {
label: 'Standard Score',
color: 'hsl(var(--brand-default))',
},
performance: {
label: 'Performance',
color: 'hsl(var(--chart-2))',
},
efficiency: {
label: 'Efficiency',
color: 'hsl(var(--chart-5))',
},
}

useEffect(() => {
setTimeout(() => {
setIsLoading(false)
Expand All @@ -50,10 +72,8 @@ export default function ComposedChartBasic() {
<ChartCard>
<ChartHeader>
<ChartTitle tooltip="This is a tooltip">Standard Bar Chart</ChartTitle>

<ChartActions actions={actions} />
</ChartHeader>

<ChartContent
isEmpty={data.length === 0}
emptyState={
Expand Down Expand Up @@ -86,10 +106,8 @@ export default function ComposedChartBasic() {
<ChartCard>
<ChartHeader>
<ChartTitle tooltip="This is a tooltip">Standard Line Chart</ChartTitle>

<ChartActions actions={actions} />
</ChartHeader>

<ChartContent
isEmpty={data.length === 0}
emptyState={
Expand All @@ -105,6 +123,8 @@ export default function ComposedChartBasic() {
<ChartLine
data={data}
dataKey="standard_score"
dataKeys={['standard_score', 'performance', 'efficiency']}
config={chartConfig}
showGrid={true}
showYAxis={true}
YAxisProps={{
Expand Down
33 changes: 22 additions & 11 deletions apps/design-system/__registry__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,6 @@ export const Index: Record<string, any> = {
subcategory: "undefined",
chunks: []
},
"aspect-ratio-demo": {
name: "aspect-ratio-demo",
type: "components:example",
registryDependencies: ["aspect-ratio"],
component: React.lazy(() => import("@/registry/default/example/aspect-ratio-demo")),
source: "",
files: ["registry/default/example/aspect-ratio-demo.tsx"],
category: "undefined",
subcategory: "undefined",
chunks: []
},
"alert-dialog-destructive": {
name: "alert-dialog-destructive",
type: "components:example",
Expand All @@ -192,6 +181,17 @@ export const Index: Record<string, any> = {
subcategory: "undefined",
chunks: []
},
"aspect-ratio-demo": {
name: "aspect-ratio-demo",
type: "components:example",
registryDependencies: ["aspect-ratio"],
component: React.lazy(() => import("@/registry/default/example/aspect-ratio-demo")),
source: "",
files: ["registry/default/example/aspect-ratio-demo.tsx"],
category: "undefined",
subcategory: "undefined",
chunks: []
},
"avatar-demo": {
name: "avatar-demo",
type: "components:example",
Expand Down Expand Up @@ -2238,6 +2238,17 @@ export const Index: Record<string, any> = {
subcategory: "undefined",
chunks: []
},
"page-section-title-only": {
name: "page-section-title-only",
type: "components:example",
registryDependencies: undefined,
component: React.lazy(() => import("@/registry/default/example/page-section-title-only")),
source: "",
files: ["registry/default/example/page-section-title-only.tsx"],
category: "undefined",
subcategory: "undefined",
chunks: []
},
"page-section-with-aside": {
name: "page-section-with-aside",
type: "components:example",
Expand Down
15 changes: 12 additions & 3 deletions apps/design-system/content/docs/fragments/page-section.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ fragment: true
## Sub-components

- `PageSection` - Root container with orientation variants (`horizontal` or `vertical`)
- `PageSectionMeta` - Meta wrapper for summary and aside (groups summary and aside together)
- `PageSectionSummary` - Container for section title and description (should be inside PageSectionMeta, has `flex-1`)
- `PageSectionMeta` - Meta wrapper for `PageSectionSummary` and optional `PageSectionAside`
- `PageSectionSummary` - Container for section title and description (should be inside `PageSectionMeta`, has `flex-1`)
- `PageSectionTitle` - Section heading (h2)
- `PageSectionDescription` - Supporting text below section title
- `PageSectionAside` - Container for section-level actions (should be inside PageSectionMeta, has `shrink-0`)
- `PageSectionAside` - Container for section-level actions (should be inside `PageSectionMeta`, has `shrink-0`)
- `PageSectionContent` - Container for the main section content

## Orientation Variants
Expand All @@ -45,3 +45,12 @@ fragment: true
peekCode
wide
/>

### Without Aside

<ComponentPreview
name="page-section-title-only"
description="PageSection with title only"
peekCode
wide
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Card, CardContent } from 'ui'
import {
PageSection,
PageSectionContent,
PageSectionMeta,
PageSectionSummary,
PageSectionTitle,
} from 'ui-patterns/PageSection'

export default function PageSectionTitleOnly() {
return (
<div className="w-full">
<PageSection>
<PageSectionMeta>
<PageSectionSummary>
<PageSectionTitle>Section Title</PageSectionTitle>
</PageSectionSummary>
</PageSectionMeta>
<PageSectionContent>
<Card>
<CardContent className="p-6">
<p className="text-sm text-foreground-light">
PageSectionSummary should still be wrapped in PageSectionMeta, as the latter is a
flex container that will allow the former to span its full width.
</p>
</CardContent>
</Card>
</PageSectionContent>
</PageSection>
</div>
)
}
5 changes: 5 additions & 0 deletions apps/design-system/registry/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,11 @@ export const examples: Registry = [
type: 'components:example',
files: ['example/page-section-horizontal.tsx'],
},
{
name: 'page-section-title-only',
type: 'components:example',
files: ['example/page-section-title-only.tsx'],
},
{
name: 'page-section-with-aside',
type: 'components:example',
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/guides/ai/vector-columns.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ In general, embeddings with fewer dimensions perform best. See our [analysis on
In this example we'll generate a vector using Transformers.js, then store it in the database using the Supabase JavaScript client.

```js
import { pipeline } from '@xenova/transformers'
import { pipeline } from '@huggingface/transformers'
const generateEmbedding = await pipeline('feature-extraction', 'Supabase/gte-small')

const title = 'First post!'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ revoke all
create policy "Allow auth admin to read user roles" ON public.user_roles
as permissive for select
to supabase_auth_admin
using (true)
using (true);
```

</TabPanel>
Expand Down
4 changes: 1 addition & 3 deletions apps/docs/content/troubleshooting/exhaust-swap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ High Swap usage can affect your database performance. For example, you might see

## Monitor your swap

You can check your Swap usage directly on the Supabase Platform. Navigate to the [**Database** page](/dashboard/project/_/observability/database) of the **Observability** section.

You can also monitor your resources and set up alerts using Prometheus/Grafana. See the [metrics guide](/docs/guides/platform/metrics) for more information.
You can monitor your resources and set up alerts using Prometheus/Grafana. See the [metrics guide](/docs/guides/platform/metrics) for more information.

An [example repository](https://github.com/supabase/supabase-grafana) to ingest metrics and visualize them with Grafana is provided in the linked guide, where we maintain a [list of the exported metrics](https://github.com/supabase/supabase-grafana/blob/main/docs/metrics.md).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
},
"isOptional": true,
"comment": {
"shortText": "Confirms the user's email address if set to true.\\n\\nOnly a service role can modify."
"shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\\n\\nOnly a service role can modify."
}
},
{
Expand Down Expand Up @@ -2357,7 +2357,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
},
"isOptional": true,
"comment": {
"shortText": "Confirms the user's phone number if set to true.\\n\\nOnly a service role can modify."
"shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\\n\\nOnly a service role can modify."
}
},
{
Expand Down Expand Up @@ -5788,7 +5788,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
},
"isOptional": true,
"comment": {
"shortText": "Confirms the user's email address if set to true.\\n\\nOnly a service role can modify."
"shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\\n\\nOnly a service role can modify."
}
},
{
Expand Down Expand Up @@ -5854,7 +5854,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
},
"isOptional": true,
"comment": {
"shortText": "Confirms the user's phone number if set to true.\\n\\nOnly a service role can modify."
"shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\\n\\nOnly a service role can modify."
}
},
{
Expand Down Expand Up @@ -6452,7 +6452,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
}
},
"comment": {
"shortText": "Updates the user data."
"shortText": "Updates the user data. Changes are applied directly without confirmation flows."
}
},
"@supabase/supabase-js.GoTrueClient.constructor": {
Expand Down Expand Up @@ -43034,7 +43034,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
},
"isOptional": true,
"comment": {
"shortText": "Confirms the user's email address if set to true.\\n\\nOnly a service role can modify."
"shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\\n\\nOnly a service role can modify."
}
},
{
Expand Down Expand Up @@ -43100,7 +43100,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
},
"isOptional": true,
"comment": {
"shortText": "Confirms the user's phone number if set to true.\\n\\nOnly a service role can modify."
"shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\\n\\nOnly a service role can modify."
}
},
{
Expand Down Expand Up @@ -46528,7 +46528,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
},
"isOptional": true,
"comment": {
"shortText": "Confirms the user's email address if set to true.\\n\\nOnly a service role can modify."
"shortText": "Sets the user's email as confirmed when true, or unconfirmed when false.\\n\\nOnly a service role can modify."
}
},
{
Expand Down Expand Up @@ -46594,7 +46594,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
},
"isOptional": true,
"comment": {
"shortText": "Confirms the user's phone number if set to true.\\n\\nOnly a service role can modify."
"shortText": "Sets the user's phone as confirmed when true, or unconfirmed when false.\\n\\nOnly a service role can modify."
}
},
{
Expand Down Expand Up @@ -47192,7 +47192,7 @@ exports[`TS type spec parsing > matches snapshot 1`] = `
}
},
"comment": {
"shortText": "Updates the user data."
"shortText": "Updates the user data. Changes are applied directly without confirmation flows."
}
},
"@supabase/auth-js.GoTrueClient.constructor": {
Expand Down
1 change: 1 addition & 0 deletions apps/docs/public/humans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Thor Schaeff
Tim Frietas
Tim Palmer
Timothy Lim
Tina Ha
Tom Ashley
Tom G
Tomás Pozo
Expand Down
Loading
Loading