Skip to content
Open
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
4 changes: 2 additions & 2 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
{
"path": "./packages/orange/dist/css/ouds-web.min.css",
"maxSize": "62.75 kB"
"maxSize": "63.0 kB"
},
{
"path": "./dist/js/ouds-web.bundle.js",
Expand Down Expand Up @@ -70,4 +70,4 @@
"main"
]
}
}
}
9,719 changes: 5,150 additions & 4,569 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"css-lint": "npm-run-all --aggregate-output --continue-on-error --parallel css-lint-*",
"css-lint-stylelint": "stylelint \"**/*.{css,scss}\" --ignore-pattern \"__snapshots__\" --cache --cache-location .cache/.stylelintcache",
"css-prefix-examples": "postcss --config build/postcss.config.mjs --replace \"site/src/assets/examples/**/*.css\"",
"css-snapshot-refresh": "npm run css && cp packages/orange/dist/css/ouds-web.css scss/tests/snapshot-tests/__snapshots__/ouds-web.css && cp packages/orange/dist/css/ouds-web-bootstrap.css scss/tests/snapshot-tests/__snapshots__/ouds-web-bootstrap.css && git restore packages/*/dist",
"css-snapshot-refresh": "npm run css-dev-orange && cp packages/orange/dist/css/ouds-web.css scss/tests/snapshot-tests/__snapshots__/ouds-web.css && cp packages/orange/dist/css/ouds-web-bootstrap.css scss/tests/snapshot-tests/__snapshots__/ouds-web-bootstrap.css && git restore packages/orange/dist",
"css-test": "jasmine --config=scss/tests/jasmine.js",
"css-snapshot-test": "vitest --config=scss/tests/snapshot-tests/vitest.config.ts",
"js": "npm-run-all js-compile js-minify",
Expand Down Expand Up @@ -94,11 +94,11 @@
"@popperjs/core": "^2.11.8"
},
"devDependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/markdown-remark": "^6.3.6",
"@astrojs/mdx": "^4.3.4",
"@astrojs/prism": "^3.3.0",
"@astrojs/sitemap": "^3.5.0",
"@astrojs/check": "^0.9.9",
"@astrojs/markdown-remark": "^7.2.1",
"@astrojs/mdx": "^7.0.3",
"@astrojs/prism": "^4.0.2",
"@astrojs/sitemap": "^3.7.3",
"@babel/cli": "^7.28.3",
"@babel/core": "^7.29.6",
"@babel/preset-env": "^7.28.3",
Expand All @@ -116,8 +116,7 @@
"@types/js-yaml": "^4.0.9",
"@types/mime": "^4.0.0",
"@types/prismjs": "^1.26.5",
"astro": "^5.13.2",
"astro-auto-import": "^0.4.4",
"astro": "^7.1.3",
"autoprefixer": "^10.4.21",
Comment thread
louismaximepiton marked this conversation as resolved.
"bundlewatch": "^0.4.2",
"clean-css-cli": "^5.6.3",
Expand Down
2 changes: 2 additions & 0 deletions scss/_alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
gap: $ouds-alert-space-row-gap-action;
align-items: flex-start;
justify-content: center; // To handle weird edge cases in de-zoom one line title alert
width: 20%;
min-height: $ouds-alert-size-min-height; // To handle weird edge cases in de-zoom one line title alert
padding-block: $ouds-alert-space-padding-block;
}
Expand All @@ -105,6 +106,7 @@
display: flex;
flex-direction: column;
gap: $ouds-alert-space-row-gap;
width: 100%;

Comment thread
louismaximepiton marked this conversation as resolved.
> * { // To handle any content inside this text-container.
margin-bottom: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5422,8 +5422,8 @@ dialog,
}
.table tr .radio-button-standalone,
.table tr .checkbox-standalone {
width: -webkit-fill-available;
width: -moz-available;
width: -webkit-fill-available;
width: stretch;
}
.table svg,
Expand Down Expand Up @@ -11622,6 +11622,7 @@ ol.bullet-list > li > ol > li > ol > li::before {
gap: 4px;
align-items: flex-start;
justify-content: center;
width: 20%;
min-height: 48px;
padding-block: 12px;
}
Expand All @@ -11630,6 +11631,7 @@ ol.bullet-list > li > ol > li > ol > li::before {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
}
.alert-text-container > * {
margin-bottom: 0;
Expand Down
4 changes: 3 additions & 1 deletion scss/tests/snapshot-tests/__snapshots__/ouds-web.css
Original file line number Diff line number Diff line change
Expand Up @@ -3529,8 +3529,8 @@ dialog,
}
.table tr .radio-button-standalone,
.table tr .checkbox-standalone {
width: -webkit-fill-available;
width: -moz-available;
width: -webkit-fill-available;
width: stretch;
}
.table svg,
Expand Down Expand Up @@ -9445,6 +9445,7 @@ ol.bullet-list > li > ol > li > ol > li::before {
gap: 4px;
align-items: flex-start;
justify-content: center;
width: 20%;
min-height: 48px;
padding-block: 12px;
}
Expand All @@ -9453,6 +9454,7 @@ ol.bullet-list > li > ol > li > ol > li::before {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
}
.alert-text-container > * {
margin-bottom: 0;
Expand Down
27 changes: 27 additions & 0 deletions site/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ import { oudsWeb } from './src/libs/astro'
import { getConfig } from './src/libs/config'
import { algoliaPlugin } from './src/plugins/algolia-plugin'
import { stackblitzPlugin } from './src/plugins/stackblitz-plugin'
import type { Element, Text } from 'hast'
import { rehypeHeadingIds, unified } from '@astrojs/markdown-remark'
import { rehypeBsTable } from './src/libs/rehype'
import { remarkBsComp, remarkBsConfig, remarkBsDocsref } from './src/libs/remark'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'

const isDev = process.env.NODE_ENV === 'development'

const headingsRangeRegex = new RegExp(`^h[${getConfig().anchors.min}-${getConfig().anchors.max}]$`)

const site = isDev
? // In development mode, use the local dev server.
'http://localhost:9001'
Expand All @@ -20,12 +27,32 @@ const site = isDev

// https://astro.build/config
export default defineConfig({
compressHTML: false,
build: {
assets: `${getConfig().brand}/docs/${getConfig().docs_version}/assets`
},
integrations: [oudsWeb()],
markdown: {
smartypants: false,
processor: unified({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know if this was a mandatory change but I think it's clearer to have that config here 👍
Will need to integrate the modifications that @duvalale did for the changelog links

rehypePlugins: [
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
behavior: 'append',
content: [{ type: 'text', value: ' '}],
properties: (element: Element) => ({
class: 'anchor-link',
ariaLabel: `Link to this section: ${(element.children[0] as Text).value}`
}),
test: (element: Element) => element.tagName.match(headingsRangeRegex)
}
],
rehypeBsTable
],
remarkPlugins: [remarkBsConfig, remarkBsDocsref, remarkBsComp]
}),
syntaxHighlight: 'prism'
},
site,
Expand Down
11 changes: 6 additions & 5 deletions site/src/components/DocsSidebar.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import { getData } from '@libs/data'
import { getConfig } from '@libs/config'
import { docsPages } from '@libs/content'
import { docsPages, getDocsPageSlug } from '@libs/content'
import { getSlug } from '@libs/utils'
import { getVersionedDocsPath } from '@libs/path'

Expand All @@ -14,9 +14,10 @@ const sidebarMap = {
utilities: 'utilities',
layout: 'layout',
about: ''
}
} as const

const sidebar = sidebarMap[slug] ? getData(`sidebar-${sidebarMap[slug]}`) : []
const sidebarKey = sidebarMap[slug as keyof typeof sidebarMap]
const sidebar = sidebarKey ? getData(`sidebar-${sidebarKey}`) : []

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I rewrote this too in the Scrollspy update. I started from the actual data definition to get the sidebars and have a hard typing. We can keep this and see what we do on the scrollspy side

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only some warnings that I got from the tsconfig, I can revert them and wait for Scrollspy

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes same, just I fixed them with an other solution but we can discuss on the Scrollspy PR

---

<nav class="bd-links w-100" id="bd-docs-nav" aria-labelledby="docs-nav">
Expand Down Expand Up @@ -60,12 +61,12 @@ const sidebar = sidebarMap[slug] ? getData(`sidebar-${sidebarMap[slug]}`) : []
}
const active = Astro.params.slug === unversionedPageSlug

const generatedPage = docsPages.find((page: any) => page.slug === unversionedPageSlug)
const generatedPage = docsPages.find((page: any) => getDocsPageSlug(page.id) === unversionedPageSlug)

// This test should not be necessary, see comments for `getSlug()` in `src/libs/utils.ts`.
if (!page.direct_url && !generatedPage) {
throw new Error(
`The page '${page.title}' referenced in 'site/data/sidebar${sidebarMap[slug]}.yml' does not exist at '${url}'.`
`The page '${page.title}' referenced in 'site/data/sidebar${sidebarKey}.yml' does not exist at '${url}'.`
)
}

Expand Down
3 changes: 2 additions & 1 deletion site/src/components/shortcodes/Callout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import { getCalloutByName } from '@libs/content'
import type { MarkdownInstance } from 'astro'
import { render } from 'astro:content'

interface Props {
/**
Expand Down Expand Up @@ -72,7 +73,7 @@ if (name) {
throw new Error(`Could not find callout with name '${name}'.`)
}

const namedCallout = await callout.render()
const namedCallout = await render(callout)
if (namedCallout.remarkPluginFrontmatter && namedCallout.remarkPluginFrontmatter.title) {
titleToDisplay = namedCallout.remarkPluginFrontmatter.title
}
Expand Down
27 changes: 27 additions & 0 deletions site/src/components/shortcodes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export { default as AddedIn } from './AddedIn.astro'
export { default as BootstrapCompatibility } from './BootstrapCompatibility.astro'
export { default as BrandSpecific } from './BrandSpecific.astro'
export { default as BsTable } from './BsTable.astro'
export { default as Callout } from './Callout.astro'
export { default as CalloutSoon } from './CalloutSoon.astro'
export { default as Code } from './Code.astro'
export { default as ColorTable } from './ColorTable.astro'
export { default as ComponentCard } from './ComponentCard.astro'
export { default as ControlItem } from './ControlItem.mdx'
export { default as DeprecatedIn } from './DeprecatedIn.astro'
export { default as Details } from './Details.astro'
export { default as EnableBtnCloseTooltip } from './EnableBtnCloseTooltip.astro'
export { default as Example } from './Example.astro'
export { default as GuideFooter } from './GuideFooter.mdx'
export { default as JsDataAttributes } from './JsDataAttributes.mdx'
export { default as JsDismiss } from './JsDismiss.astro'
export { default as JsDocs } from './JsDocs.astro'
export { default as MandatoryFieldIndication } from './MandatoryFieldIndication.astro'
export { default as Placeholder } from './Placeholder.astro'
export { default as ScssDocs } from './ScssDocs.astro'
export { default as SkeletonRedirect } from './SkeletonRedirect.astro'
export { default as SvgDocs } from './SvgDocs.astro'
export { default as Table } from './Table.astro'
export { default as TableContent } from './TableContent.md'
export { default as ThemeDemo } from './ThemeDemo.astro'
export { default as ThemeDemoStylesImport } from './ThemeDemoStylesImport.astro'
9 changes: 9 additions & 0 deletions site/src/content/config.ts → site/src/content.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { z, defineCollection } from 'astro:content'
import { glob } from 'astro/loaders'

const docsSchema = z.object({
added: z
Expand Down Expand Up @@ -34,12 +35,20 @@ const docsSchema = z.object({
})

const docsCollection = defineCollection({
loader: glob({
base: './src/content/docs',
pattern: '**/*.{md,mdx}'
}),
schema: docsSchema
})

const calloutsSchema = z.object({})

const calloutsCollection = defineCollection({
loader: glob({
base: './src/content/callouts',
pattern: '**/*.{md,mdx}'
}),
schema: calloutsSchema
})

Expand Down
1 change: 1 addition & 0 deletions site/src/content/docs/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ toc: true

import { componentsDetails } from '../../../data/components-details'
import { getVersionedDocsPath } from '@libs/path'
import { ComponentCard } from '@components/shortcodes'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not made available everywhere by what you added in [...slug].astro‎?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought, but I had some errors while not having it, I don't know why tbh


<Callout
type="info"
Expand Down
Loading
Loading