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/feat-styled-tags-export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@emotion/styled": minor
---

Added ability to import tags directly from '@emotion/styled/tags'
56 changes: 56 additions & 0 deletions packages/styled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,66 @@
"files": [
"src",
"dist",
"tags",
"base",
"macro.*"
],
"umd:main": "dist/emotion-styled.umd.min.js",
"exports": {
"./tags": {
"types": {
"import": "./tags/dist/emotion-styled-tags.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.cjs.js"
},
"development": {
"edge-light": {
"module": "./tags/dist/emotion-styled-tags.development.edge-light.esm.js",
"import": "./tags/dist/emotion-styled-tags.development.edge-light.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.development.edge-light.cjs.js"
},
"worker": {
"module": "./tags/dist/emotion-styled-tags.development.edge-light.esm.js",
"import": "./tags/dist/emotion-styled-tags.development.edge-light.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.development.edge-light.cjs.js"
},
"workerd": {
"module": "./tags/dist/emotion-styled-tags.development.edge-light.esm.js",
"import": "./tags/dist/emotion-styled-tags.development.edge-light.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.development.edge-light.cjs.js"
},
"browser": {
"module": "./tags/dist/emotion-styled-tags.browser.development.esm.js",
"import": "./tags/dist/emotion-styled-tags.browser.development.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.browser.development.cjs.js"
},
"module": "./tags/dist/emotion-styled-tags.development.esm.js",
"import": "./tags/dist/emotion-styled-tags.development.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.development.cjs.js"
},
"edge-light": {
"module": "./tags/dist/emotion-styled-tags.edge-light.esm.js",
"import": "./tags/dist/emotion-styled-tags.edge-light.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.edge-light.cjs.js"
},
"worker": {
"module": "./tags/dist/emotion-styled-tags.edge-light.esm.js",
"import": "./tags/dist/emotion-styled-tags.edge-light.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.edge-light.cjs.js"
},
"workerd": {
"module": "./tags/dist/emotion-styled-tags.edge-light.esm.js",
"import": "./tags/dist/emotion-styled-tags.edge-light.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.edge-light.cjs.js"
},
"browser": {
"module": "./tags/dist/emotion-styled-tags.browser.esm.js",
"import": "./tags/dist/emotion-styled-tags.browser.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.browser.cjs.js"
},
"module": "./tags/dist/emotion-styled-tags.esm.js",
"import": "./tags/dist/emotion-styled-tags.cjs.mjs",
"default": "./tags/dist/emotion-styled-tags.cjs.js"
},
"./base": {
"types": {
"import": "./base/dist/emotion-styled-base.cjs.mjs",
Expand Down Expand Up @@ -177,6 +232,7 @@
"preconstruct": {
"umdName": "emotionStyled",
"entrypoints": [
"./tags.ts",
"./index.ts",
"./base.tsx"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Theme } from '@emotion/react'
import styled from './base'
import { ReactJSXIntrinsicElements } from './jsx-namespace'
import { tags } from './tags'
import tags from './tags'
import {
CreateStyledComponent,
CreateStyled as BaseCreateStyled
Expand Down
2 changes: 1 addition & 1 deletion packages/styled/src/tags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const tags = [
export default [
'a',
'abbr',
'address',
Expand Down
9 changes: 9 additions & 0 deletions packages/styled/tags/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"main": "dist/emotion-styled-tags.cjs.js",
"module": "dist/emotion-styled-tags.esm.js",
"umd:main": "dist/emotion-styled-tags.umd.min.js",
"types": "dist/emotion-styled-tags.cjs.d.ts",
"preconstruct": {
"umdName": "emotionStyledTags"
}
}