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
5 changes: 5 additions & 0 deletions .changeset/shiny-cheetahs-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/styled-react": patch
---

Removing `ActionList, Box, Button, Dialog, Flash, FormControl, Header, Heading, IconButton, Label, Link, LinkButton, SegmentedControl, Spinner, Text, TextInput, ToggleSwitch, UnderlineNav, DialogV1, Octicon, TabNav` from the @primer/styled-react package
21 changes: 0 additions & 21 deletions e2e/styled-react/components/Button.test.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/styled-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./deprecated": {
"types": "./dist/deprecated.d.ts",
"default": "./dist/deprecated.js"
},
"./experimental": {
"types": "./dist/experimental.d.ts",
"default": "./dist/experimental.js"
},
"./components.json": "./dist/components.json"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/styled-react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function createPackageRegex(name) {
}

export default defineConfig({
input: ['src/index.tsx', 'src/experimental.tsx', 'src/deprecated.tsx'],
input: ['src/index.tsx'],
external: dependencies.map(createPackageRegex),
plugins: [
Comment on lines 18 to 21
typescript({
Expand Down
2 changes: 1 addition & 1 deletion packages/styled-react/script/generate-components-json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function generateComponentsJson() {
const types = new Set()
const utilities = new Set()

const entrypoints = ['src/index.tsx', 'src/deprecated.tsx', 'src/experimental.tsx']
const entrypoints = ['src/index.tsx']

for (const entrypoint of entrypoints) {
const filename = path.join(PACKAGE_ROOT, entrypoint)
Expand Down
131 changes: 0 additions & 131 deletions packages/styled-react/src/__tests__/Box.browser.test.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import {render, screen, waitFor} from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import {describe, expect, it, vi} from 'vitest'
import React from 'react'
import {ThemeProvider, useColorSchemeVar, useTheme, Box} from '../'
import styled from 'styled-components'
import {color, space} from 'styled-system'
import type {ColorProps, SpaceProps} from 'styled-system'
import {ThemeProvider, useColorSchemeVar, useTheme} from '../'

const Box = styled.div<ColorProps & SpaceProps>(color, space)

// window.matchMedia() is not implemented by JSDOM so we have to create a mock:
// https://vijs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`has default theme 1`] = `
<div
class="sc-aXZVg hPmBIl"
class="sc-aXZVg iOsRUA"
color="fg.default"
>
Hello
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,13 @@

exports[`@primer/styled-react exports 1`] = `
[
"ActionList",
"BaseStyles",
"Box",
"Button",
"Dialog",
"Flash",
"Heading",
"IconButton",
"Label",
"Link",
"merge",
"Spinner",
"sx",
"Text",
"TextInput",
"theme",
"themeGet",
"ThemeProvider",
"ToggleSwitch",
"UnderlineNav",
"useColorSchemeVar",
"useTheme",
]
`;

exports[`@primer/styled-react/deprecated exports 1`] = `
[
"ActionList",
"Dialog",
"Octicon",
]
`;

exports[`@primer/styled-react/experimental exports 1`] = `
[
"Dialog",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import path from 'node:path'

const entrypoints: Array<
[name: string, filepath: string, exports: Array<[name: string, deprecatedTag: boolean, deprecatedComment: boolean]>]
> = [
['@primer/styled-react', path.resolve(import.meta.dirname, '../index.tsx'), []],
['@primer/styled-react/deprecated', path.resolve(import.meta.dirname, '../deprecated.tsx'), []],
['@primer/styled-react/experimental', path.resolve(import.meta.dirname, '../experimental.tsx'), []],
]
> = [['@primer/styled-react', path.resolve(import.meta.dirname, '../index.tsx'), []]]

const program = ts.createProgram(
entrypoints.map(entrypoint => entrypoint[1]),
Expand Down
20 changes: 0 additions & 20 deletions packages/styled-react/src/__tests__/exports.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import {test, expect} from 'vitest'
// eslint-disable-next-line import/no-namespace
import * as StyledReact from '../'
// eslint-disable-next-line import/no-namespace
import * as StyledReactDeprecated from '../deprecated'
// eslint-disable-next-line import/no-namespace
import * as StyledReactExperimental from '../experimental'

test('@primer/styled-react exports', () => {
expect(
Expand All @@ -13,19 +9,3 @@ test('@primer/styled-react exports', () => {
}),
).toMatchSnapshot()
})

test('@primer/styled-react/deprecated exports', () => {
expect(
Object.keys(StyledReactDeprecated).sort((a, b) => {
return a.localeCompare(b)
}),
).toMatchSnapshot()
})

test('@primer/styled-react/experimental exports', () => {
expect(
Object.keys(StyledReactExperimental).sort((a, b) => {
return a.localeCompare(b)
}),
).toMatchSnapshot()
})

This file was deleted.

This file was deleted.

Loading
Loading